diff --git a/.github/workflows/build_offline_docs.yml b/.github/workflows/build_offline_docs.yml index 732fca19b7e..e908b453231 100644 --- a/.github/workflows/build_offline_docs.yml +++ b/.github/workflows/build_offline_docs.yml @@ -13,6 +13,7 @@ jobs: matrix: branch: - master + - stable - 3.6 steps: - uses: actions/checkout@v4 @@ -29,7 +30,7 @@ jobs: - name: Sphinx - Build HTML run: make SPHINXOPTS='--color' html - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: godot-docs-html-${{ matrix.branch }} path: _build/html @@ -51,7 +52,7 @@ jobs: make SPHINXOPTS='--color' epub - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: godot-docs-epub-${{ matrix.branch }} path: _build/epub/GodotEngine.epub diff --git a/.github/workflows/sync_class_ref.yml b/.github/workflows/sync_class_ref.yml index 62afa39e57a..a2641cf008c 100644 --- a/.github/workflows/sync_class_ref.yml +++ b/.github/workflows/sync_class_ref.yml @@ -51,7 +51,7 @@ jobs: ./.engine-src/doc/tools/make_rst.py --color -o ./classes -l en ./.engine-src/doc/classes ./.engine-src/modules ./.engine-src/platform - name: Submit a pull-request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6 with: commit-message: 'classref: Sync with current ${{ env.engine_rev }} branch (${{ steps.engine.outputs.rev_hash_short }})' branch: 'classref/sync-${{ steps.engine.outputs.rev_hash_short }}' diff --git a/_extensions/godot_descriptions.py b/_extensions/godot_descriptions.py index 3f6f8c49210..a59cf3321b5 100644 --- a/_extensions/godot_descriptions.py +++ b/_extensions/godot_descriptions.py @@ -103,10 +103,11 @@ def generate_description(app, pagename, templatename, context, doctree): doctree.walkabout(generator) description = ( - '\n' + '\n' ) - context["metatags"] += description + if not ' meta.name === "doc_pagename"); + if (pageNameMetaElement == null) { + removeGiscusContainer(); + return; + } + + const pageNameDenyList = [ + "search" + ]; + if (pageNameDenyList.includes(pageNameMetaElement.content)) { + removeGiscusContainer(); + return; + } + + // Use https://giscus.app/ to regenerate the script tag if needed. + // data-term is set to be language-independent and version-independent, so that comments can be centralized for each page. + // This increases the likelihood that users will encounter comments on less frequently visited pages. + const scriptElement = document.createElement("script"); + scriptElement.src = "https://giscus.app/client.js"; + scriptElement.crossOrigin = "anonymous"; + scriptElement.async = true; + + const dataset = { + repo: "godotengine/godot-docs-user-notes", + repoId: "R_kgDOKuNx0w", + category: "User-contributed notes", + categoryId: "DIC_kwDOKuNx084CbANb", + mapping: "specific", + term: pageNameMetaElement.content, + strict: "1", + reactionsEnabled: "0", + emitMetadata: "0", + inputPosition: "bottom", + theme: "preferred_color_scheme", + lang: "en", + loading: "lazy", + }; + + for (const [key, value] of Object.entries(dataset)) { + scriptElement.dataset[key] = value; + } + + giscusContainer.append(scriptElement); +}; + $(document).ready(() => { // Remove the search match highlights from the page, and adjust the URL in the // navigation history. @@ -246,6 +305,17 @@ $(document).ready(() => { Documentation.hideSearchWords(); } + window.addEventListener('keydown', function(event) { + if (event.key === '/') { + var searchField = document.querySelector('#rtd-search-form input[type=text]'); + if (document.activeElement !== searchField) { + searchField.focus(); + searchField.select(); + event.preventDefault(); + } + } + }); + // Initialize handlers for page scrolling and our custom sidebar. const mediaQuery = window.matchMedia('only screen and (min-width: 769px)'); @@ -414,6 +484,9 @@ $(document).ready(() => { registerOnScrollEvent(mediaQuery); } + + // Giscus + registerGiscus(); }); // Override the default implementation from doctools.js to avoid this behavior. diff --git a/_styleguides/de.md b/_styleguides/de.md new file mode 100644 index 00000000000..649cdcefe15 --- /dev/null +++ b/_styleguides/de.md @@ -0,0 +1,555 @@ +# Stilregeln für die Übersetzung von Godot ins Deutsche + +## Einleitung + +Dieses Dokument soll dabei helfen, die deutsche Übersetzung von Godot, sowie +der Godot-Dokumentation, stilistisch zu vereinheitlichen. Dabei sollen +Lesbarkeit, Klarheit und Benutzbarkeit besonders im Vordergrund stehen. + +Für die Übersetzung selbst ist das Tool +[Weblate](https://hosted.weblate.org/projects/godot-engine/) im Einsatz, das in der +[offiziellen Dokumentation](https://docs.godotengine.org/de/4.x/contributing/documentation/editor_and_docs_localization.html) näher +erläutert wird. Die Bedienung von Weblate ist nicht Bestandteil dieses +Dokuments. + +Weblate verfügt über ein Glossar, in dem häufig verwendete Begriffe gelistet +werden, damit sie einheitlich übersetzt werden können. In diesem Dokument +wird daher darauf verzichtet, die Übersetzung einzelner Begriffe zu +klären. Sollte es bei der Übersetzung eines Begriffs Uneinigkeit geben, +so sollte dies zunächst im [Chatraum für die deutsche +Godot-Übersetzung](https://chat.godotengine.org/channel/translation-de) diskutiert und dann ins Glossar eingetragen werden. + +## Technische Hilfsmittel + +### Automatische Übersetzungen und Workflow + +Die Erfahrung zeigt, dass eine Übersetzung von längeren Texten, z.B. aus der +Anleitung oder der Klassenreferenz oft zu schnelleren und besseren Ergebnissen +führt, wenn man den Originaltext von einer KI vorübersetzen lässt. + +Ein sehr zu empfehlender Übersetzungsdienst ist hier die Website +https://www.deepl.com, die hervorragende Erstübersetzungen zur Verfügung stellt +und selbst Formatierungszeichen, wie Fettdruck oder Links in vielen Fällen +korrekt in die Übersetzung übernimmt. + +Ein weiterer Vorteil dieser Art zu übersetzen ist, dass ein und derselbe Text +mit hoher Wahrscheinlichkeit strukturell wiederholt gleich übersetzt wird, was +sehr hilfreich sein kann, wenn sich die Originaltexte leicht ändern und dann +die vorgenerierte Übersetzung immer noch dicht an der vorigen Übersetzung ist. + +Hier ist ein empfohlener Workflow für die Übersetzung eines Textblocks: + +* Originaltext kopieren +* In DeepL übersetzen lassen +* In Übersetzungsfeld einfügen +* Text auf Abweichungen zum Glossar prüfen und ggf. korrigieren +* Eigene Änderungen vornehmen, wo sinnvoll + +Es ist zudem ratsam, Korrekturen direkt auf der rechten Seite von DeepL vorzunehmen, +da das Tool bei wiederholten Korrekturen dazulernen kann. Begriffe, die +hartnäckig falsch übersetzt werden, kann man zudem ins DeepL-Glossar eintragen +und damit eine bestimmte Übersetzung erzwingen. + +## Stilregeln + +### Du oder Sie + +Die aktuelle Übersetzung von Godot verwendet „Sie” statt „Du” bei direkter +Ansprache. Zwar wäre die freundlichere „Du”-Form im Gaming-Bereich ebenfalls +eine gute Wahl, jedoch ist eine Umstellung mit sehr viel Arbeit verbunden. +Die Diskussion einer Umstellung auf „Du” hängt daher in erster Linie an +der Frage, ob sich eine hinreichend große Menge an Freiwilligen finden, +um die *gesamte* Anleitung umzustellen. Bis dahin sollte aus +praktischen Gründen die Übersetzung beim formelleren „Sie” bleiben. + +> :arrow_forward: You can also use the search function in the top-left corner. +> +> :x: Du kannst auch die Suchfunktion in der oberen linken Ecke verwenden. +> +> :heavy_check_mark: Sie können auch die Suchfunktion in der oberen linken Ecke verwenden. + +### Grammatikalische Prinzipien + +Die Godot-Übersetzung lässt sich in vier grobe Blöcke einteilen: *Editor*, +*Properties*, *Anleitung* und *Klassenreferenz*. + +Jeder dieser Blöcke hat eigene Ansprüche +an eine Übersetzung. Während die Anleitung in erster Linie auf Verständlichkeit +ausgelegt ist und sich angenehm lesen soll, ist im Editor und den Properties +häufig eine etwas knappere Sprache erforderlich, weil oft nur begrenzt +Platz für die Texte zur Verfügung steht. + +Es ist daher sinnvoll, einige Grundregeln für die Übersetzung +aufzustellen. Beachte, dass diese Regeln nicht absolut sind und im Zweifel +mit Augenmaß übersetzt werden sollte. Trotzdem helfen solche Regeln, +einen einheitlichen Sprachstil über die gesamte Dokumentation hinweg zu fördern. + +Folgende Grundregeln werden aktuell in der Übersetzung angewendet: + +#### Anleitung/Klassenreferenz + +In der *Anleitung* sollte die grammatikalische Form des Originaltexts beibehalten +werden, es sei denn, die Lesbarkeit leidet darunter. Es sollte generell darauf +verzichtet werden, an dieser Stelle bestimmte Sprachkonstrukte grundsätzlich +zu vermeiden oder zu bevorzugen. Oft ist eine Anlehnung an den Originaltext +die bessere Wahl. Insbesondere die direkte Ansprache mit +„Sie” ist in diesem Teil der Dokumentation weit verbreitet und sollte +so beibehalten werden. + +Beispiele: + +> :arrow_forward: The table of contents in the sidebar should let you easily +> access the documentation for your topic of interest. +> +> :heavy_check_mark: Mithilfe des Inhaltsverzeichnisses in der Seitenleiste +> können Sie leicht auf die Dokumentation zu Ihrem gewünschten Thema zugreifen. + +
+ +> :arrow_forward: To move our icon, we need to update its position and rotation +> every frame in the game loop. +> +> :heavy_check_mark: Um unser Icon zu bewegen, müssen wir seine Position und +> Drehung in jedem Frame der Spielschleife aktualisieren. + +
+ +> :arrow_forward: This build can be manually triggered by clicking the "Build" +> button at the top right of the editor. +> +> :heavy_check_mark: Dieser Build kann manuell ausgelöst werden, indem man auf den +> „Build”-Button oben rechts im Editor klickt. + + +Bei manchen Abschnitten der Anleitung, wie bestimmten Überschriften oder Aufzählungen, +bietet sich der [Infinitiv-Imperativ](https://de.wikipedia.org/wiki/Imperativ_(Modus)#Infinitiv) an: + +Beispiele: + +> :arrow_forward: Setting up the project +> +> :heavy_check_mark: Das Projekt einrichten + +
+ +> :arrow_forward: For the player, we need to do the following: +> * Check for input. +> * Move in the given direction. +> * Play the appropriate animation. +> +> :heavy_check_mark: Für den Spieler müssen wir Folgendes tun: +> * Auf Eingaben prüfen. +> * Sich in die angegebene Richtung bewegen. +> * Die entsprechende Animation abspielen. + +#### Properties + +Die *Properties* sind sehr knapp beschriebene Eigenschaften von Godot-Features, +die im Editor oft nur wenig Platz zur Verfügung haben. Hier handelt es sich häufig +um einzelne Begriffe, bei denen die Schwierigkeit eher im Finden der korrekten +Vokabel besteht (dazu mehr unten), als in der grammatikalischen Form. + +Manchmal sind es jedoch kurze Sätze, die in den meisten Fällen am besten +im Infinitiv-Imperativ (siehe Beispiele oben) zu übersetzen sind, da diese Form +hier sprachlich gut passt und wenig Platz einnimmt. Auch sollten hier, wo möglich, +Artikel weggelassen werden, genauso wie es im Original meist schon gemacht wird. + + +> :arrow_forward: Keep Screen On +> +> :x: Der Bildschirm wird eingeschaltet gelassen +> +> :heavy_check_mark: Bildschirm eingeschaltet lassen + +#### Editor + +Die Texte des *Editors* bestehen sowohl aus kleinen Textblöcken, wenn z.B. ein Tooltip +eine Einstellung näher beschreibt, als auch aus kurzen Begriffen, die oft wenig +Platz zur Verfügung haben. + +Bei der Übersetzung des Editors gelten somit sowohl die Regeln für die Anleitung, als auch +die für die Properties, je nachdem, ob der zu übersetzende Text eher in Langform +oder in Kurzform geschrieben ist. + +### Keine Angst vor englischen Begriffen + +Manche Begriffe lassen sich nur schwer ins Deutsche übersetzen. Das sind zum +Beispiel technische Begriffe, die bereits in ihrer englischen +Form in den Sprachgebrauch Einzug gefunden haben (*Thread*, *Debuggen*, +*Spawn-Punkt*). + +Andere Begriffe haben gängige deutsche Übersetzungen, wie z.B. *Knoten* für *node*. +Da es in der Godot-Welt aber Objekte gibt, die feststehende Namen haben, +etwa `Node2D`, wollen wir davon abgeleitete Vokabeln ebenfalls englisch lassen. + +> :arrow_forward: This feature is only available when connecting nodes in the editor. +> +> :x: Dieses Feature ist nur verfügbar, wenn Knoten im Editor verbunden werden. +> +> :heavy_check_mark: Dieses Feature ist nur verfügbar, wenn Nodes im Editor verbunden werden. + +Du wirst beim Lesen der Anleitung viele dieser absichtlich eingedeutschten +Begriffe finden. Dies mag an der einen oder anderen Stelle etwas ungewohnt wirken, +aber es gibt viele Situationen, in denen damit Übersetzungsprobleme vermieden werden können. + +Sollte es vorkommen, dass eine Regel unsinnig erscheint, sollte das im +[Chat](https://chat.godotengine.org/channel/translation-de) diskutiert werden. Um einen Überblick über die dokumentierten Begriffe +zu bekommen, die englisch bleiben sollen, lohnt sich ein +Blick ins [Glossar](https://hosted.weblate.org/browse/godot-engine/glossary/de/). +Sollte ein Begriff dort nicht hinterlegt sein, kann man die Suchfunktion +von Weblate verwenden, um Beispiele in den vorhandenen Übersetzungen zu finden. + +Manchmal ist es auch notwendig, nach eigenem Empfinden eine Entscheidung zu +treffen oder von einer der Glossar-Regeln abzuweichen. +Das ist vollkommen okay, denn Sprache ist komplex, und man kann nicht für +jeden Sonderfall eine vordefinierte Lösung festlegen. + +Beispiel 1: + +> :arrow_forward: Stereo Panning +> +> :x: Stereoverschiebung +> +> :heavy_check_mark: Stereo-Panning + +Beispiel 2: + +> :arrow_forward: Drag to pan the view +> +> :x: Ziehen, um den View zu pannen. +> +> :heavy_check_mark: Ziehen um den View zu verschieben + + +Das erste Beispiel stammt aus dem Audio-Bereich, wo Stereo-Panning ein gängiger +Begriff ist. Das zweite Beispiel verwendet das Wort „panning” als +allgemeine Vokabel. Hier ist kein besonderer technischer Jargon +gemeint, somit kann das Wort auch normal auf Deutsch übersetzt werden. + +Diese Unterscheidung wird im Glossar oft mit zwei Einträge desselben Wortes +abgebildet. Dabei soll ein Beschreibungstext dabei helfen, zu erklären, +in welchem Kontext welche Übersetzung passend ist. + +Weiter unten findest Du Recherchetipps, die dabei helfen können, +eine passende Übersetzung zu finden, sollte ein Begriff weder im Glossar +noch in der bestehenden Dokumentation auffindbar sein. + +### Kompositionswörter + +Das im Deutschen übliche Aneinanderreihen von Wörtern (Komposition) wird +im Englischen durch das Hintereinandersetzen von Wörtern mit +Leerzeichen erreicht. Bei sehr langen Wortfolgen ergeben sich dabei +logische Untergruppen aus dem Zusammenhang, auch wenn das in Extremfällen +manchmal wenig intuitiv erscheint: + +> Default Font Multichannel Signed Distance Field + +Im Deutschen sollte dagegen vermieden werden, lange Kompositionen zu bilden, +da die Lesbarkeit extrem leidet, wenn die Wörter sehr lang werden. Eine +einfache Lösung ist hier, mithilfe von Bindestrichen Klarheit zu schaffen. +Allerdings ist es im Allgemeinen besser, die grammatikalische Struktur des +Begriffs +aufzubrechen und ihn klar zu beschreiben. Dabei ist es notwendig, +nachzulesen, was dieser Begriff im Kontext von Godot eigentlich genau bedeutet: + +> :arrow_forward: Medium Quality Probe Ray Count +> +> :x: Mittelqualitätsprobestrahlenanzahl +> +> :heavy_check_mark: Strahlenzahl für Probes bei mittlerer Qualität + +Es sollte bei der Übersetzung generell vermieden werden, überlange Komposita zu +erzeugen. Als Richtschnur sollten mehr als zwei Wörter nur in Ausnahmefällen zu +Komposita verbunden werden, mehr als drei Wörter hingegen am besten gar nicht. +Sollte sich keine brauchbare Übersetzung eines Kompositums finden, dann +sollten zumindest Bindestriche eingesetzt werden, um die Teilbegriffe klarer +voneinander zu trennen. + +Beispiele: + +> :arrow_forward: Interaction Profile Path +> +> :x: Interaktionsprofilpfad +> +> :heavy_check_mark: Interaktionsprofil-Pfad +> +> :heavy_check_mark: Pfad zum Interaktionsprofil + +
+ +> :arrow_forward: Render Target Size Multiplier +> +> :x: Renderzielgrößenfaktor +> +> :heavy_check_mark: Render-Zielgrößen-Faktor +> +> :heavy_check_mark: Faktor für Render-Zielgröße + +### Schachtelsätze und „die die”-Wiederholungen + +Beim direkten Übersetzen eines englischen Satzes kommt man leicht in +Versuchung, Schachtelsätze oder allgemein sehr lange Sätze zu bilden. Auch hier +ist eine KI-Vorübersetzung von Nutzen, die dies oft recht gut vermeidet. +Im Allgemeinen ist es allerdings einfach so, dass deutsche Wörter und Sätze im Mittel länger +als ihre englischen Pendants sind. Daher sollte darauf geachtet werden, +die deutsche Übersetzung nicht zu komplex oder zu lang werden zu lassen. Es +kann durchaus guter Stil sein, einen Satz in zwei Sätze aufzuteilen, auch wenn +dabei die grammatikalische Form des Originals nicht erhalten bleibt. + +Ein weiterer verwandter Aspekt ist hier die Verwendung der Wortwiederholung +„die die”, die ebenfalls vermieden werden sollte. Eine Ersetzung durch „welche +die” scheint oft naheliegend, klingt aber umständlich und ist keine gute Lösung. +Stattdessen ist eine Umformulierung des Satzes oft die bessere Wahl. + +Beispiele: + +> :arrow_forward: Min SDK cannot be lower than %d, which is the version +> needed by the Godot library. +> +> :x: Min SDK kann nicht niedriger als %d sein, der Version, die die +> Godot-Bibliothek benötigt. +> +> :heavy_check_mark: Min SDK kann nicht niedriger als %d sein (die +> Version, die von der Godot-Bibliothek benötigt wird). + +
+ +> :arrow_forward: In addition, one will need a primary GUI for their game that +> manages the various menus and widgets the project needs. +> +> :x: Außerdem benötigt man für sein Spiel eine primäre GUI, die die +> verschiedenen Menüs und Widgets verwaltet, die das Projekt benötigt. +> +> :heavy_check_mark: Außerdem benötigt man für sein Spiel eine primäre GUI, +> um die verschiedenen Menüs und Widgets des Projekts zu verwalten. +> +> :heavy_check_mark: Außerdem benötigt man für sein Spiel eine primäre GUI. +> Diese GUI verwaltet die verschiedenen Menüs und Widgets des Projekts. + +### Eigene Ergänzungen + +Achte bei der Übersetzung der Anleitung darauf, nur den Originaltext zu +übersetzen, ohne eigene Ergänzungen oder Erläuterungen vorzunehmen. Sollte +der Originaltext unvollständig oder erklärungswürdig sein, so beantrage zuerst +eine Änderung am Original oder stelle selbst einen Pull-Request in +[godot-docs](https://github.com/godotengine/godot-docs). +Wir sollten uns auf Weblate ausschließlich als Übersetzer und nicht als +Autoren verstehen. + +> :arrow_forward:: Computes the arctan of x +> +> :x: Berechnet den Arcustangens von x. Der Arcustangens ist die Umkehrfunktion +> des Tangens. +> +> :heavy_check_mark: Berechnet den Arcustangens von x + +## Konsistenz zwischen Editor/Properties und Anleitung + +Wenn Du einen Begriff aus dem Editor oder den Properties änderst, solltest Du +die Weblate-Seite der Anleitung nach diesen Begriffen durchsuchen und sie +entsprechend anpassen, damit die Übersetzungen konsistent bleiben. + +Beachte auch, dass ein Editor/Properties-Begriff meist an mehreren Stellen im Editor +oder den Properties vorkommt, sodass nach Möglichkeit alle dieser Stellen +mit übersetzt werden sollten. + +## Testen der Übersetzung + +Für Übersetzungen des Editors und der Properties ist es ratsam, diese +auch selbst zu testen, indem +man [die aktuelle Übersetzung herunterlädt](https://docs.godotengine.org/de/4.x/contributing/documentation/editor_and_docs_localization.html#offline-translation-and-testing) +und Godot mit den Änderungen [selbst kompiliert](https://docs.godotengine.org/de/4.x/contributing/development/compiling/compiling_for_windows.html). + +Gerade bei der Anleitung kommt es oft auf den Kontext zwischen benachbarten +Textblöcken an, sodass das Lesen eines ganzen Artikels Fehler sichtbar +macht, die in Weblate leicht überlesen werden können. + +## Recherchetipps + +Grundsätzlich sollte man sich bei +der Übersetzung eines Begriffs gut überlegen, ob man eine korrekte +Übersetzung aus der eigenen Spracherfahrung vornehmen kann, oder besser erst +einmal etwas näher recherchieren sollte. + +Die erste Quelle bei der Übersetzung feststehender Begriffe +sollte das Glossar und die bestehenden Übersetzungen sein. +Die Suchfunktion von Weblate leistet hier gute Dienste. + +Wenn ein Begriff in diesen Quellen nicht gefunden werden kann oder Zweifel an +ihrer Korrektheit bestehen, gibt es einige weitere hilfreiche Quellen: + +Grundbegriffe aus der +Wissenschaft kann man auf der englischen [Wikipedia](https://www.wikipedia.org) +nachschlagen. +Von dort aus lässt sich über das Sprachmenü der deutsche +Schwesterartikel aufrufen, wo man oft eine korrekte deutsche Übersetzung des +Begriffs findet. Achte allerdings darauf, ob der deutsche Artikel auch +dieselbe Bedeutung des Wortes beschreibt, wie der englische Artikel. + +Bei weiteren allgemeinen technischen Begriffen kann +man auf Webseiten wie www.linguee.com zurückgreifen, um zu schauen, wie +ein Begriff von anderen, oft professionellen, Übersetzern in unterschiedlichen +Kontexten bereits übersetzt wurde. + +Zuletzt gibt es Fachbegriffe, die direkt aus dem Gaming oder Game-Design +stammen, und es ist sicherlich nicht verkehrt, bei der Übersetzung einmal +nachzuschauen, wie andere Tools aus dem Bereich diese Begriffe übersetzen +(Unity, Unreal). Da diese Tools über das Budget für professionelle +Übersetzer verfügen, ist dies eine besonders hilfreiche Quelle für sehr +spezifische Fachbegriffe. + +Zuletzt kann es sinnvoll sein, sich an erfahrene Entwickler zu wenden, um +die Übersetzung eines Begriffs zu klären, entweder im [Chat](https://chat.godotengine.org/channel/translation-de) oder im +[deutschen Godot-Discord](https://discord.com/channels/553242711109533729/) + + +## Glossar-Regeln + +Dieser Abschnitt befasst sich mit dem Glossar. Wenn Du einfach nur übersetzen +möchtest, kannst Du hier aufhören zu lesen. Falls Du aber Glossar-Einträge pflegen +möchtest, solltest Du weiterlesen. + +Das Weblate-Glossar folgt bestimmten eigenen Regeln, die beachtet werden +sollten: + +### Was kommt überhaupt ins Glossar? + +Das Glossar hat seinen praktischen Nutzen dort, wo man ein Wort an +verschiedenen Stellen gleich übersetzen möchte. Immer, wenn das +gewährleistet werden soll, lohnt sich auch ein Glossar-Eintrag. Beachte +allerdings auch, dass ein sehr großes Glossar Pflegeaufwand bedeutet. Nicht +jedes Wort muss also unbedingt einen Eintrag bekommen. + +> :x: color -> Farbe + +Das Wort „color” ist ziemlich eindeutig und bedarf vermutlich keiner +expliziten Klärung in einem Glossar. + +> :heavy_check_mark: ctrl -> Strg + +Hier haben wir einen Fachbegriff, der über ein eindeutiges +deutsches Äquivalent verfügt. Dafür kann man durch eine „Forbidden +Translation” (s.u.) darauf hinweisen, dass eine Übersetzung als das +vielleicht naheliegende „Ctrl” nicht zulässig ist. + + +> :heavy_check_mark: aligned -> bündig/ausgerichet + +In diesem Fall kann das Glossar dabei helfen, die verschiedenen +Übersetzungen des Wortes „aligned” zu definieren, das in der Form +*left-aligned* als *linksbündig* und in der Form *axis-aligned* als *an den +Achsen ausgerichtet* übersetzt werden sollte. + +> :heavy_check_mark: blitting -> Blitting + +Hier verweist das Glossar darauf, dass ein Begriff ein +feststehender Fachbegriff ist, der im keine gute deutsche Entsprechung +hat und daher englisch bleibt. + +### Ein Wort, ein Eintrag + +Da Weblate seine Glossar-Einträge bei der Übersetzung automatisch anbietet, +sobald im Originaltext ein bestimmter Begriff vorkommt, sollte +sichergestellt werden, dass Einträge auch gefunden werden. Das kann nur +gelingen, wenn ein Eintrag in der englischen Form genau so auch in einem +Text vorkommen kann. + +> :x: float, floats -> float +> +> :heavy_check_mark: float -> float + +Im vorigen Beispiel könnte Weblate für einen Text, der den *Float*-Datentyp +erklärt, den Glossareintrag nicht finden, da der Begriff *float, floats* so +im Originaltext nicht vorkommt. + +### Ein Wort, mehrere Bedeutungen + +Sollte ein englisches Wort auf mehrere Arten übersetzt werden können, dann +sollte für jede Übersetzung ein eigener Glossar-Eintrag angelegt werden. +Dies hilft bei der Lesbarkeit und macht es später leichter, weitere Bedeutungen +hinzuzufügen. + +> :x: volume -> Volumen, Lautstärke +> +> :heavy_check_mark: volume -> Volumen (*Translation Explanation:* im Sinne von „Rauminhalt”) +> +> :heavy_check_mark: volume -> Lautstärke (*Translation Explanation:* im Audio-Kontext) + +Es bietet sich an, über das jeweilige „Translation Explanation”-Feld +zu beschreiben, wie sich +die verschiedenen Übersetzungen unterscheiden und in welchen Fällen man sie +verwenden sollte. + +**Achtung:** Es gibt auch das Feld +„Explanation”, das für die Erklärung des Originaltextes gedacht +ist. Dieses Feld sollte nicht verwendet werden, da es in der Seitenleiste +zu unschönen Doppeleinträgen führen kann. + +### Grundformen verwenden + +Ein englisches Wort sollte grundsätzlich in seiner einfachsten Form ins +Glossar eingetragen werden, damit es in möglichst vielen Fällen automatisch +zugeordnet werden kann. Das bedeutet bei Verben die Grundform (**wichtig:** ohne *to*) +und bei Substantiven der Singular. + +Beispiele: + +> :x: to hide -> verbergen +> +> :heavy_check_mark: hide -> verbergen + +
+ +> :x: constants -> Konstanten +> +> :heavy_check_mark: constant -> Konstante + +Leider unterstützt die aktuelle Version von Weblate keine +morphologischen Varianten. Wenn also ein Wort im Glossar als Singular angegeben wird, dann +wird es beim Übersetzen nur angeboten, wenn auch im Übersetzungstext der Singular +verwendet wird. Es gibt bereits ein [Ticket](https://github.com/WeblateOrg/weblate/issues/3023) +dazu im Weblate-Github. Bis zur Lösung dieses Problems sollten wir vermeiden, +als Workaround Singular *und* Plural-Einträge im Glossar zu erzeugen, da das +schlecht zu warten ist. + +### Terminology + +Ein als „Terminology” markierter Eintrag wird automatisch in allen +anderen Sprachen in die Glossare eingetragen und führt dort zu offenen +Arbeitspaketen. + +Das kann dazu führen, dass neue Glossareinträge in der deutschen +Übersetzung erscheinen, weil eine andere Sprache sie eingefügt hat. In diesem +Fall ist es legitim, das Terminology-Flag zu entfernen und den Eintrag zu löschen, +wenn er aus unserer Sicht nicht sinnvoll ist. Dieser Vorgang lässt den Eintrag +in allen anderen Sprachen unverändert. + +Wir sollten das Terminology-Flag grundsätzlich nicht setzen, da es potentiell +die Glossare anderer Sprachen zumüllt, insbesondere, wenn diese andere Definitionen +davon haben, welche Art von Begriffen als „Terminologie” zu bewerten sind. + + +### Untranslatable + +Ein als „Untranslatable” markierter Eintrag ist ein Begriff, der bewusst nicht +übersetzt werden soll, z.B. feststehende Begriffe wie `Android` oder `OpenGL`. +Allerdings haben viele dieser Begriffe eigentlich nichts im Glossar verloren, +sodass dieses Flag nicht allzu häufig vorkommen sollte. +Man kann einen als „Untranslatable” markierten Begriff daran +erkennen, dass er bei der Glossar-Einblendung in der Seitenleiste gelb hinterlegt ist. + +### Forbidden Translation + +Ein als „Forbidden Translation” markierter Eintrag kann dazu verwendet +werden, um eine Übersetzung aufzuzeigen, die nicht verwendet werden soll, zum +Beispiel weil sie einen fehleranfälligen +[Falschen Freund](https://de.wikipedia.org/wiki/Falscher_Freund) darstellt +oder um bestimmte deutsche Begriffe zu sperren. Zum Beispiel könnte man sich +darauf einigen, den Begriff *enemy* durchgängig als *Gegner* und nicht als das +extremere *Feind* zu übersetzen. In dem Fall würden beide Begriffe ins Glossar +eingetragen, wobei der zweite als „Forbidden Translation” markiert wird. + +## Änderungen an diesem Dokument + +Änderungen an diesem Dokument sollten im [Chat](https://chat.godotengine.org/channel/translation-de) diskutiert und nach +Klärung per Pull-Request ins Github-Repo committet werden. diff --git a/_templates/layout.html b/_templates/layout.html index 268c4ca381a..2afebc33468 100644 --- a/_templates/layout.html +++ b/_templates/layout.html @@ -6,12 +6,13 @@ {% endblock -%} {% block extrahead -%} - - + + + {% endblock -%} {% 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 -#} @@ -66,7 +67,17 @@ {% endif %} {% block body %}{% endblock %} + +{% if (not meta or meta.get('allow_comments') != 'False') and godot_show_article_comments %} +
+
+

User-contributed notes

+

+ Please read the User-contributed notes policy before submitting a comment. +

+{% endif %} + {%- if self.comments()|trim %}
{%- block comments %}{% endblock %} diff --git a/_tools/redirects/redirects.csv b/_tools/redirects/redirects.csv index f85a7179eba..a003118c3b0 100644 --- a/_tools/redirects/redirects.csv +++ b/_tools/redirects/redirects.csv @@ -1,5 +1,6 @@ source,destination /about/index.html,/index.html +/about/troubleshooting.html,/tutorials/troubleshooting.html /classes/_classes.html,/classes/ /community/contributing/best_practices_for_engine_contributors.html,/contributing/development/best_practices_for_engine_contributors.html /community/contributing/bisecting_regressions.html,/contributing/workflow/bisecting_regressions.html @@ -419,3 +420,5 @@ source,destination /tutorials/viewports/multiple_resolutions.html,/tutorials/rendering/multiple_resolutions.html /tutorials/viewports/using_viewport_as_texture.html,/tutorials/shaders/using_viewport_as_texture.html /tutorials/viewports/viewports.html,/tutorials/rendering/viewports.html +/contributing/development/compiling/compiling_for_uwp.html,/about/faq.html#which-platforms-are-supported-by-godot +/tutorials/export/exporting_for_uwp.html,/about/faq.html#which-platforms-are-supported-by-godot diff --git a/about/complying_with_licenses.rst b/about/complying_with_licenses.rst index 0a013277f66..a3a51350ef8 100644 --- a/about/complying_with_licenses.rst +++ b/about/complying_with_licenses.rst @@ -1,14 +1,21 @@ +:allow_comments: False + .. _doc_complying_with_licenses: Complying with licenses ======================= +.. warning:: + + The recommendations in this page **are not legal advice.** They are provided + in good faith to help users navigate license attribution requirements. + 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 +It doesn't have a sole owner, as every contributor that submits code to +the project does it under this same license and keeps ownership of their contribution. The license is the legal requirement for you (or your company) to use and @@ -22,13 +29,12 @@ with the original one. If you are interested in licence compliance as a contributor, you can find guidelines :ref:`here `. -.. warning:: +.. tip:: - In your project's credits screen, remember to also list third-party notices + Alongside the Godot license text, remember to also list third-party notices for assets you're using, such as textures, models, sounds, music and fonts. - - Free assets in particular often come with licenses that require attribution. - Double-check their license before using those assets in a project. + This includes free assets, which often come with licenses that require + attribution. Requirements ------------ @@ -36,18 +42,33 @@ 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 text reads as follows:: This game uses Godot Engine, available under the following license: Copyright (c) 2014-present Godot Engine contributors. Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. - 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: + 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 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. - 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. +Beside its own MIT license, Godot includes code from a number of third-party +libraries. See :ref:`doc_complying_with_licenses_thirdparty` for details. .. note:: @@ -58,31 +79,9 @@ This text reads as follows: 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). - -.. tip:: - - Godot provides several methods to get license information in the Engine - singleton. This allows you to source the license information directly from - the engine binary, which prevents the information from becoming outdated if - you update engine versions. - - For the engine itself: - - - :ref:`Engine.get_license_text` - - For third-party components used by the engine: - - - :ref:`Engine.get_license_info` - - :ref:`Engine.get_copyright_info` - - For miscellaneous engine contributor information. You don't have to include - these ones in your project, but they're listed here for reference: - - - :ref:`Engine.get_author_info` - - :ref:`Engine.get_donor_info` +The license text must be made available to the user. The license doesn't specify +how the text has to be included, but here are the most common approaches (you +only need to implement one of them, not all). Credits screen ^^^^^^^^^^^^^^ @@ -101,20 +100,20 @@ or **Open Source Licenses**. Output log ^^^^^^^^^^ -Printing the licensing text using the :ref:`print() ` +Printing the license 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). +This is the case on desktop platforms, Android and HTML5 (but not iOS). 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. +text 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. +If the game includes a printed manual, the license text can be included there. Link to the license ^^^^^^^^^^^^^^^^^^^ @@ -123,71 +122,40 @@ 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:: - - 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 +.. tip:: - 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: + Godot provides several methods to get license information in the + :ref:`Engine ` singleton. This allows you to source the + license information directly from the engine binary, which prevents the + information from becoming outdated if you update engine versions. - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + For the engine itself: - 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. + - :ref:`Engine.get_license_text` -mbed TLS -^^^^^^^^ + For third-party components used by the engine: -If the project is exported with Godot 3.1 or later, it includes `mbed TLS `_. -The Apache license needs to be complied to by including the following text: + - :ref:`Engine.get_license_info` + - :ref:`Engine.get_copyright_info` - Copyright The Mbed TLS Contributors +.. _doc_complying_with_licenses_thirdparty: - 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 +Third-party licenses +-------------------- - http://www.apache.org/licenses/LICENSE-2.0 +Godot itself contains software written by +`third parties `_, +which is compatible with, but not covered by Godot's MIT license. - 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. +Many of these dependencies are distributed under permissive open source licenses +which require attribution by explicitly citing their copyright statement and +license text in the final product's documentation. -.. note:: +Given the scope of the Godot project, this is fairly difficult to do thoroughly. +For the Godot editor, the full documentation of third-party copyrights and +licenses is provided in the `COPYRIGHT.txt `_ +file. - If you exported your project using a - :ref:`custom build with specific modules disabled `, - you don't need to list the disabled modules' licenses in your exported project. +A good option for end users to document third-party licenses is to include this +file in your project's distribution, which you can e.g. rename to +``GODOT_COPYRIGHT.txt`` to prevent any confusion with your own code and assets. diff --git a/about/docs_changelog.rst b/about/docs_changelog.rst index 65bc1c44652..6c432a56ab4 100644 --- a/about/docs_changelog.rst +++ b/about/docs_changelog.rst @@ -1,3 +1,5 @@ +:allow_comments: False + .. _doc_docs_changelog: Documentation changelog @@ -11,6 +13,34 @@ added since version 3.0. .. note:: This document only contains new pages so not all changes are reflected, many pages have been substantially updated but are not reflected in this document. +New pages since version 4.1 +--------------------------- + +C# +^^ + +- :ref:`doc_c_sharp_diagnostics` + +Development +^^^^^^^^^^^ + +- :ref:`doc_2d_coordinate_systems` + +Migrating +^^^^^^^^^ + +- :ref:`doc_upgrading_to_godot_4.2` + +I/O +^^^ + +- :ref:`doc_runtime_loading_and_saving` + +Platform-specific +^^^^^^^^^^^^^^^^^ + +- :ref:`doc_android_library` + New pages since version 4.0 --------------------------- diff --git a/about/faq.rst b/about/faq.rst index ee5dd1a060a..58da3c68f40 100644 --- a/about/faq.rst +++ b/about/faq.rst @@ -1,3 +1,5 @@ +:allow_comments: False + .. meta:: :keywords: FAQ @@ -47,7 +49,7 @@ Which platforms are supported by Godot? **For exporting your games:** -* Windows (and UWP) +* Windows * macOS * Linux, \*BSD * Android @@ -68,6 +70,13 @@ about :ref:`doc_consoles`. For more on this, see the sections on :ref:`exporting ` and :ref:`compiling Godot yourself `. +.. note:: + + Godot 3 also had support for Universal Windows Platform (UWP). This platform + port was removed in Godot 4 due to lack of maintenance, and it being + deprecated by Microsoft. It is still available in the current stable release + of Godot 3 for interested users. + Which programming languages are supported in Godot? --------------------------------------------------- @@ -509,7 +518,7 @@ reasons why we have chosen SCons over other alternatives. For example: customization (:ref:`modules `). 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 +- Godot's 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. diff --git a/about/introduction.rst b/about/introduction.rst index 5ef95b44a50..c3314f475bf 100644 --- a/about/introduction.rst +++ b/about/introduction.rst @@ -1,3 +1,5 @@ +:allow_comments: False + .. _doc_about_intro: Introduction @@ -28,7 +30,7 @@ is a great starting point. 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 and -`Q&A `_. +`Forum `_. About Godot Engine ------------------ diff --git a/about/list_of_features.rst b/about/list_of_features.rst index 17c8bf2d772..82f9a8edd57 100644 --- a/about/list_of_features.rst +++ b/about/list_of_features.rst @@ -1,3 +1,5 @@ +:allow_comments: False + .. _doc_list_of_features: List of features @@ -14,24 +16,30 @@ This page aims to list **all** features currently supported by Godot. Platforms --------- +.. seealso:: + + See :ref:`doc_system_requirements` for hardware and software version requirements. + **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, x86 and ARM). +- Windows (x86, 64-bit and 32-bit). +- macOS (x86 and ARM, 64-bit only). +- Linux (x86 and ARM, 64-bit and 32-bit). - 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. - - 32-bit binaries can be compiled from source. + - Official binaries are compiled using the + `Godot Engine buildroot `__, + allowing for binaries that work across common Linux distributions + (including LTS variants). -- Android 6.0 and later (editor support is experimental). +- Android (editor support is experimental). - :ref:`Web browsers `. Experimental in 4.0, using Godot 3.x is recommended instead when targeting HTML5. **Runs exported projects:** -- iOS 11.0 and later. +- iOS. - :ref:`Consoles `. Godot aims to be as platform-independent as possible and can be @@ -55,7 +63,7 @@ Editor Visual Studio Code or Vim. - GDScript :ref:`debugger `. - - No support for debugging in threads yet. + - Support for debugging in threads is available since 4.2. - Visual profiler with CPU and GPU time indications for each step of the rendering pipeline. - Performance monitoring tools, including @@ -362,6 +370,8 @@ Rendering **Anti-aliasing:** - Temporal :ref:`antialiasing ` (TAA). +- AMD FidelityFX Super Resolution 2.2 :ref:`antialiasing ` (FSR2), + which can be used at native resolution as a form of high-quality temporal antialiasing. - Multi-sample antialiasing (MSAA), for both :ref:`doc_2d_antialiasing` and :ref:`doc_3d_antialiasing`. - Fast approximate antialiasing (FXAA). - Super-sample antialiasing (SSAA) using bilinear 3D scaling and a 3D resolution scale above 1.0. @@ -372,8 +382,8 @@ Rendering - Support for :ref:`rendering 3D at a lower resolution ` while keeping 2D rendering at the original scale. This can be used to improve performance on low-end systems or improve visuals on high-end systems. -- Resolution scaling uses bilinear filtering or AMD FidelityFX Super Resolution - 1.0 (FSR). +- Resolution scaling uses bilinear filtering, AMD FidelityFX Super Resolution + 1.0 (FSR1) or AMD FidelityFX Super Resolution 2.2 (FSR2). - Texture mipmap LOD bias is adjusted automatically to improve quality at lower resolution scales. It can also be modified with a manual offset. @@ -639,10 +649,14 @@ XR support (AR and VR) - Out of the box :ref:`support for OpenXR `. - - Including support for popular headsets like the Meta Quest and the Valve Index. + - Including support for popular desktop headsets like the Valve Index, WMR headsets, and Quest over Link. + +- Support for :ref:`Android based headsets ` using OpenXR through a plugin. + + - Including support for popular stand alone headsets like the Meta Quest 1/2/3 and Pro, Pico 4, Magic Leap 2, and Lynx R1. -- Support for ARKit on iOS out of the box. -- Support for the OpenVR APIs. +- Other devices supported through an XR plugin structure. +- Various advanced toolkits are available that implement common features required by XR applications. GUI system ---------- diff --git a/about/release_policy.rst b/about/release_policy.rst index ee0ae7f4a61..777381eb922 100644 --- a/about/release_policy.rst +++ b/about/release_policy.rst @@ -1,3 +1,5 @@ +:allow_comments: False + .. _doc_release_policy: Godot release policy @@ -80,26 +82,26 @@ on GitHub. +--------------+----------------------+--------------------------------------------------------------------------+ | **Version** | **Release date** | **Support level** | +--------------+----------------------+--------------------------------------------------------------------------+ -| Godot 4.2 | November 2023 | |unstable| *Development.* Receives new features, usability and | +| Godot 4.3 | April 2024 | |unstable| *Development.* Receives new features, usability and | | (`master`) | (estimate) | performance improvements, as well as bug fixes, while under development. | +--------------+----------------------+--------------------------------------------------------------------------+ -| Godot 4.1 | July 2023 | |supported| Receives fixes for bugs and security issues, as well as | +| Godot 4.2 | November 2023 | |supported| Receives fixes for bugs and security issues, as well as | | | | patches that enable platform support. | +--------------+----------------------+--------------------------------------------------------------------------+ -| Godot 4.0 | March 2023 | |supported| Receives fixes for bugs and security issues, as well as | +| Godot 4.1 | July 2023 | |supported| Receives fixes for bugs and security issues, as well as | | | | patches that enable platform support. | +--------------+----------------------+--------------------------------------------------------------------------+ -| Godot 3.6 | Q3 2023 (estimate) | |supported| *Beta.* Receives new features, usability and performance | +| Godot 4.0 | March 2023 | |eol| No longer supported (last update: 4.0.4). | ++--------------+----------------------+--------------------------------------------------------------------------+ +| Godot 3.6 | Q1 2024 (estimate) | |supported| *Beta.* Receives new features, usability and performance | | (`3.x`, LTS) | | improvements, as well as bug fixes, while under development. | +--------------+----------------------+--------------------------------------------------------------------------+ | Godot 3.5 | August 2022 | |supported| Receives fixes for bugs and security issues, as well as | | | | patches that enable platform support. | +--------------+----------------------+--------------------------------------------------------------------------+ -| Godot 3.4 | November 2021 | |eol| No longer supported, as fully superseded by the compatible 3.5 | -| | | release (last update: 3.4.5). | +| Godot 3.4 | November 2021 | |eol| No longer supported (last update: 3.4.5). | +--------------+----------------------+--------------------------------------------------------------------------+ -| Godot 3.3 | April 2021 | |eol| No longer supported, as fully superseded by the compatible 3.4 | -| | | release (last update: 3.3.4). | +| Godot 3.3 | April 2021 | |eol| No longer supported (last update: 3.3.4). | +--------------+----------------------+--------------------------------------------------------------------------+ | Godot 3.2 | January 2020 | |eol| No longer supported (last update: 3.2.3). | +--------------+----------------------+--------------------------------------------------------------------------+ diff --git a/about/system_requirements.rst b/about/system_requirements.rst new file mode 100644 index 00000000000..f90134f6e42 --- /dev/null +++ b/about/system_requirements.rst @@ -0,0 +1,371 @@ +:allow_comments: False + +.. _doc_system_requirements: + +System requirements +=================== + +This page contains system requirements for the editor and exported projects. +These specifications are given for informative purposes only, but they can be +referred to if you're looking to build or upgrade a system to use Godot on. + +Godot editor +------------ + +These are the **minimum** specifications required to run the Godot editor and work +on a simple 2D or 3D project: + +Desktop or laptop PC - Minimum +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. When adjusting specifications, make sure to only mention hardware that can run the required OS version. +.. For example, the x86 CPU requirement for macOS is set after the MacBook Air 11" (late 2010 model), +.. which can run up to macOS 10.13. + ++----------------------+-----------------------------------------------------------------------------------------+ +| **CPU** | - **Windows:** x86_32 CPU with SSE2 instructions, or any x86_64 CPU | +| | | +| | - *Example: Intel Core 2 Duo E8200, AMD Athlon XE BE-2300* | +| | | +| | - **macOS:** x86_64 or ARM CPU (Apple Silicon) | +| | | +| | - *Example: Intel Core 2 Duo SU9400, Apple M1* | +| | | +| | - **Linux:** x86_32 CPU with SSE2 instructions, x86_64 CPU, ARMv7 or ARMv8 CPU | +| | | +| | - *Example: Intel Core 2 Duo E8200, AMD Athlon XE BE-2300, Raspberry Pi 4* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **GPU** | - **Forward+ rendering method:** Integrated graphics with full Vulkan 1.0 support | +| | | +| | - *Example: Intel HD Graphics 5500 (Broadwell), AMD Radeon R5 Graphics (Kaveri)* | +| | | +| | - **Mobile rendering method:** Integrated graphics with full Vulkan 1.0 support | +| | | +| | - *Example: Intel HD Graphics 5500 (Broadwell), AMD Radeon R5 Graphics (Kaveri)* | +| | | +| | - **Compatibility rendering method:** Integrated graphics with full OpenGL 3.3 support | +| | | +| | - *Example: Intel HD Graphics 2500 (Ivy Bridge), AMD Radeon R5 Graphics (Kaveri)* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **RAM** | - **Native editor:** 4 GB | +| | - **Web editor:** 8 GB | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Storage** | 200 MB (used for the executable, project files and cache). | +| | Exporting projects requires downloading export templates separately | +| | (1.3 GB after installation). | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Operating system** | - **Native editor:** Windows 7, macOS 10.13 (Compatibility) or | +| | macOS 10.15 (Forward+/Mobile), Linux distribution released after 2016 | +| | - **Web editor:** Firefox 79, Chrome 68, Edge 79, Safari 15.2, Opera 64 | ++----------------------+-----------------------------------------------------------------------------------------+ + +.. note:: + + Windows 7/8/8.1 are supported on a best-effort basis. These versions are not + regularly tested and some features may be missing (such as colored + :ref:`print_rich ` console output). + Support for Windows 7/8/8.1 may be removed in a + :ref:`future Godot 4.x release `. + + Vulkan drivers for these Windows versions are known to have issues with + memory leaks. As a result, it's recommended to stick to the Compatibility + rendering method when running Godot on an Windows version older than 10. + +Mobile device (smartphone/tablet) - Minimum +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ++----------------------+-----------------------------------------------------------------------------------------+ +| **CPU** | - **Android:** SoC with any 32-bit or 64-bit ARM or x86 CPU | +| | | +| | - *Example: Qualcomm Snapdragon 430, Samsung Exynos 5 Octa 5430* | +| | | +| | - **iOS:** *Cannot run the editor* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **GPU** | - **Forward+ rendering method:** SoC featuring GPU with full Vulkan 1.0 support | +| | | +| | - *Example: Qualcomm Adreno 505, Mali-G71 MP2* | +| | | +| | - **Mobile rendering method:** SoC featuring GPU with full Vulkan 1.0 support | +| | | +| | - *Example: Qualcomm Adreno 505, Mali-G71 MP2* | +| | | +| | - **Compatibility rendering method:** SoC featuring GPU with full OpenGL ES 3.0 support | +| | | +| | - *Example: Qualcomm Adreno 306, Mali-T628 MP6* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **RAM** | - **Native editor:** 3 GB | +| | - **Web editor:** 6 GB | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Storage** | 200 MB (used for the executable, project files and cache). | +| | Exporting projects requires downloading export templates separately | +| | (1.3 GB after installation). | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Operating system** | - **Native editor:** Android 6.0 (Compatibility) or Android 9.0 (Forward+/Mobile), | +| | iOS 11.0 | +| | - **Web editor:** Firefox 79, Chrome 88, Edge 79, Safari 15.2, Opera 64, | +| | Samsung Internet 15 | ++----------------------+-----------------------------------------------------------------------------------------+ + +These are the **recommended** specifications to get a smooth experience with the +Godot editor on a simple 2D or 3D project: + +Desktop or laptop PC - Recommended +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ++----------------------+-----------------------------------------------------------------------------------------+ +| **CPU** | - **Windows:** x86_64 CPU with SSE4.2 instructions, with 4 physical cores or more | +| | | +| | - *Example: Intel Core i5-6600K, AMD Ryzen 5 1600* | +| | | +| | - **macOS:** x86_64 or ARM CPU (Apple Silicon) | +| | | +| | - *Example: Intel Core i5-8500, Apple M1* | +| | | +| | - **Linux:** x86_32 CPU with SSE2 instructions, x86_64 CPU, ARMv7 or ARMv8 CPU | +| | | +| | - *Example: Intel Core i5-6600K, AMD Ryzen 5 1600, Raspberry Pi 5 with overclocking* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **GPU** | - **Forward+ rendering method:** Dedicated graphics with full Vulkan 1.2 support | +| | | +| | - *Example: NVIDIA GeForce GTX 1050 (Pascal), AMD Radeon RX 460 (GCN 4.0)* | +| | | +| | - **Mobile rendering method:** Dedicated graphics with full Vulkan 1.2 support | +| | | +| | - *Example: NVIDIA GeForce GTX 1050 (Pascal), AMD Radeon RX 460 (GCN 4.0)* | +| | | +| | - **Compatibility rendering method:** Dedicated graphics with full OpenGL 4.6 support | +| | | +| | - *Example: NVIDIA GeForce GTX 650 (Kepler), AMD Radeon HD 7750 (GCN 1.0)* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **RAM** | - **Native editor:** 8 GB | +| | - **Web editor:** 12 GB | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Storage** | 1.5 GB (used for the executable, project files, all export templates and cache) | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Operating system** | - **Native editor:** Windows 10, macOS 10.15, | +| | Linux distribution released after 2020 | +| | - **Web editor:** Latest version of Firefox, Chrome, Edge, Safari, Opera | ++----------------------+-----------------------------------------------------------------------------------------+ + +Mobile device (smartphone/tablet) - Recommended +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ++----------------------+-----------------------------------------------------------------------------------------+ +| **CPU** | - **Android:** SoC with 64-bit ARM or x86 CPU, with 3 "performance" cores or more | +| | | +| | - *Example: Qualcomm Snapdragon 845, Samsung Exynos 9810* | +| | | +| | - **iOS:** *Cannot run the editor* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **GPU** | - **Forward+ rendering method:** SoC featuring GPU with full Vulkan 1.2 support | +| | | +| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18* | +| | | +| | - **Mobile rendering method:** SoC featuring GPU with full Vulkan 1.2 support | +| | | +| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18* | +| | | +| | - **Compatibility rendering method:** SoC featuring GPU with full OpenGL ES 3.2 support | +| | | +| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **RAM** | - **Native editor:** 6 GB | +| | - **Web editor:** 8 GB | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Storage** | 1.5 GB (used for the executable, project files, all export templates and cache) | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Operating system** | - **Native editor:** Android 9.0 or iOS 11.0 | +| | - **Web editor:** Latest version of Firefox, Chrome, Edge, Safari, Opera, | +| | Samsung Internet | ++----------------------+-----------------------------------------------------------------------------------------+ + +Exported Godot project +---------------------- + +.. warning:: + + The requirements below are a baseline for a **simple** 2D or 3D project, + with basic scripting and few visual flourishes. CPU, GPU, RAM and + storage requirements will heavily vary depending on your project's scope, + its rendering method, viewport resolution and graphics settings chosen. + Other programs running on the system while the project is running + will also compete for resources, including RAM and video RAM. + + It is strongly recommended to do your own testing on low-end hardware to + make sure your project runs at the desired speed. To provide scalability for + low-end hardware, you will also need to introduce a + `graphics options menu `__ + to your project. + +These are the **minimum** specifications required to run a simple 2D or 3D +project exported with Godot: + +Desktop or laptop PC - Minimum +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. When adjusting specifications, make sure to only mention hardware that can run the required OS version. +.. For example, the x86 CPU requirement for macOS is set after the MacBook Air 11" (late 2010 model), +.. which can run up to macOS 10.13. + ++----------------------+-----------------------------------------------------------------------------------------+ +| **CPU** | - **Windows:** x86_32 CPU with SSE2 instructions, or any x86_64 CPU | +| | | +| | - *Example: Intel Core 2 Duo E8200, AMD Athlon XE BE-2300* | +| | | +| | - **macOS:** x86_64 or ARM CPU (Apple Silicon) | +| | | +| | - *Example: Intel Core 2 Duo SU9400, Apple M1* | +| | | +| | - **Linux:** x86_32 CPU with SSE2 instructions, x86_64 CPU, ARMv7 or ARMv8 CPU | +| | | +| | - *Example: Intel Core 2 Duo E8200, AMD Athlon XE BE-2300, Raspberry Pi 4* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **GPU** | - **Forward+ rendering method:** Integrated graphics with full Vulkan 1.0 support | +| | | +| | - *Example: Intel HD Graphics 5500 (Broadwell), AMD Radeon R5 Graphics (Kaveri)* | +| | | +| | - **Mobile rendering method:** Integrated graphics with full Vulkan 1.0 support | +| | | +| | - *Example: Intel HD Graphics 5500 (Broadwell), AMD Radeon R5 Graphics (Kaveri)* | +| | | +| | - **Compatibility rendering method:** Integrated graphics with full OpenGL 3.3 support | +| | | +| | - *Example: Intel HD Graphics 2500 (Ivy Bridge), AMD Radeon R5 Graphics (Kaveri)* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **RAM** | - **For native exports:** 2 GB | +| | - **For web exports:** 4 GB | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Storage** | 150 MB (used for the executable, project files and cache) | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Operating system** | - **For native exports:** Windows 7, macOS 10.13 (Compatibility) or | +| | macOS 10.15 (Forward+/Mobile), Linux distribution released after 2016 | +| | - **For web exports:** Firefox 79, Chrome 68, Edge 79, Safari 15.2, Opera 64 | ++----------------------+-----------------------------------------------------------------------------------------+ + +.. note:: + + Windows 7/8/8.1 are supported on a best-effort basis. These versions are not + regularly tested and some features may be missing (such as colored + :ref:`print_rich ` console output). + Support for Windows 7/8/8.1 may be removed in a + :ref:`future Godot 4.x release `. + + Vulkan drivers for these Windows versions are known to have issues with + memory leaks. As a result, it's recommended to stick to the Compatibility + rendering method when running Godot on an Windows version older than 10. + +Mobile device (smartphone/tablet) - Minimum +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ++----------------------+-----------------------------------------------------------------------------------------+ +| **CPU** | - **Android:** SoC with any 32-bit or 64-bit ARM or x86 CPU | +| | | +| | - *Example: Qualcomm Snapdragon 430, Samsung Exynos 5 Octa 5430* | +| | | +| | - **iOS:** SoC with any 64-bit ARM CPU | +| | | +| | - *Example: Apple A7 (iPhone 5S)* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **GPU** | - **Forward+ rendering method:** SoC featuring GPU with full Vulkan 1.0 support | +| | | +| | - *Example: Qualcomm Adreno 505, Mali-G71 MP2, PowerVR G6430 (iPhone 6S/iPhone SE 1)* | +| | | +| | - **Mobile rendering method:** SoC featuring GPU with full Vulkan 1.0 support | +| | | +| | - *Example: Qualcomm Adreno 505, Mali-G71 MP2, PowerVR G6430 (iPhone 6S/iPhone SE 1)* | +| | | +| | - **Compatibility rendering method:** SoC featuring GPU with full OpenGL ES 3.0 support | +| | | +| | - *Example: Qualcomm Adreno 306, Mali-T628 MP6, PowerVR G6430 (iPhone 5S)* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **RAM** | - **For native exports:** 1 GB | +| | - **For web exports:** 2 GB | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Storage** | 150 MB (used for the executable, project files and cache) | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Operating system** | - **For native exports:** Android 6.0 (Compatibility) or Android 9.0 (Forward+/Mobile), | +| | iOS 11.0 | +| | - **For web exports:** Firefox 79, Chrome 88, Edge 79, Safari 15.2, Opera 64, | +| | Samsung Internet 15 | ++----------------------+-----------------------------------------------------------------------------------------+ + +These are the **recommended** specifications to get a smooth experience with a +simple 2D or 3D project exported with Godot: + +Desktop or laptop PC - Recommended +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ++----------------------+-----------------------------------------------------------------------------------------+ +| **CPU** | - **Windows:** x86_64 CPU with SSE4.2 instructions, with 4 physical cores or more | +| | | +| | - *Example: Intel Core i5-6600K, AMD Ryzen 5 1600* | +| | | +| | - **macOS:** x86_64 or ARM CPU (Apple Silicon) | +| | | +| | - *Example: Intel Core i5-8500, Apple M1* | +| | | +| | - **Linux:** x86_32 CPU with SSE2 instructions, x86_64 CPU, ARMv7 or ARMv8 CPU | +| | | +| | - *Example: Intel Core i5-6600K, AMD Ryzen 5 1600, Raspberry Pi 5 with overclocking* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **GPU** | - **Forward+ rendering method:** Dedicated graphics with full Vulkan 1.2 support | +| | | +| | - *Example: NVIDIA GeForce GTX 1050 (Pascal), AMD Radeon RX 460 (GCN 4.0)* | +| | | +| | - **Mobile rendering method:** Dedicated graphics with full Vulkan 1.2 support | +| | | +| | - *Example: NVIDIA GeForce GTX 1050 (Pascal), AMD Radeon RX 460 (GCN 4.0)* | +| | | +| | - **Compatibility rendering method:** Dedicated graphics with full OpenGL 4.6 support | +| | | +| | - *Example: NVIDIA GeForce GTX 650 (Kepler), AMD Radeon HD 7750 (GCN 1.0)* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **RAM** | - **For native exports:** 4 GB | +| | - **For web exports:** 8 GB | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Storage** | 150 MB (used for the executable, project files and cache) | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Operating system** | - **For native exports:** Windows 10, macOS 10.15, | +| | Linux distribution released after 2020 | +| | - **For web exports:** Latest version of Firefox, Chrome, Edge, Safari, Opera | ++----------------------+-----------------------------------------------------------------------------------------+ + +Mobile device (smartphone/tablet) - Recommended +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ++----------------------+-----------------------------------------------------------------------------------------+ +| **CPU** | - **Android:** SoC with 64-bit ARM or x86 CPU, with 3 "performance" cores or more | +| | | +| | - *Example: Qualcomm Snapdragon 845, Samsung Exynos 9810* | +| | | +| | - **iOS:** SoC with 64-bit ARM CPU | +| | | +| | - *Example: Apple A11 (iPhone XS/XR)* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **GPU** | - **Forward+ rendering method:** SoC featuring GPU with full Vulkan 1.2 support | +| | | +| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18, Apple G11P (iPhone XR/XS)* | +| | | +| | - **Mobile rendering method:** SoC featuring GPU with full Vulkan 1.2 support | +| | | +| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18, Apple G11P (iPhone XR/XS)* | +| | | +| | - **Compatibility rendering method:** SoC featuring GPU with full OpenGL ES 3.2 support | +| | | +| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18, Apple G11P (iPhone XR/XS)* | ++----------------------+-----------------------------------------------------------------------------------------+ +| **RAM** | - **For native exports:** 2 GB | +| | - **For web exports:** 4 GB | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Storage** | 150 MB (used for the executable, project files and cache) | ++----------------------+-----------------------------------------------------------------------------------------+ +| **Operating system** | - **For native exports:** Android 9.0 or iOS 11.0 | +| | - **For web exports:** Latest version of Firefox, Chrome, Edge, Safari, Opera, | +| | Samsung Internet | ++----------------------+-----------------------------------------------------------------------------------------+ + +.. note:: + + Godot doesn't use OpenGL/OpenGL ES extensions introduced after OpenGL + 3.3/OpenGL ES 3.0, but GPUs supporting newer OpenGL/OpenGL ES versions + generally have fewer driver issues. diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index 1bbf88cc1f9..abd49a0367f 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -972,7 +972,7 @@ See also :ref:`@GlobalScope.typeof`, :ref:`typ :ref:`int` **len** **(** :ref:`Variant` var **)** -Returns the length of the given Variant ``var``. The length can be the character count of a :ref:`String`, the element count of any array type or the size of a :ref:`Dictionary`. For every other Variant type, a run-time error is generated and execution is stopped. +Returns the length of the given Variant ``var``. The length can be the character count of a :ref:`String` or :ref:`StringName`, the element count of any array type, or the size of a :ref:`Dictionary`. For every other Variant type, a run-time error is generated and execution is stopped. :: @@ -992,7 +992,7 @@ Returns the length of the given Variant ``var``. The length can be the character :ref:`Resource` **load** **(** :ref:`String` path **)** -Returns a :ref:`Resource` from the filesystem located at the absolute ``path``. Unless it's already referenced elsewhere (such as in another script or in the scene), the resource is loaded from disk on function call, which might cause a slight delay, especially when loading large scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use :ref:`preload`. +Returns a :ref:`Resource` from the filesystem located at the absolute ``path``. Unless it's already referenced elsewhere (such as in another script or in the scene), the resource is loaded from disk on function call, which might cause a slight delay, especially when loading large scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use :ref:`preload`. This method is equivalent of using :ref:`ResourceLoader.load` with :ref:`ResourceLoader.CACHE_MODE_REUSE`. \ **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 current script. diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index ebb7762634a..6696e60a7ea 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -2393,6 +2393,42 @@ Group Switch key mask. ---- +.. _enum_@GlobalScope_KeyLocation: + +.. rst-class:: classref-enumeration + +enum **KeyLocation**: + +.. _class_@GlobalScope_constant_KEY_LOCATION_UNSPECIFIED: + +.. rst-class:: classref-enumeration-constant + +:ref:`KeyLocation` **KEY_LOCATION_UNSPECIFIED** = ``0`` + +Used for keys which only appear once, or when a comparison doesn't need to differentiate the ``LEFT`` and ``RIGHT`` versions. + +For example, when using :ref:`InputEvent.is_match`, an event which has :ref:`KEY_LOCATION_UNSPECIFIED` will match any :ref:`KeyLocation` on the passed event. + +.. _class_@GlobalScope_constant_KEY_LOCATION_LEFT: + +.. rst-class:: classref-enumeration-constant + +:ref:`KeyLocation` **KEY_LOCATION_LEFT** = ``1`` + +A key which is to the left of its twin. + +.. _class_@GlobalScope_constant_KEY_LOCATION_RIGHT: + +.. rst-class:: classref-enumeration-constant + +:ref:`KeyLocation` **KEY_LOCATION_RIGHT** = ``2`` + +A key which is to the right of its twin. + +.. rst-class:: classref-item-separator + +---- + .. _enum_@GlobalScope_MouseButton: .. rst-class:: classref-enumeration @@ -2835,7 +2871,7 @@ enum **MIDIMessage**: :ref:`MIDIMessage` **MIDI_MESSAGE_NONE** = ``0`` -Enum value which doesn't correspond to any MIDI message. This is used to initialize :ref:`MIDIMessage` properties with a generic state. +Does not correspond to any MIDI message. This is the default value of :ref:`InputEventMIDI.message`. .. _class_@GlobalScope_constant_MIDI_MESSAGE_NOTE_OFF: @@ -2843,7 +2879,9 @@ Enum value which doesn't correspond to any MIDI message. This is used to initial :ref:`MIDIMessage` **MIDI_MESSAGE_NOTE_OFF** = ``8`` -MIDI note OFF message. Not all MIDI devices send this event; some send :ref:`MIDI_MESSAGE_NOTE_ON` with zero velocity instead. See the documentation of :ref:`InputEventMIDI` for information of how to use MIDI inputs. +MIDI message sent when a note is released. + +\ **Note:** Not all MIDI devices send this message; some may send :ref:`MIDI_MESSAGE_NOTE_ON` with :ref:`InputEventMIDI.velocity` set to ``0``. .. _class_@GlobalScope_constant_MIDI_MESSAGE_NOTE_ON: @@ -2851,7 +2889,7 @@ MIDI note OFF message. Not all MIDI devices send this event; some send :ref:`MID :ref:`MIDIMessage` **MIDI_MESSAGE_NOTE_ON** = ``9`` -MIDI note ON message. Some MIDI devices send this event with velocity zero instead of :ref:`MIDI_MESSAGE_NOTE_OFF`, but implementations vary. See the documentation of :ref:`InputEventMIDI` for information of how to use MIDI inputs. +MIDI message sent when a note is pressed. .. _class_@GlobalScope_constant_MIDI_MESSAGE_AFTERTOUCH: @@ -2859,7 +2897,7 @@ MIDI note ON message. Some MIDI devices send this event with velocity zero inste :ref:`MIDIMessage` **MIDI_MESSAGE_AFTERTOUCH** = ``10`` -MIDI aftertouch message. This message is most often sent by pressing down on the key after it "bottoms out". +MIDI message sent to indicate a change in pressure while a note is being pressed down, also called aftertouch. .. _class_@GlobalScope_constant_MIDI_MESSAGE_CONTROL_CHANGE: @@ -2867,7 +2905,7 @@ MIDI aftertouch message. This message is most often sent by pressing down on the :ref:`MIDIMessage` **MIDI_MESSAGE_CONTROL_CHANGE** = ``11`` -MIDI control change message. This message is sent when a controller value changes. Controllers include devices such as pedals and levers. +MIDI message sent when a controller value changes. In a MIDI device, a controller is any input that doesn't play notes. These may include sliders for volume, balance, and panning, as well as switches and pedals. See the `General MIDI specification `__ for a small list. .. _class_@GlobalScope_constant_MIDI_MESSAGE_PROGRAM_CHANGE: @@ -2875,7 +2913,7 @@ MIDI control change message. This message is sent when a controller value change :ref:`MIDIMessage` **MIDI_MESSAGE_PROGRAM_CHANGE** = ``12`` -MIDI program change message. This message sent when the program patch number changes. +MIDI message sent when the MIDI device changes its current instrument (also called *program* or *preset*). .. _class_@GlobalScope_constant_MIDI_MESSAGE_CHANNEL_PRESSURE: @@ -2883,7 +2921,7 @@ MIDI program change message. This message sent when the program patch number cha :ref:`MIDIMessage` **MIDI_MESSAGE_CHANNEL_PRESSURE** = ``13`` -MIDI channel pressure message. This message is most often sent by pressing down on the key after it "bottoms out". This message is different from polyphonic after-touch as it indicates the highest pressure across all keys. +MIDI message sent to indicate a change in pressure for the whole channel. Some MIDI devices may send this instead of :ref:`MIDI_MESSAGE_AFTERTOUCH`. .. _class_@GlobalScope_constant_MIDI_MESSAGE_PITCH_BEND: @@ -2891,7 +2929,7 @@ MIDI channel pressure message. This message is most often sent by pressing down :ref:`MIDIMessage` **MIDI_MESSAGE_PITCH_BEND** = ``14`` -MIDI pitch bend message. This message is sent to indicate a change in the pitch bender (wheel or lever, typically). +MIDI message sent when the value of the pitch bender changes, usually a wheel on the MIDI device. .. _class_@GlobalScope_constant_MIDI_MESSAGE_SYSTEM_EXCLUSIVE: @@ -2899,7 +2937,9 @@ MIDI pitch bend message. This message is sent to indicate a change in the pitch :ref:`MIDIMessage` **MIDI_MESSAGE_SYSTEM_EXCLUSIVE** = ``240`` -MIDI system exclusive message. This has behavior exclusive to the device you're receiving input from. Getting this data is not implemented in Godot. +MIDI system exclusive (SysEx) message. This type of message is not standardized and it's highly dependent on the MIDI device sending it. + +\ **Note:** Getting this message's data from :ref:`InputEventMIDI` is not implemented. .. _class_@GlobalScope_constant_MIDI_MESSAGE_QUARTER_FRAME: @@ -2907,7 +2947,9 @@ MIDI system exclusive message. This has behavior exclusive to the device you're :ref:`MIDIMessage` **MIDI_MESSAGE_QUARTER_FRAME** = ``241`` -MIDI quarter frame message. Contains timing information that is used to synchronize MIDI devices. Getting this data is not implemented in Godot. +MIDI message sent every quarter frame to keep connected MIDI devices synchronized. Related to :ref:`MIDI_MESSAGE_TIMING_CLOCK`. + +\ **Note:** Getting this message's data from :ref:`InputEventMIDI` is not implemented. .. _class_@GlobalScope_constant_MIDI_MESSAGE_SONG_POSITION_POINTER: @@ -2915,7 +2957,9 @@ MIDI quarter frame message. Contains timing information that is used to synchron :ref:`MIDIMessage` **MIDI_MESSAGE_SONG_POSITION_POINTER** = ``242`` -MIDI song position pointer message. Gives the number of 16th notes since the start of the song. Getting this data is not implemented in Godot. +MIDI message sent to jump onto a new position in the current sequence or song. + +\ **Note:** Getting this message's data from :ref:`InputEventMIDI` is not implemented. .. _class_@GlobalScope_constant_MIDI_MESSAGE_SONG_SELECT: @@ -2923,7 +2967,9 @@ MIDI song position pointer message. Gives the number of 16th notes since the sta :ref:`MIDIMessage` **MIDI_MESSAGE_SONG_SELECT** = ``243`` -MIDI song select message. Specifies which sequence or song is to be played. Getting this data is not implemented in Godot. +MIDI message sent to select a sequence or song to play. + +\ **Note:** Getting this message's data from :ref:`InputEventMIDI` is not implemented. .. _class_@GlobalScope_constant_MIDI_MESSAGE_TUNE_REQUEST: @@ -2931,7 +2977,7 @@ MIDI song select message. Specifies which sequence or song is to be played. Gett :ref:`MIDIMessage` **MIDI_MESSAGE_TUNE_REQUEST** = ``246`` -MIDI tune request message. Upon receiving a tune request, all analog synthesizers should tune their oscillators. +MIDI message sent to request a tuning calibration. Used on analog synthesizers. Most modern MIDI devices do not need this message. .. _class_@GlobalScope_constant_MIDI_MESSAGE_TIMING_CLOCK: @@ -2939,7 +2985,7 @@ MIDI tune request message. Upon receiving a tune request, all analog synthesizer :ref:`MIDIMessage` **MIDI_MESSAGE_TIMING_CLOCK** = ``248`` -MIDI timing clock message. Sent 24 times per quarter note when synchronization is required. +MIDI message sent 24 times after :ref:`MIDI_MESSAGE_QUARTER_FRAME`, to keep connected MIDI devices synchronized. .. _class_@GlobalScope_constant_MIDI_MESSAGE_START: @@ -2947,7 +2993,7 @@ MIDI timing clock message. Sent 24 times per quarter note when synchronization i :ref:`MIDIMessage` **MIDI_MESSAGE_START** = ``250`` -MIDI start message. Start the current sequence playing. This message will be followed with Timing Clocks. +MIDI message sent to start the current sequence or song from the beginning. .. _class_@GlobalScope_constant_MIDI_MESSAGE_CONTINUE: @@ -2955,7 +3001,7 @@ MIDI start message. Start the current sequence playing. This message will be fol :ref:`MIDIMessage` **MIDI_MESSAGE_CONTINUE** = ``251`` -MIDI continue message. Continue at the point the sequence was stopped. +MIDI message sent to resume from the point the current sequence or song was paused. .. _class_@GlobalScope_constant_MIDI_MESSAGE_STOP: @@ -2963,7 +3009,7 @@ MIDI continue message. Continue at the point the sequence was stopped. :ref:`MIDIMessage` **MIDI_MESSAGE_STOP** = ``252`` -MIDI stop message. Stop the current sequence. +MIDI message sent to pause the current sequence or song. .. _class_@GlobalScope_constant_MIDI_MESSAGE_ACTIVE_SENSING: @@ -2971,7 +3017,7 @@ MIDI stop message. Stop the current sequence. :ref:`MIDIMessage` **MIDI_MESSAGE_ACTIVE_SENSING** = ``254`` -MIDI active sensing message. This message is intended to be sent repeatedly to tell the receiver that a connection is alive. +MIDI message sent repeatedly while the MIDI device is idle, to tell the receiver that the connection is alive. Most MIDI devices do not send this message. .. _class_@GlobalScope_constant_MIDI_MESSAGE_SYSTEM_RESET: @@ -2979,7 +3025,7 @@ MIDI active sensing message. This message is intended to be sent repeatedly to t :ref:`MIDIMessage` **MIDI_MESSAGE_SYSTEM_RESET** = ``255`` -MIDI system reset message. Reset all receivers in the system to power-up status. It should not be sent on power-up itself. +MIDI message sent to reset a MIDI device to its default state, as if it was just turned on. It should not be sent when the MIDI device is being turned on. .. rst-class:: classref-item-separator @@ -3615,7 +3661,7 @@ Hints that a :ref:`Color` property should be edited without affecti :ref:`PropertyHint` **PROPERTY_HINT_OBJECT_ID** = ``22`` - +Hints that the property's value is an object encoded as object ID, with its type specified in the hint string. Used by the debugger. .. _class_@GlobalScope_constant_PROPERTY_HINT_TYPE_STRING: @@ -3698,7 +3744,7 @@ Examples: :ref:`PropertyHint` **PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE** = ``24`` - +*Deprecated.* This hint is not used anywhere and will be removed in the future. .. _class_@GlobalScope_constant_PROPERTY_HINT_OBJECT_TOO_BIG: @@ -3706,7 +3752,7 @@ Examples: :ref:`PropertyHint` **PROPERTY_HINT_OBJECT_TOO_BIG** = ``25`` - +Hints that an object is too big to be sent via the debugger. .. _class_@GlobalScope_constant_PROPERTY_HINT_NODE_PATH_VALID_TYPES: @@ -3714,7 +3760,7 @@ Examples: :ref:`PropertyHint` **PROPERTY_HINT_NODE_PATH_VALID_TYPES** = ``26`` - +Hints that the hint string specifies valid node types for property of type :ref:`NodePath`. .. _class_@GlobalScope_constant_PROPERTY_HINT_SAVE_FILE: @@ -3722,7 +3768,7 @@ Examples: :ref:`PropertyHint` **PROPERTY_HINT_SAVE_FILE** = ``27`` - +Hints that a :ref:`String` property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the project's directory. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``. See also :ref:`FileDialog.filters`. .. _class_@GlobalScope_constant_PROPERTY_HINT_GLOBAL_SAVE_FILE: @@ -3730,7 +3776,7 @@ Examples: :ref:`PropertyHint` **PROPERTY_HINT_GLOBAL_SAVE_FILE** = ``28`` - +Hints that a :ref:`String` property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the entire filesystem. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``. See also :ref:`FileDialog.filters`. .. _class_@GlobalScope_constant_PROPERTY_HINT_INT_IS_OBJECTID: @@ -3738,7 +3784,9 @@ Examples: :ref:`PropertyHint` **PROPERTY_HINT_INT_IS_OBJECTID** = ``29`` +Hints that an :ref:`int` property is an object ID. +\ *Deprecated.* This hint is not used anywhere and will be removed in the future. .. _class_@GlobalScope_constant_PROPERTY_HINT_INT_IS_POINTER: @@ -3746,7 +3794,7 @@ Examples: :ref:`PropertyHint` **PROPERTY_HINT_INT_IS_POINTER** = ``30`` - +Hints that an :ref:`int` property is a pointer. Used by GDExtension. .. _class_@GlobalScope_constant_PROPERTY_HINT_ARRAY_TYPE: @@ -3754,7 +3802,7 @@ Examples: :ref:`PropertyHint` **PROPERTY_HINT_ARRAY_TYPE** = ``31`` - +Hints that a property is an :ref:`Array` with the stored type specified in the hint string. .. _class_@GlobalScope_constant_PROPERTY_HINT_LOCALE_ID: @@ -3778,7 +3826,7 @@ Hints that a dictionary property is string translation map. Dictionary keys are :ref:`PropertyHint` **PROPERTY_HINT_NODE_TYPE** = ``34`` - +Hints that a property is an instance of a :ref:`Node`-derived type, optionally specified via the hint string (e.g. ``"Node2D"``). Editing it will show a dialog for picking a node from the scene. .. _class_@GlobalScope_constant_PROPERTY_HINT_HIDE_QUATERNION_EDIT: @@ -3892,7 +3940,7 @@ Used to group properties together in the editor in a subgroup (under a group). S :ref:`PropertyUsageFlags` **PROPERTY_USAGE_CLASS_IS_BITFIELD** = ``512`` - +The property is a bitfield, i.e. it contains multiple flags represented as bits. .. _class_@GlobalScope_constant_PROPERTY_USAGE_NO_INSTANCE_STATE: @@ -3924,7 +3972,7 @@ The property is a script variable which should be serialized and saved in the sc :ref:`PropertyUsageFlags` **PROPERTY_USAGE_STORE_IF_NULL** = ``8192`` - +The property value of type :ref:`Object` will be stored even if its value is ``null``. .. _class_@GlobalScope_constant_PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED: @@ -3932,7 +3980,7 @@ The property is a script variable which should be serialized and saved in the sc :ref:`PropertyUsageFlags` **PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED** = ``16384`` - +If this property is modified, all inspector fields will be refreshed. .. _class_@GlobalScope_constant_PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE: @@ -3940,7 +3988,9 @@ The property is a script variable which should be serialized and saved in the sc :ref:`PropertyUsageFlags` **PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE** = ``32768`` +Signifies a default value from a placeholder script instance. +\ *Deprecated.* This hint is not used anywhere and will be removed in the future. .. _class_@GlobalScope_constant_PROPERTY_USAGE_CLASS_IS_ENUM: @@ -3948,7 +3998,7 @@ The property is a script variable which should be serialized and saved in the sc :ref:`PropertyUsageFlags` **PROPERTY_USAGE_CLASS_IS_ENUM** = ``65536`` - +The property is an enum, i.e. it only takes named integer constants from its associated enumeration. .. _class_@GlobalScope_constant_PROPERTY_USAGE_NIL_IS_VARIANT: @@ -3956,7 +4006,7 @@ The property is a script variable which should be serialized and saved in the sc :ref:`PropertyUsageFlags` **PROPERTY_USAGE_NIL_IS_VARIANT** = ``131072`` - +If property has ``nil`` as default value, its type will be :ref:`Variant`. .. _class_@GlobalScope_constant_PROPERTY_USAGE_ARRAY: @@ -3996,7 +4046,7 @@ The property is only shown in the editor if modern renderers are supported (the :ref:`PropertyUsageFlags` **PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT** = ``4194304`` - +The :ref:`NodePath` property will always be relative to the scene's root. Mostly useful for local resources. .. _class_@GlobalScope_constant_PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT: @@ -4004,7 +4054,7 @@ The property is only shown in the editor if modern renderers are supported (the :ref:`PropertyUsageFlags` **PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT** = ``8388608`` - +Use when a resource is created on the fly, i.e. the getter will always return a different instance. :ref:`ResourceSaver` needs this information to properly save such resources. .. _class_@GlobalScope_constant_PROPERTY_USAGE_KEYING_INCREMENTS: @@ -4012,7 +4062,7 @@ The property is only shown in the editor if modern renderers are supported (the :ref:`PropertyUsageFlags` **PROPERTY_USAGE_KEYING_INCREMENTS** = ``16777216`` - +Inserting an animation key frame of this property will automatically increment the value, allowing to easily keyframe multiple values in a row. .. _class_@GlobalScope_constant_PROPERTY_USAGE_DEFERRED_SET_RESOURCE: @@ -4020,7 +4070,9 @@ The property is only shown in the editor if modern renderers are supported (the :ref:`PropertyUsageFlags` **PROPERTY_USAGE_DEFERRED_SET_RESOURCE** = ``33554432`` +When loading, the resource for this property can be set at the end of loading. +\ *Deprecated.* This hint is not used anywhere and will be removed in the future. .. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT: @@ -4028,7 +4080,7 @@ The property is only shown in the editor if modern renderers are supported (the :ref:`PropertyUsageFlags` **PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT** = ``67108864`` - +When this property is a :ref:`Resource` and base object is a :ref:`Node`, a resource instance will be automatically created whenever the node is created in the editor. .. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR_BASIC_SETTING: @@ -4036,7 +4088,7 @@ The property is only shown in the editor if modern renderers are supported (the :ref:`PropertyUsageFlags` **PROPERTY_USAGE_EDITOR_BASIC_SETTING** = ``134217728`` - +The property is considered a basic setting and will appear even when advanced mode is disabled. Used for project settings. .. _class_@GlobalScope_constant_PROPERTY_USAGE_READ_ONLY: @@ -5474,20 +5526,10 @@ Clamps the ``value``, returning a :ref:`Variant` not less than `` var b = clamp(8.1, 0.9, 5.5) # b is 5.5 - - var c = clamp(Vector2(-3.5, -4), Vector2(-3.2, -2), Vector2(2, 6.5)) - # c is (-3.2, -2) - - var d = clamp(Vector2i(7, 8), Vector2i(-3, -2), Vector2i(2, 6)) - # d is (2, 6) - - var e = clamp(Vector3(-7, 8.5, -3.8), Vector3(-3, -2, 5.4), Vector3(-2, 6, -4.1)) - # e is (-3, -2, 5.4) - - var f = clamp(Vector3i(-7, -8, -9), Vector3i(-1, 2, 3), Vector3i(-4, -5, -6)) - # f is (-4, -5, -6) -\ **Note:** For better type safety, use :ref:`clampf`, :ref:`clampi`, :ref:`Vector2.clamp`, :ref:`Vector2i.clamp`, :ref:`Vector3.clamp`, :ref:`Vector3i.clamp`, :ref:`Vector4.clamp`, :ref:`Vector4i.clamp`, or :ref:`Color.clamp`. +\ **Note:** For better type safety, use :ref:`clampf`, :ref:`clampi`, :ref:`Vector2.clamp`, :ref:`Vector2i.clamp`, :ref:`Vector3.clamp`, :ref:`Vector3i.clamp`, :ref:`Vector4.clamp`, :ref:`Vector4i.clamp`, or :ref:`Color.clamp` (not currently supported by this method). + +\ **Note:** When using this on vectors it will *not* perform component-wise clamping, and will pick ``min`` if ``value < min`` or ``max`` if ``value > max``. To perform component-wise clamping use the methods listed above. .. rst-class:: classref-item-separator @@ -6412,6 +6454,8 @@ When printing to standard output, the supported subset of BBCode is converted to \ **Note:** On Windows, only Windows 10 and later correctly displays ANSI escape codes in standard output. +\ **Note:** Output displayed in the editor supports clickable ``[url=address]text[/url]`` tags. The ``[url]`` tag's ``address`` value is handled by :ref:`OS.shell_open` when clicked. + .. rst-class:: classref-item-separator ---- @@ -7219,7 +7263,7 @@ Converts the given ``variant`` to the given ``type``, using the :ref:`Variant.Ty If the type conversion cannot be done, this method will return the default value for that type, for example converting :ref:`Rect2` to :ref:`Vector2` will always return :ref:`Vector2.ZERO`. This method will never show error messages as long as ``type`` is a valid Variant type. -The returned value is a :ref:`Variant`, but the data inside and the :ref:`Variant.Type` will be the same as the requested type. +The returned value is a :ref:`Variant`, but the data inside and its type will be the same as the requested type. :: @@ -7287,6 +7331,8 @@ Encodes a :ref:`Variant` value to a byte array, without encoding \ **Note:** If you need object serialization, see :ref:`var_to_bytes_with_objects`. +\ **Note:** Encoding :ref:`Callable` is not supported and will result in an empty value, regardless of the data. + .. rst-class:: classref-item-separator ---- @@ -7299,6 +7345,8 @@ Encodes a :ref:`Variant` value to a byte array, without encoding Encodes a :ref:`Variant` value to a byte array. Encoding objects is allowed (and can potentially include executable code). Deserialization can be done with :ref:`bytes_to_var_with_objects`. +\ **Note:** Encoding :ref:`Callable` is not supported and will result in an empty value, regardless of the data. + .. rst-class:: classref-item-separator ---- @@ -7347,7 +7395,7 @@ Prints: :ref:`Variant` **weakref** **(** :ref:`Variant` obj **)** -Returns a weak reference to an object, or ``null`` if ``obj`` is invalid. +Returns a :ref:`WeakRef` instance holding a weak reference to ``obj``. Returns an empty :ref:`WeakRef` instance if ``obj`` is ``null``. Prints an error and returns ``null`` if ``obj`` is neither :ref:`Object`-derived nor ``null``. 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. diff --git a/classes/class_aabb.rst b/classes/class_aabb.rst index 113d74bdf4e..cdca47511ea 100644 --- a/classes/class_aabb.rst +++ b/classes/class_aabb.rst @@ -17,13 +17,13 @@ A 3D axis-aligned bounding box. Description ----------- -**AABB** consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. +The **AABB** built-in :ref:`Variant` type represents an axis-aligned bounding box in a 3D space. It is defined by its :ref:`position` and :ref:`size`, which are :ref:`Vector3`. It is frequently used for fast overlap tests (see :ref:`intersects`). Although **AABB** itself is axis-aligned, it can be combined with :ref:`Transform3D` to represent a rotated or skewed bounding box. -It uses floating-point coordinates. The 2D counterpart to **AABB** is :ref:`Rect2`. +It uses floating-point coordinates. The 2D counterpart to **AABB** is :ref:`Rect2`. There is no version of **AABB** that uses integer coordinates. -Negative values for :ref:`size` are not supported and will not work for most methods. Use :ref:`abs` to get an AABB with a positive size. +\ **Note:** Negative values for :ref:`size` are not supported. With negative size, most **AABB** methods do not work correctly. Use :ref:`abs` to get an equivalent **AABB** with a non-negative size. -\ **Note:** Unlike :ref:`Rect2`, **AABB** does not have a variant that uses integer coordinates. +\ **Note:** In a boolean context, a **AABB** evaluates to ``false`` if both :ref:`position` and :ref:`size` are zero (equal to :ref:`Vector3.ZERO`). Otherwise, it always evaluates to ``true``. .. note:: @@ -163,7 +163,7 @@ Property Descriptions :ref:`Vector3` **end** = ``Vector3(0, 0, 0)`` -Ending corner. This is calculated as ``position + size``. Setting this value will change the size. +The ending point. This is usually the corner on the top-right and forward of the bounding box, and is equivalent to ``position + size``. Setting this point affects the :ref:`size`. .. rst-class:: classref-item-separator @@ -175,7 +175,7 @@ Ending corner. This is calculated as ``position + size``. Setting this value wil :ref:`Vector3` **position** = ``Vector3(0, 0, 0)`` -Beginning corner. Typically has values lower than :ref:`end`. +The origin point. This is usually the corner on the bottom-left and back of the bounding box. .. rst-class:: classref-item-separator @@ -187,9 +187,9 @@ Beginning corner. Typically has values lower than :ref:`end` **size** = ``Vector3(0, 0, 0)`` -Size from :ref:`position` to :ref:`end`. Typically, all components are positive. +The bounding box's width, height, and depth starting from :ref:`position`. Setting this value also affects the :ref:`end` point. -If the size is negative, you can use :ref:`abs` to fix it. +\ **Note:** It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the :ref:`position` is the bottom-left-back corner, and the :ref:`end` is the top-right-forward corner. To get an equivalent bounding box with non-negative size, use :ref:`abs`. .. rst-class:: classref-section-separator @@ -206,7 +206,7 @@ Constructor Descriptions :ref:`AABB` **AABB** **(** **)** -Constructs a default-initialized **AABB** with default (zero) values of :ref:`position` and :ref:`size`. +Constructs an **AABB** with its :ref:`position` and :ref:`size` set to :ref:`Vector3.ZERO`. .. rst-class:: classref-item-separator @@ -226,7 +226,7 @@ Constructs an **AABB** as a copy of the given **AABB**. :ref:`AABB` **AABB** **(** :ref:`Vector3` position, :ref:`Vector3` size **)** -Constructs an **AABB** from a position and size. +Constructs an **AABB** by ``position`` and ``size``. .. rst-class:: classref-section-separator @@ -243,7 +243,28 @@ Method Descriptions :ref:`AABB` **abs** **(** **)** |const| -Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive. +Returns an **AABB** equivalent to this bounding box, with its width, height, and depth modified to be non-negative values. + + +.. tabs:: + + .. code-tab:: gdscript + + var box = AABB(Vector3(5, 0, 5), Vector3(-20, -10, -5)) + var absolute = box.abs() + print(absolute.position) # Prints (-15, -10, 0) + print(absolute.size) # Prints (20, 10, 5) + + .. code-tab:: csharp + + var box = new Aabb(new Vector3(5, 0, 5), new Vector3(-20, -10, -5)); + var absolute = box.Abs(); + GD.Print(absolute.Position); // Prints (-15, -10, 0) + GD.Print(absolute.Size); // Prints (20, 10, 5) + + + +\ **Note:** It's recommended to use this method when :ref:`size` is negative, as most other methods in Godot assume that the :ref:`size`'s components are greater than ``0``. .. rst-class:: classref-item-separator @@ -255,7 +276,32 @@ Returns an AABB with equivalent position and size, modified so that the most-neg :ref:`bool` **encloses** **(** :ref:`AABB` with **)** |const| -Returns ``true`` if this **AABB** completely encloses another one. +Returns ``true`` if this bounding box *completely* encloses the ``with`` box. The edges of both boxes are included. + + +.. tabs:: + + .. code-tab:: gdscript + + var a = AABB(Vector3(0, 0, 0), Vector3(4, 4, 4)) + var b = AABB(Vector3(1, 1, 1), Vector3(3, 3, 3)) + var c = AABB(Vector3(2, 2, 2), Vector3(8, 8, 8)) + + print(a.encloses(a)) # Prints true + print(a.encloses(b)) # Prints true + print(a.encloses(c)) # Prints false + + .. code-tab:: csharp + + var a = new Aabb(new Vector3(0, 0, 0), new Vector3(4, 4, 4)); + var b = new Aabb(new Vector3(1, 1, 1), new Vector3(3, 3, 3)); + var c = new Aabb(new Vector3(2, 2, 2), new Vector3(8, 8, 8)); + + GD.Print(a.Encloses(a)); // Prints True + GD.Print(a.Encloses(b)); // Prints True + GD.Print(a.Encloses(c)); // Prints False + + .. rst-class:: classref-item-separator @@ -267,26 +313,34 @@ Returns ``true`` if this **AABB** completely encloses another one. :ref:`AABB` **expand** **(** :ref:`Vector3` to_point **)** |const| -Returns a copy of this **AABB** expanded to include a given point. - -\ **Example:**\ +Returns a copy of this bounding box expanded to align the edges with the given ``to_point``, if necessary. .. tabs:: .. code-tab:: gdscript - # 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)) + var box = AABB(Vector3(0, 0, 0), Vector3(5, 2, 5)) + + box = box.expand(Vector3(10, 0, 0)) + print(box.position) # Prints (0, 0, 0) + print(box.size) # Prints (10, 2, 5) + + box = box.expand(Vector3(-5, 0, 5)) + print(box.position) # Prints (-5, 0, 0) + print(box.size) # Prints (15, 2, 5) .. code-tab:: csharp - // position (-3, 2, 0), size (1, 1, 1) - var box = new Aabb(new Vector3(-3, 2, 0), new 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(new Vector3(0, -1, 2)); + var box = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 5)); + + box = box.Expand(new Vector3(10, 0, 0)); + GD.Print(box.Position); // Prints (0, 0, 0) + GD.Print(box.Size); // Prints (10, 2, 5) + + box = box.Expand(new Vector3(-5, 0, 5)); + GD.Print(box.Position); // Prints (-5, 0, 0) + GD.Print(box.Size); // Prints (15, 2, 5) @@ -300,7 +354,7 @@ Returns a copy of this **AABB** expanded to include a given point. :ref:`Vector3` **get_center** **(** **)** |const| -Returns the center of the **AABB**, which is equal to :ref:`position` + (:ref:`size` / 2). +Returns the center point of the bounding box. This is the same as ``position + (size / 2.0)``. .. rst-class:: classref-item-separator @@ -312,7 +366,7 @@ Returns the center of the **AABB**, which is equal to :ref:`position` **get_endpoint** **(** :ref:`int` idx **)** |const| -Gets the position of the 8 endpoints of the **AABB** in space. +Returns the position of one of the 8 vertices that compose this bounding box. With a ``idx`` of ``0`` this is the same as :ref:`position`, and a ``idx`` of ``7`` is the same as :ref:`end`. .. rst-class:: classref-item-separator @@ -324,7 +378,30 @@ Gets the position of the 8 endpoints of the **AABB** in space. :ref:`Vector3` **get_longest_axis** **(** **)** |const| -Returns the normalized longest axis of the **AABB**. +Returns the longest normalized axis of this bounding box's :ref:`size`, as a :ref:`Vector3` (:ref:`Vector3.RIGHT`, :ref:`Vector3.UP`, or :ref:`Vector3.BACK`). + + +.. tabs:: + + .. code-tab:: gdscript + + var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8)) + + print(box.get_longest_axis()) # Prints (0, 0, 1) + print(box.get_longest_axis_index()) # Prints 2 + print(box.get_longest_axis_size()) # Prints 8 + + .. code-tab:: csharp + + var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8)); + + GD.Print(box.GetLongestAxis()); // Prints (0, 0, 1) + GD.Print(box.GetLongestAxisIndex()); // Prints 2 + GD.Print(box.GetLongestAxisSize()); // Prints 8 + + + +See also :ref:`get_longest_axis_index` and :ref:`get_longest_axis_size`. .. rst-class:: classref-item-separator @@ -336,7 +413,9 @@ Returns the normalized longest axis of the **AABB**. :ref:`int` **get_longest_axis_index** **(** **)** |const| -Returns the index of the longest axis of the **AABB** (according to :ref:`Vector3`'s ``AXIS_*`` constants). +Returns the index to the longest axis of this bounding box's :ref:`size` (see :ref:`Vector3.AXIS_X`, :ref:`Vector3.AXIS_Y`, and :ref:`Vector3.AXIS_Z`). + +For an example, see :ref:`get_longest_axis`. .. rst-class:: classref-item-separator @@ -348,7 +427,9 @@ Returns the index of the longest axis of the **AABB** (according to :ref:`Vector :ref:`float` **get_longest_axis_size** **(** **)** |const| -Returns the scalar length of the longest axis of the **AABB**. +Returns the longest dimension of this bounding box's :ref:`size`. + +For an example, see :ref:`get_longest_axis`. .. rst-class:: classref-item-separator @@ -360,7 +441,30 @@ Returns the scalar length of the longest axis of the **AABB**. :ref:`Vector3` **get_shortest_axis** **(** **)** |const| -Returns the normalized shortest axis of the **AABB**. +Returns the shortest normaalized axis of this bounding box's :ref:`size`, as a :ref:`Vector3` (:ref:`Vector3.RIGHT`, :ref:`Vector3.UP`, or :ref:`Vector3.BACK`). + + +.. tabs:: + + .. code-tab:: gdscript + + var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8)) + + print(box.get_shortest_axis()) # Prints (1, 0, 0) + print(box.get_shortest_axis_index()) # Prints 0 + print(box.get_shortest_axis_size()) # Prints 2 + + .. code-tab:: csharp + + var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8)); + + GD.Print(box.GetShortestAxis()); // Prints (1, 0, 0) + GD.Print(box.GetShortestAxisIndex()); // Prints 0 + GD.Print(box.GetShortestAxisSize()); // Prints 2 + + + +See also :ref:`get_shortest_axis_index` and :ref:`get_shortest_axis_size`. .. rst-class:: classref-item-separator @@ -372,7 +476,9 @@ Returns the normalized shortest axis of the **AABB**. :ref:`int` **get_shortest_axis_index** **(** **)** |const| -Returns the index of the shortest axis of the **AABB** (according to :ref:`Vector3`::AXIS\* enum). +Returns the index to the shortest axis of this bounding box's :ref:`size` (see :ref:`Vector3.AXIS_X`, :ref:`Vector3.AXIS_Y`, and :ref:`Vector3.AXIS_Z`). + +For an example, see :ref:`get_shortest_axis`. .. rst-class:: classref-item-separator @@ -384,7 +490,9 @@ Returns the index of the shortest axis of the **AABB** (according to :ref:`Vecto :ref:`float` **get_shortest_axis_size** **(** **)** |const| -Returns the scalar length of the shortest axis of the **AABB**. +Returns the shortest dimension of this bounding box's :ref:`size`. + +For an example, see :ref:`get_shortest_axis`. .. rst-class:: classref-item-separator @@ -396,7 +504,7 @@ Returns the scalar length of the shortest axis of the **AABB**. :ref:`Vector3` **get_support** **(** :ref:`Vector3` dir **)** |const| -Returns the vertex of the AABB that's the farthest in a given direction. This point is commonly known as the support point in collision detection algorithms. +Returns the vertex's position of this bounding box that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms. .. rst-class:: classref-item-separator @@ -408,7 +516,7 @@ Returns the vertex of the AABB that's the farthest in a given direction. This po :ref:`float` **get_volume** **(** **)** |const| -Returns the volume of the **AABB**. +Returns the bounding box's volume. This is equivalent to ``size.x * size.y * size.z``. See also :ref:`has_volume`. .. rst-class:: classref-item-separator @@ -420,7 +528,32 @@ Returns the volume of the **AABB**. :ref:`AABB` **grow** **(** :ref:`float` by **)** |const| -Returns a copy of the **AABB** grown a given number of units towards all the sides. +Returns a copy of this bounding box extended on all sides by the given amount ``by``. A negative amount shrinks the box instead. + + +.. tabs:: + + .. code-tab:: gdscript + + var a = AABB(Vector3(4, 4, 4), Vector3(8, 8, 8)).grow(4) + print(a.position) # Prints (0, 0, 0) + print(a.size) # Prints (16, 16, 16) + + var b = AABB(Vector3(0, 0, 0), Vector3(8, 4, 2)).grow(2) + print(b.position) # Prints (-2, -2, -2) + print(b.size) # Prints (12, 8, 6) + + .. code-tab:: csharp + + var a = new Aabb(new Vector3(4, 4, 4), new Vector3(8, 8, 8)).Grow(4); + GD.Print(a.Position); // Prints (0, 0, 0) + GD.Print(a.Size); // Prints (16, 16, 16) + + var b = new Aabb(new Vector3(0, 0, 0), new Vector3(8, 4, 2)).Grow(2); + GD.Print(b.Position); // Prints (-2, -2, -2) + GD.Print(b.Size); // Prints (12, 8, 6) + + .. rst-class:: classref-item-separator @@ -432,9 +565,9 @@ Returns a copy of the **AABB** grown a given number of units towards all the sid :ref:`bool` **has_point** **(** :ref:`Vector3` point **)** |const| -Returns ``true`` if the **AABB** contains a point. Points on the faces of the AABB are considered included, though float-point precision errors may impact the accuracy of such checks. +Returns ``true`` if the bounding box contains the given ``point``. By convention, points exactly on the right, top, and front sides are **not** included. -\ **Note:** This method is not reliable for **AABB** with a *negative size*. Use :ref:`abs` to get a positive sized equivalent **AABB** to check for contained points. +\ **Note:** This method is not reliable for **AABB** with a *negative* :ref:`size`. Use :ref:`abs` first to get a valid bounding box. .. rst-class:: classref-item-separator @@ -446,7 +579,7 @@ Returns ``true`` if the **AABB** contains a point. Points on the faces of the AA :ref:`bool` **has_surface** **(** **)** |const| -Returns ``true`` if the **AABB** has a surface or a length, and ``false`` if the **AABB** is empty (all components of :ref:`size` are zero or negative). +Returns ``true`` if this bounding box has a surface or a length, that is, at least one component of :ref:`size` is greater than ``0``. Otherwise, returns ``false``. .. rst-class:: classref-item-separator @@ -458,7 +591,7 @@ Returns ``true`` if the **AABB** has a surface or a length, and ``false`` if the :ref:`bool` **has_volume** **(** **)** |const| -Returns ``true`` if the **AABB** has a volume, and ``false`` if the **AABB** is flat, empty, or has a negative :ref:`size`. +Returns ``true`` if this bounding box's width, height, and depth are all positive. See also :ref:`get_volume`. .. rst-class:: classref-item-separator @@ -470,7 +603,32 @@ Returns ``true`` if the **AABB** has a volume, and ``false`` if the **AABB** is :ref:`AABB` **intersection** **(** :ref:`AABB` with **)** |const| -Returns the intersection between two **AABB**. An empty AABB (size ``(0, 0, 0)``) is returned on failure. +Returns the intersection between this bounding box and ``with``. If the boxes do not intersect, returns an empty **AABB**. If the boxes intersect at the edge, returns a flat **AABB** with no volume (see :ref:`has_surface` and :ref:`has_volume`). + + +.. tabs:: + + .. code-tab:: gdscript + + var box1 = AABB(Vector3(0, 0, 0), Vector3(5, 2, 8)) + var box2 = AABB(Vector3(2, 0, 2), Vector3(8, 4, 4)) + + var intersection = box1.intersection(box2) + print(intersection.position) # Prints (2, 0, 2) + print(intersection.size) # Prints (3, 2, 4) + + .. code-tab:: csharp + + var box1 = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 8)); + var box2 = new Aabb(new Vector3(2, 0, 2), new Vector3(8, 4, 4)); + + var intersection = box1.Intersection(box2); + GD.Print(intersection.Position); // Prints (2, 0, 2) + GD.Print(intersection.Size); // Prints (3, 2, 4) + + + +\ **Note:** If you only need to know whether two bounding boxes are intersecting, use :ref:`intersects`, instead. .. rst-class:: classref-item-separator @@ -482,7 +640,7 @@ Returns the intersection between two **AABB**. An empty AABB (size ``(0, 0, 0)`` :ref:`bool` **intersects** **(** :ref:`AABB` with **)** |const| -Returns ``true`` if the **AABB** overlaps with another. +Returns ``true`` if this bounding box overlaps with the box ``with``. The edges of both boxes are *always* excluded. .. rst-class:: classref-item-separator @@ -494,7 +652,7 @@ Returns ``true`` if the **AABB** overlaps with another. :ref:`bool` **intersects_plane** **(** :ref:`Plane` plane **)** |const| -Returns ``true`` if the **AABB** is on both sides of a plane. +Returns ``true`` if this bounding box is on both sides of the given ``plane``. .. rst-class:: classref-item-separator @@ -506,7 +664,9 @@ Returns ``true`` if the **AABB** is on both sides of a plane. :ref:`Variant` **intersects_ray** **(** :ref:`Vector3` from, :ref:`Vector3` dir **)** |const| -Returns the point of intersection of the given ray with this **AABB** or ``null`` if there is no intersection. Ray length is infinite. +Returns the first point where this bounding box and the given ray intersect, as a :ref:`Vector3`. If no intersection occurs, returns ``null``. + +The ray begin at ``from``, faces ``dir`` and extends towards infinity. .. rst-class:: classref-item-separator @@ -518,7 +678,9 @@ Returns the point of intersection of the given ray with this **AABB** or ``null` :ref:`Variant` **intersects_segment** **(** :ref:`Vector3` from, :ref:`Vector3` to **)** |const| -Returns the point of intersection between ``from`` and ``to`` with this **AABB** or ``null`` if there is no intersection. +Returns the first point where this bounding box and the given segment intersect, as a :ref:`Vector3`. If no intersection occurs, returns ``null``. + +The segment begins at ``from`` and ends at ``to``. .. rst-class:: classref-item-separator @@ -530,7 +692,7 @@ Returns the point of intersection between ``from`` and ``to`` with this **AABB** :ref:`bool` **is_equal_approx** **(** :ref:`AABB` aabb **)** |const| -Returns ``true`` if this **AABB** and ``aabb`` are approximately equal, by calling :ref:`@GlobalScope.is_equal_approx` on each component. +Returns ``true`` if this bounding box and ``aabb`` are approximately equal, by calling :ref:`Vector2.is_equal_approx` on the :ref:`position` and the :ref:`size`. .. rst-class:: classref-item-separator @@ -542,7 +704,7 @@ Returns ``true`` if this **AABB** and ``aabb`` are approximately equal, by calli :ref:`bool` **is_finite** **(** **)** |const| -Returns ``true`` if this **AABB** is finite, by calling :ref:`@GlobalScope.is_finite` on each component. +Returns ``true`` if this bounding box's values are finite, by calling :ref:`Vector2.is_finite` on the :ref:`position` and the :ref:`size`. .. rst-class:: classref-item-separator @@ -554,7 +716,7 @@ Returns ``true`` if this **AABB** is finite, by calling :ref:`@GlobalScope.is_fi :ref:`AABB` **merge** **(** :ref:`AABB` with **)** |const| -Returns a larger **AABB** that contains both this **AABB** and ``with``. +Returns an **AABB** that encloses both this bounding box and ``with`` around the edges. See also :ref:`encloses`. .. rst-class:: classref-section-separator @@ -571,7 +733,7 @@ Operator Descriptions :ref:`bool` **operator !=** **(** :ref:`AABB` right **)** -Returns ``true`` if the AABBs are not equal. +Returns ``true`` if the :ref:`position` or :ref:`size` of both bounding boxes are not equal. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. @@ -601,7 +763,7 @@ For transforming by inverse of an affine transformation (e.g. with scaling) ``tr :ref:`bool` **operator ==** **(** :ref:`AABB` right **)** -Returns ``true`` if the AABBs are exactly equal. +Returns ``true`` if both :ref:`position` and :ref:`size` of the bounding boxes are exactly equal, respectively. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx` instead, which is more reliable. diff --git a/classes/class_animatedsprite2d.rst b/classes/class_animatedsprite2d.rst index 14694f60e1b..6c98c61599f 100644 --- a/classes/class_animatedsprite2d.rst +++ b/classes/class_animatedsprite2d.rst @@ -113,6 +113,8 @@ Emitted when :ref:`animation` changes Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback. +\ **Note:** This signal is not emitted if an animation is looping. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_animatedsprite3d.rst b/classes/class_animatedsprite3d.rst index 00d764ef917..d2c3b682b7a 100644 --- a/classes/class_animatedsprite3d.rst +++ b/classes/class_animatedsprite3d.rst @@ -103,6 +103,8 @@ Emitted when :ref:`animation` changes Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback. +\ **Note:** This signal is not emitted if an animation is looping. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_animation.rst b/classes/class_animation.rst index 2f8b3fc1ad5..66451de005b 100644 --- a/classes/class_animation.rst +++ b/classes/class_animation.rst @@ -27,22 +27,24 @@ This resource holds data that can be used to animate anything in the engine. Ani .. code-tab:: gdscript # This creates an animation that makes the node "Enemy" move to the right by - # 100 pixels in 0.5 seconds. + # 100 pixels in 2.0 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) + animation.track_insert_key(track_index, 2.0, 100) + animation.length = 2.0 .. code-tab:: csharp // This creates an animation that makes the node "Enemy" move to the right by - // 100 pixels in 0.5 seconds. + // 100 pixels in 2.0 seconds. var animation = new Animation(); int trackIndex = animation.AddTrack(Animation.TrackType.Value); animation.TrackSetPath(trackIndex, "Enemy:position:x"); animation.TrackInsertKey(trackIndex, 0.0f, 0); - animation.TrackInsertKey(trackIndex, 0.5f, 100); + animation.TrackInsertKey(trackIndex, 2.0f, 100); + animation.Length = 2.0f; diff --git a/classes/class_animationmixer.rst b/classes/class_animationmixer.rst index 6cfc7d39f55..08fcd22daa1 100644 --- a/classes/class_animationmixer.rst +++ b/classes/class_animationmixer.rst @@ -59,47 +59,47 @@ Methods .. table:: :widths: auto - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant` | :ref:`_post_process_key_value` **(** :ref:`Animation` animation, :ref:`int` track, :ref:`Variant` value, :ref:`Object` object, :ref:`int` object_idx **)** |virtual| |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`add_animation_library` **(** :ref:`StringName` name, :ref:`AnimationLibrary` library **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`advance` **(** :ref:`float` delta **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`clear_caches` **(** **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`StringName` | :ref:`find_animation` **(** :ref:`Animation` animation **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`StringName` | :ref:`find_animation_library` **(** :ref:`Animation` animation **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Animation` | :ref:`get_animation` **(** :ref:`StringName` name **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`AnimationLibrary` | :ref:`get_animation_library` **(** :ref:`StringName` name **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`StringName[]` | :ref:`get_animation_library_list` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_animation_list` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector3` | :ref:`get_root_motion_position` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector3` | :ref:`get_root_motion_position_accumulator` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Quaternion` | :ref:`get_root_motion_rotation` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Quaternion` | :ref:`get_root_motion_rotation_accumulator` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector3` | :ref:`get_root_motion_scale` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector3` | :ref:`get_root_motion_scale_accumulator` **(** **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`has_animation` **(** :ref:`StringName` name **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`has_animation_library` **(** :ref:`StringName` name **)** |const| | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`remove_animation_library` **(** :ref:`StringName` name **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`rename_animation_library` **(** :ref:`StringName` name, :ref:`StringName` newname **)** | - +---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`_post_process_key_value` **(** :ref:`Animation` animation, :ref:`int` track, :ref:`Variant` value, :ref:`int` object_id, :ref:`int` object_sub_idx **)** |virtual| |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`add_animation_library` **(** :ref:`StringName` name, :ref:`AnimationLibrary` library **)** | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`advance` **(** :ref:`float` delta **)** | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`clear_caches` **(** **)** | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`find_animation` **(** :ref:`Animation` animation **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`find_animation_library` **(** :ref:`Animation` animation **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Animation` | :ref:`get_animation` **(** :ref:`StringName` name **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AnimationLibrary` | :ref:`get_animation_library` **(** :ref:`StringName` name **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName[]` | :ref:`get_animation_library_list` **(** **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_animation_list` **(** **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`get_root_motion_position` **(** **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`get_root_motion_position_accumulator` **(** **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Quaternion` | :ref:`get_root_motion_rotation` **(** **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Quaternion` | :ref:`get_root_motion_rotation_accumulator` **(** **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`get_root_motion_scale` **(** **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`get_root_motion_scale_accumulator` **(** **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_animation` **(** :ref:`StringName` name **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_animation_library` **(** :ref:`StringName` name **)** |const| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_animation_library` **(** :ref:`StringName` name **)** | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`rename_animation_library` **(** :ref:`StringName` name, :ref:`StringName` newname **)** | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -415,9 +415,9 @@ Method Descriptions .. rst-class:: classref-method -:ref:`Variant` **_post_process_key_value** **(** :ref:`Animation` animation, :ref:`int` track, :ref:`Variant` value, :ref:`Object` object, :ref:`int` object_idx **)** |virtual| |const| +:ref:`Variant` **_post_process_key_value** **(** :ref:`Animation` animation, :ref:`int` track, :ref:`Variant` value, :ref:`int` object_id, :ref:`int` object_sub_idx **)** |virtual| |const| -A virtual function for processing after key getting during playback. +A virtual function for processing after getting a key during playback. .. rst-class:: classref-item-separator diff --git a/classes/class_animationnodestatemachine.rst b/classes/class_animationnodestatemachine.rst index dc2acc3a16d..db0a8ed66b4 100644 --- a/classes/class_animationnodestatemachine.rst +++ b/classes/class_animationnodestatemachine.rst @@ -146,7 +146,7 @@ Seeking to the beginning is treated as seeking to the beginning of the animation :ref:`StateMachineType` **STATE_MACHINE_TYPE_GROUPED** = ``2`` -This is a grouped state machine that can be controlled from a parent state machine. It does not work on standalone. There must be a state machine with :ref:`state_machine_type` of :ref:`STATE_MACHINE_TYPE_ROOT` or :ref:`STATE_MACHINE_TYPE_NESTED` in the parent or ancestor. +This is a grouped state machine that can be controlled from a parent state machine. It does not work independently. There must be a state machine with :ref:`state_machine_type` of :ref:`STATE_MACHINE_TYPE_ROOT` or :ref:`STATE_MACHINE_TYPE_NESTED` in the parent or ancestor. .. rst-class:: classref-section-separator @@ -413,9 +413,7 @@ Renames the given animation node. void **replace_node** **(** :ref:`StringName` name, :ref:`AnimationNode` node **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Replaces the given animation node with a new animation node. .. rst-class:: classref-item-separator diff --git a/classes/class_area2d.rst b/classes/class_area2d.rst index 1a3594d0430..ced6547a658 100644 --- a/classes/class_area2d.rst +++ b/classes/class_area2d.rst @@ -23,6 +23,8 @@ Description This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses. +\ **Note:** Areas and bodies created with :ref:`PhysicsServer2D` might not interact as expected with **Area2D**\ s, and might not emit signals or track objects correctly. + .. rst-class:: classref-introduction-group Tutorials diff --git a/classes/class_area3d.rst b/classes/class_area3d.rst index 9608cf0240d..7e185b2139e 100644 --- a/classes/class_area3d.rst +++ b/classes/class_area3d.rst @@ -23,6 +23,8 @@ Description This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses. +\ **Note:** Areas and bodies created with :ref:`PhysicsServer3D` might not interact as expected with **Area3D**\ s, and might not emit signals or track objects correctly. + \ **Warning:** Using a :ref:`ConcavePolygonShape3D` inside a :ref:`CollisionShape3D` child of this node (created e.g. by using the **Create Trimesh Collision Sibling** option in the **Mesh** menu that appears when selecting a :ref:`MeshInstance3D` node) may give unexpected results, since this collision shape is hollow. If this is not desired, it has to be split into multiple :ref:`ConvexPolygonShape3D`\ s or primitive shapes like :ref:`BoxShape3D`, or in some cases it may be replaceable by a :ref:`CollisionPolygon3D`. .. rst-class:: classref-introduction-group diff --git a/classes/class_array.rst b/classes/class_array.rst index dd4e7fceae5..1664ee4a829 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -936,7 +936,7 @@ Returns a random value from the target array. Prints an error and returns ``null :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. +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 unchanged 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. @@ -1047,6 +1047,8 @@ Removes an element from the array by index. If the index does not exist in the a 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``. Returns :ref:`@GlobalScope.OK` on success, or one of the other :ref:`Error` values if the operation failed. +Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. + \ **Note:** This method acts in-place and doesn't return a modified array. .. rst-class:: classref-item-separator diff --git a/classes/class_astargrid2d.rst b/classes/class_astargrid2d.rst index ccd712b40c9..81f62ecb279 100644 --- a/classes/class_astargrid2d.rst +++ b/classes/class_astargrid2d.rst @@ -56,6 +56,8 @@ Properties .. table:: :widths: auto + +----------------------------------------------------+------------------------------------------------------------------------------------------+------------------------+ + | :ref:`CellShape` | :ref:`cell_shape` | ``0`` | +----------------------------------------------------+------------------------------------------------------------------------------------------+------------------------+ | :ref:`Vector2` | :ref:`cell_size` | ``Vector2(1, 1)`` | +----------------------------------------------------+------------------------------------------------------------------------------------------+------------------------+ @@ -250,6 +252,48 @@ The pathfinding algorithm will avoid using diagonals if any obstacle has been pl Represents the size of the :ref:`DiagonalMode` enum. +.. rst-class:: classref-item-separator + +---- + +.. _enum_AStarGrid2D_CellShape: + +.. rst-class:: classref-enumeration + +enum **CellShape**: + +.. _class_AStarGrid2D_constant_CELL_SHAPE_SQUARE: + +.. rst-class:: classref-enumeration-constant + +:ref:`CellShape` **CELL_SHAPE_SQUARE** = ``0`` + +Rectangular cell shape. + +.. _class_AStarGrid2D_constant_CELL_SHAPE_ISOMETRIC_RIGHT: + +.. rst-class:: classref-enumeration-constant + +:ref:`CellShape` **CELL_SHAPE_ISOMETRIC_RIGHT** = ``1`` + +Diamond cell shape (for isometric look). Cell coordinates layout where the horizontal axis goes up-right, and the vertical one goes down-right. + +.. _class_AStarGrid2D_constant_CELL_SHAPE_ISOMETRIC_DOWN: + +.. rst-class:: classref-enumeration-constant + +:ref:`CellShape` **CELL_SHAPE_ISOMETRIC_DOWN** = ``2`` + +Diamond cell shape (for isometric look). Cell coordinates layout where the horizontal axis goes down-right, and the vertical one goes down-left. + +.. _class_AStarGrid2D_constant_CELL_SHAPE_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`CellShape` **CELL_SHAPE_MAX** = ``3`` + +Represents the size of the :ref:`CellShape` enum. + .. rst-class:: classref-section-separator ---- @@ -259,6 +303,23 @@ Represents the size of the :ref:`DiagonalMode` en Property Descriptions --------------------- +.. _class_AStarGrid2D_property_cell_shape: + +.. rst-class:: classref-property + +:ref:`CellShape` **cell_shape** = ``0`` + +.. rst-class:: classref-property-setget + +- void **set_cell_shape** **(** :ref:`CellShape` value **)** +- :ref:`CellShape` **get_cell_shape** **(** **)** + +The cell shape. Affects how the positions are placed in the grid. If changed, :ref:`update` needs to be called before finding the next path. + +.. rst-class:: classref-item-separator + +---- + .. _class_AStarGrid2D_property_cell_size: .. rst-class:: classref-property diff --git a/classes/class_audioeffect.rst b/classes/class_audioeffect.rst index 1a8812c6124..4d092c7d33f 100644 --- a/classes/class_audioeffect.rst +++ b/classes/class_audioeffect.rst @@ -14,20 +14,24 @@ AudioEffect **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. +Base class for audio effect resources. .. rst-class:: classref-introduction-group Description ----------- -Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on. +The base :ref:`Resource` for every audio effect. In the editor, an audio effect can be added to the current bus layout through the Audio panel. At run-time, it is also possible to manipulate audio effects through :ref:`AudioServer.add_bus_effect`, :ref:`AudioServer.remove_bus_effect`, and :ref:`AudioServer.get_bus_effect`. + +When applied on a bus, an audio effect creates a corresponding :ref:`AudioEffectInstance`. The instance is directly responsible for manipulating the sound, based on the original audio effect's properties. .. rst-class:: classref-introduction-group Tutorials --------- +- :doc:`Audio buses <../tutorials/audio/audio_buses>` + - `Audio Mic Record Demo `__ .. rst-class:: classref-reftable-group @@ -57,9 +61,21 @@ Method Descriptions :ref:`AudioEffectInstance` **_instantiate** **(** **)** |virtual| -.. container:: contribute +Override this method to customize the :ref:`AudioEffectInstance` created when this effect is applied on a bus in the editor's Audio panel, or through :ref:`AudioServer.add_bus_effect`. + +:: + + extends AudioEffect + + @export var strength = 4.0 + + func _instantiate(): + var effect = CustomAudioEffectInstance.new() + effect.base = self + + return effect - There is currently no description for this method. Please help us by :ref:`contributing one `! +\ **Note:** It is recommended to keep a reference to the original **AudioEffect** in the new instance. Depending on the implementation this allows the effect instance to listen for changes at run-time and be modified accordingly. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_audioeffectcapture.rst b/classes/class_audioeffectcapture.rst index 5fbea618514..94349815bf3 100644 --- a/classes/class_audioeffectcapture.rst +++ b/classes/class_audioeffectcapture.rst @@ -23,7 +23,7 @@ AudioEffectCapture is an AudioEffect which copies all audio frames from the atta 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 an :ref:`AudioStreamMicrophone`, implement application-defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating point PCM. -\ **Note:** :ref:`ProjectSettings.audio/driver/enable_input` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. +Unlike :ref:`AudioEffectRecord`, this effect only returns the raw audio samples instead of encoding them into an :ref:`AudioStream`. .. rst-class:: classref-introduction-group @@ -32,8 +32,6 @@ Tutorials - :doc:`Audio buses <../tutorials/audio/audio_buses>` -- `Audio Mic Record Demo `__ - .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_audioeffectdistortion.rst b/classes/class_audioeffectdistortion.rst index e91d8fef5a3..9357e44a668 100644 --- a/classes/class_audioeffectdistortion.rst +++ b/classes/class_audioeffectdistortion.rst @@ -81,6 +81,10 @@ Digital distortion effect which cuts off peaks at the top and bottom of the wave :ref:`Mode` **MODE_ATAN** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_AudioEffectDistortion_constant_MODE_LOFI: diff --git a/classes/class_audioeffectfilter.rst b/classes/class_audioeffectfilter.rst index 0e92c34a8f4..5dc6147180a 100644 --- a/classes/class_audioeffectfilter.rst +++ b/classes/class_audioeffectfilter.rst @@ -69,6 +69,10 @@ enum **FilterDB**: :ref:`FilterDB` **FILTER_6DB** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_AudioEffectFilter_constant_FILTER_12DB: @@ -77,6 +81,10 @@ enum **FilterDB**: :ref:`FilterDB` **FILTER_12DB** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_AudioEffectFilter_constant_FILTER_18DB: @@ -85,6 +93,10 @@ enum **FilterDB**: :ref:`FilterDB` **FILTER_18DB** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_AudioEffectFilter_constant_FILTER_24DB: @@ -93,6 +105,10 @@ enum **FilterDB**: :ref:`FilterDB` **FILTER_24DB** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator diff --git a/classes/class_audioeffectinstance.rst b/classes/class_audioeffectinstance.rst index 8ab1a42f4b6..bf872a656f4 100644 --- a/classes/class_audioeffectinstance.rst +++ b/classes/class_audioeffectinstance.rst @@ -14,9 +14,21 @@ AudioEffectInstance **Inherited By:** :ref:`AudioEffectSpectrumAnalyzerInstance` -.. container:: contribute +Manipulates the audio it receives for a given effect. - There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Description +----------- + +An audio effect instance manipulates the audio it receives for a given effect. This instance is automatically created by an :ref:`AudioEffect` when it is added to a bus, and should usually not be created directly. If necessary, it can be fetched at run-time with :ref:`AudioServer.get_bus_effect_instance`. + +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Audio buses <../tutorials/audio/audio_buses>` .. rst-class:: classref-reftable-group @@ -47,9 +59,9 @@ Method Descriptions void **_process** **(** const void* src_buffer, AudioFrame* dst_buffer, :ref:`int` frame_count **)** |virtual| -.. container:: contribute +Called by the :ref:`AudioServer` to process this effect. When :ref:`_process_silence` is not overridden or it returns ``false``, this method is called only when the bus is active. - There is currently no description for this method. Please help us by :ref:`contributing one `! +\ **Note:** It is not useful to override this method in GDScript or C#. Only GDExtension can take advantage of it. .. rst-class:: classref-item-separator @@ -61,9 +73,9 @@ void **_process** **(** const void* src_buffer, AudioFrame* dst_buffer, :ref:`in :ref:`bool` **_process_silence** **(** **)** |virtual| |const| -.. container:: contribute +Override this method to customize the processing behavior of this effect instance. - There is currently no description for this method. Please help us by :ref:`contributing one `! +Should return ``true`` to force the :ref:`AudioServer` to always call :ref:`_process`, even if the bus has been muted or cannot otherwise be heard. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_audioeffectpitchshift.rst b/classes/class_audioeffectpitchshift.rst index cc851533213..9f19f180cf7 100644 --- a/classes/class_audioeffectpitchshift.rst +++ b/classes/class_audioeffectpitchshift.rst @@ -163,7 +163,7 @@ The oversampling factor to use. Higher values result in better quality, but are - void **set_pitch_scale** **(** :ref:`float` value **)** - :ref:`float` **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). +The pitch scale to use. ``1.0`` is the default pitch and plays sounds unaffected. :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.)` diff --git a/classes/class_audioeffectrecord.rst b/classes/class_audioeffectrecord.rst index 5b9c5aa2547..b8dfb528920 100644 --- a/classes/class_audioeffectrecord.rst +++ b/classes/class_audioeffectrecord.rst @@ -19,11 +19,13 @@ 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. +Allows the user to record the sound from an audio bus into an :ref:`AudioStreamWAV`. When used on the "Master" audio bus, this includes all audio output by Godot. + +Unlike :ref:`AudioEffectCapture`, this effect encodes the recording with the given format (8-bit, 16-bit, or compressed) instead of giving access to the raw audio samples. 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. +\ **Note:** :ref:`ProjectSettings.audio/driver/enable_input` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. .. rst-class:: classref-introduction-group diff --git a/classes/class_audioserver.rst b/classes/class_audioserver.rst index 2aa1c5e2564..b379ba4e6a7 100644 --- a/classes/class_audioserver.rst +++ b/classes/class_audioserver.rst @@ -289,7 +289,7 @@ Name of the current device for audio output (see :ref:`get_output_device_list` value **)** - :ref:`float` **get_playback_speed_scale** **(** **)** -Scales the rate at which audio is played (i.e. setting it to ``0.5`` will make the audio be played at half its speed). +Scales the rate at which audio is played (i.e. setting it to ``0.5`` will make the audio be played at half its speed). See also :ref:`Engine.time_scale` to affect the general simulation speed, which is independent from :ref:`playback_speed_scale`. .. rst-class:: classref-section-separator diff --git a/classes/class_audiostream.rst b/classes/class_audiostream.rst index 6b199a0dae7..02ac570840d 100644 --- a/classes/class_audiostream.rst +++ b/classes/class_audiostream.rst @@ -51,6 +51,8 @@ Methods +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`_get_length` **(** **)** |virtual| |const| | +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ + | :ref:`Dictionary[]` | :ref:`_get_parameter_list` **(** **)** |virtual| |const| | + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`_get_stream_name` **(** **)** |virtual| |const| | +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | :ref:`AudioStreamPlayback` | :ref:`_instantiate_playback` **(** **)** |virtual| |const| | @@ -70,6 +72,23 @@ Methods .. rst-class:: classref-descriptions-group +Signals +------- + +.. _class_AudioStream_signal_parameter_list_changed: + +.. rst-class:: classref-signal + +**parameter_list_changed** **(** **)** + +Signal to be emitted to notify when the parameter list changed. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + Method Descriptions ------------------- @@ -115,6 +134,18 @@ Method Descriptions ---- +.. _class_AudioStream_private_method__get_parameter_list: + +.. rst-class:: classref-method + +:ref:`Dictionary[]` **_get_parameter_list** **(** **)** |virtual| |const| + +Return the controllable parameters of this stream. This array contains dictionaries with a property info description format (see :ref:`Object.get_property_list`). Additionally, the default value for this parameter must be added tho each dictionary in "default_value" field. + +.. rst-class:: classref-item-separator + +---- + .. _class_AudioStream_private_method__get_stream_name: .. rst-class:: classref-method diff --git a/classes/class_audiostreamoggvorbis.rst b/classes/class_audiostreamoggvorbis.rst index 6ac49232c7c..a8ddb0a83fb 100644 --- a/classes/class_audiostreamoggvorbis.rst +++ b/classes/class_audiostreamoggvorbis.rst @@ -21,6 +21,13 @@ Description The AudioStreamOggVorbis class is a specialized :ref:`AudioStream` for handling Ogg Vorbis file formats. It offers functionality for loading and playing back Ogg Vorbis files, as well as managing looping and other playback properties. This class is part of the audio stream system, which also supports WAV files through the :ref:`AudioStreamWAV` class. +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_audiostreamplayback.rst b/classes/class_audiostreamplayback.rst index eb0ea705974..874a6435826 100644 --- a/classes/class_audiostreamplayback.rst +++ b/classes/class_audiostreamplayback.rst @@ -38,23 +38,27 @@ Methods .. table:: :widths: auto - +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`_get_loop_count` **(** **)** |virtual| |const| | - +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`_get_playback_position` **(** **)** |virtual| |const| | - +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`_is_playing` **(** **)** |virtual| |const| | - +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`_mix` **(** AudioFrame* buffer, :ref:`float` rate_scale, :ref:`int` frames **)** |virtual| | - +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_seek` **(** :ref:`float` position **)** |virtual| | - +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_start` **(** :ref:`float` from_pos **)** |virtual| | - +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_stop` **(** **)** |virtual| | - +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_tag_used_streams` **(** **)** |virtual| | - +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`_get_loop_count` **(** **)** |virtual| |const| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`_get_parameter` **(** :ref:`StringName` name **)** |virtual| |const| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`_get_playback_position` **(** **)** |virtual| |const| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`_is_playing` **(** **)** |virtual| |const| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`_mix` **(** AudioFrame* buffer, :ref:`float` rate_scale, :ref:`int` frames **)** |virtual| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_seek` **(** :ref:`float` position **)** |virtual| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_set_parameter` **(** :ref:`StringName` name, :ref:`Variant` value **)** |virtual| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_start` **(** :ref:`float` from_pos **)** |virtual| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_stop` **(** **)** |virtual| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_tag_used_streams` **(** **)** |virtual| | + +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -79,6 +83,18 @@ Method Descriptions ---- +.. _class_AudioStreamPlayback_private_method__get_parameter: + +.. rst-class:: classref-method + +:ref:`Variant` **_get_parameter** **(** :ref:`StringName` name **)** |virtual| |const| + +Return the current value of a playback parameter by name (see :ref:`AudioStream._get_parameter_list`). + +.. rst-class:: classref-item-separator + +---- + .. _class_AudioStreamPlayback_private_method__get_playback_position: .. rst-class:: classref-method @@ -135,6 +151,18 @@ void **_seek** **(** :ref:`float` position **)** |virtual| ---- +.. _class_AudioStreamPlayback_private_method__set_parameter: + +.. rst-class:: classref-method + +void **_set_parameter** **(** :ref:`StringName` name, :ref:`Variant` value **)** |virtual| + +Set the current value of a playback parameter by name (see :ref:`AudioStream._get_parameter_list`). + +.. rst-class:: classref-item-separator + +---- + .. _class_AudioStreamPlayback_private_method__start: .. rst-class:: classref-method diff --git a/classes/class_audiostreamwav.rst b/classes/class_audiostreamwav.rst index c5e0d123399..1e72eeb5eb8 100644 --- a/classes/class_audiostreamwav.rst +++ b/classes/class_audiostreamwav.rst @@ -23,6 +23,13 @@ AudioStreamWAV stores sound samples loaded from WAV files. To play the stored so This class can also be used to store dynamically-generated PCM audio data. See also :ref:`AudioStreamGenerator` for procedural audio generation. +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_basematerial3d.rst b/classes/class_basematerial3d.rst index 4b5dfbecfa8..5de49da36e3 100644 --- a/classes/class_basematerial3d.rst +++ b/classes/class_basematerial3d.rst @@ -479,7 +479,7 @@ enum **TextureFilter**: :ref:`TextureFilter` **TEXTURE_FILTER_NEAREST** = ``0`` -The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. +The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_BaseMaterial3D_constant_TEXTURE_FILTER_LINEAR: @@ -487,7 +487,7 @@ The texture filter reads from the nearest pixel only. The simplest and fastest m :ref:`TextureFilter` **TEXTURE_FILTER_LINEAR** = ``1`` -The texture filter blends between the nearest 4 pixels. Use this when you want to avoid a pixelated style, but do not want mipmaps. +The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_BaseMaterial3D_constant_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: @@ -495,7 +495,7 @@ The texture filter blends between the nearest 4 pixels. Use this when you want t :ref:`TextureFilter` **TEXTURE_FILTER_NEAREST_WITH_MIPMAPS** = ``2`` -The texture filter reads from the nearest pixel in the nearest mipmap. The fastest way to read from textures with mipmaps. +The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look pixelated from up close, and smooth from a distance. .. _class_BaseMaterial3D_constant_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: @@ -503,7 +503,7 @@ The texture filter reads from the nearest pixel in the nearest mipmap. The faste :ref:`TextureFilter` **TEXTURE_FILTER_LINEAR_WITH_MIPMAPS** = ``3`` -The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for most cases as mipmaps are important to smooth out pixels that are far from the camera. +The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look smooth from up close, and smooth from a distance. .. _class_BaseMaterial3D_constant_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC: @@ -511,7 +511,7 @@ The texture filter blends between the nearest 4 pixels and between the nearest 2 :ref:`TextureFilter` **TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC** = ``4`` -The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. +The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. .. _class_BaseMaterial3D_constant_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: @@ -519,7 +519,7 @@ The texture filter reads from the nearest pixel, but selects a mipmap based on t :ref:`TextureFilter` **TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC** = ``5`` -The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. +The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. .. _class_BaseMaterial3D_constant_TEXTURE_FILTER_MAX: @@ -3108,7 +3108,7 @@ If ``true``, enables subsurface scattering transmittance. Only effective if :ref - void **set_texture** **(** :ref:`TextureParam` param, :ref:`Texture2D` texture **)** - :ref:`Texture2D` **get_texture** **(** :ref:`TextureParam` param **)** |const| -The texture to use for multiplying the intensity of the subsurface scattering transmitteance intensity. See also :ref:`subsurf_scatter_texture`. Ignored if :ref:`subsurf_scatter_skin_mode` is ``true``. +The texture to use for multiplying the intensity of the subsurface scattering transmittance intensity. See also :ref:`subsurf_scatter_texture`. Ignored if :ref:`subsurf_scatter_skin_mode` is ``true``. .. rst-class:: classref-item-separator diff --git a/classes/class_basis.rst b/classes/class_basis.rst index 8a64d822124..7b6246485bb 100644 --- a/classes/class_basis.rst +++ b/classes/class_basis.rst @@ -23,7 +23,7 @@ Contains 3 vector fields X, Y and Z as its columns, which are typically interpre Basis can also be accessed as an array of 3D vectors. These vectors are usually orthogonal to each other, but are not necessarily normalized (due to scaling). -For more information, read the "Matrices and transforms" documentation article. +For a general introduction, see the :doc:`Matrices and transforms <../tutorials/math/matrices_and_transforms>` tutorial. .. note:: @@ -151,6 +151,10 @@ Operators +-------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`operator *` **(** :ref:`int` right **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------+ + | :ref:`Basis` | :ref:`operator /` **(** :ref:`float` right **)** | + +-------------------------------+-----------------------------------------------------------------------------------------------------+ + | :ref:`Basis` | :ref:`operator /` **(** :ref:`int` right **)** | + +-------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`operator ==` **(** :ref:`Basis` right **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`operator []` **(** :ref:`int` index **)** | @@ -328,6 +332,25 @@ A negative determinant means the basis has a negative scale. A zero determinant Constructs a pure rotation Basis matrix from Euler angles in the specified Euler rotation order. By default, use YXZ order (most common). See the :ref:`EulerOrder` enum for possible values. + +.. tabs:: + + .. code-tab:: gdscript + + # Creates a Basis whose z axis points down. + var my_basis = Basis.from_euler(Vector3(TAU / 4, 0, 0)) + + print(my_basis.z) # Prints (0, -1, 0). + + .. code-tab:: csharp + + // Creates a Basis whose z axis points down. + var myBasis = Basis.FromEuler(new Vector3(Mathf.Tau / 4.0f, 0.0f, 0.0f)); + + GD.Print(myBasis.Z); // Prints (0, -1, 0). + + + .. rst-class:: classref-item-separator ---- @@ -340,6 +363,27 @@ Constructs a pure rotation Basis matrix from Euler angles in the specified Euler Constructs a pure scale basis matrix with no rotation or shearing. The scale values are set as the diagonal of the matrix, and the other parts of the matrix are zero. + +.. tabs:: + + .. code-tab:: gdscript + + var my_basis = Basis.from_scale(Vector3(2, 4, 8)) + + print(my_basis.x) # Prints (2, 0, 0). + print(my_basis.y) # Prints (0, 4, 0). + print(my_basis.z) # Prints (0, 0, 8). + + .. code-tab:: csharp + + var myBasis = Basis.FromScale(new Vector3(2.0f, 4.0f, 8.0f)); + + GD.Print(myBasis.X); // Prints (2, 0, 0). + GD.Print(myBasis.Y); // Prints (0, 4, 0). + GD.Print(myBasis.Z); // Prints (0, 0, 8). + + + .. rst-class:: classref-item-separator ---- @@ -378,6 +422,37 @@ Returns the basis's rotation in the form of a quaternion. See :ref:`get_euler` **operator /** **(** :ref:`float` right **)** + +This operator divides all components of the **Basis**, which inversely scales it uniformly. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Basis_operator_div_int: + +.. rst-class:: classref-operator + +:ref:`Basis` **operator /** **(** :ref:`int` right **)** + +This operator divides all components of the **Basis**, which inversely scales it uniformly. + +.. rst-class:: classref-item-separator + +---- + .. _class_Basis_operator_eq_Basis: .. rst-class:: classref-operator diff --git a/classes/class_bone2d.rst b/classes/class_bone2d.rst index d4a59a3d7d7..6b1e6cb6699 100644 --- a/classes/class_bone2d.rst +++ b/classes/class_bone2d.rst @@ -104,7 +104,7 @@ Method Descriptions void **apply_rest** **(** **)** -Stores the node's current transforms in :ref:`rest`. +Resets the bone to the rest pose. This is equivalent to setting :ref:`Node2D.transform` to :ref:`rest`. .. rst-class:: classref-item-separator diff --git a/classes/class_callable.rst b/classes/class_callable.rst index 2014cbe6e9d..2658af1bd1f 100644 --- a/classes/class_callable.rst +++ b/classes/class_callable.rst @@ -68,19 +68,6 @@ In GDScript, it's possible to create lambda functions within a method. Lambda fu # Prints "Attack!", when the button_pressed signal is emitted. button_pressed.connect(func(): print("Attack!")) -\ **Note:** Methods of native types such as :ref:`Signal`, :ref:`Array`, or :ref:`Dictionary` are not of type **Callable** in order to avoid unnecessary overhead. If you need to pass those methods as **Callable**, use a lambda function as a wrapper. - -:: - - func _init(): - var my_dictionary = { "hello": "world" } - - # This will not work, `clear` is not a callable. - create_tween().tween_callback(my_dictionary.clear) - - # This will work, as lambdas are custom callables. - create_tween().tween_callback(func(): my_dictionary.clear()) - .. note:: There are notable differences when using this API with C#. See :ref:`doc_c_sharp_differences` for more information. @@ -255,11 +242,23 @@ void **call_deferred** **(** ... **)** |vararg| |const| Calls the method represented by this **Callable** in deferred mode, i.e. at the end of the current frame. Arguments can be passed and should match the method's signature. -:: + +.. tabs:: + + .. code-tab:: gdscript func _ready(): grab_focus.call_deferred() + .. code-tab:: csharp + + public override void _Ready() + { + Callable.From(GrabFocus).CallDeferred(); + } + + + See also :ref:`Object.call_deferred`. .. rst-class:: classref-item-separator diff --git a/classes/class_cameraattributesphysical.rst b/classes/class_cameraattributesphysical.rst index 899ed72d154..a01e3278f4f 100644 --- a/classes/class_cameraattributesphysical.rst +++ b/classes/class_cameraattributesphysical.rst @@ -145,7 +145,7 @@ Only available when :ref:`ProjectSettings.rendering/lights_and_shadows/use_physi - void **set_shutter_speed** **(** :ref:`float` value **)** - :ref:`float` **get_shutter_speed** **(** **)** -Time for shutter to open and close, measured in seconds. A higher value will let in more light leading to a brighter image, while a lower amount will let in less light leading to a darker image. +Time for shutter to open and close, evaluated as ``1 / shutter_speed`` seconds. A higher value will allow less light (leading to a darker image), while a lower value will allow more light (leading to a brighter image). Only available when :ref:`ProjectSettings.rendering/lights_and_shadows/use_physical_light_units` is enabled. diff --git a/classes/class_cameraattributespractical.rst b/classes/class_cameraattributespractical.rst index 64eeae4e7ef..75c60393919 100644 --- a/classes/class_cameraattributespractical.rst +++ b/classes/class_cameraattributespractical.rst @@ -105,7 +105,7 @@ The minimum sensitivity (in ISO) used when calculating auto exposure. When calcu - void **set_dof_blur_amount** **(** :ref:`float` value **)** - :ref:`float` **get_dof_blur_amount** **(** **)** -Sets the maximum amount of blur. When using physically-based blur amounts, will instead act as a multiplier. High values lead to an increased amount of bluriness, but can be much more expensive to calculate. It is best to keep this as low as possible for a given art style. +Sets the maximum amount of blur. When using physically-based blur amounts, will instead act as a multiplier. High values lead to an increased amount of blurriness, but can be much more expensive to calculate. It is best to keep this as low as possible for a given art style. .. rst-class:: classref-item-separator diff --git a/classes/class_canvasitem.rst b/classes/class_canvasitem.rst index 4fdd54522d6..9f0427e2160 100644 --- a/classes/class_canvasitem.rst +++ b/classes/class_canvasitem.rst @@ -288,7 +288,7 @@ The **CanvasItem** will inherit the filter from its parent. :ref:`TextureFilter` **TEXTURE_FILTER_NEAREST** = ``1`` -The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering. Useful for pixel art. +The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_CanvasItem_constant_TEXTURE_FILTER_LINEAR: @@ -296,7 +296,7 @@ The texture filter reads from the nearest pixel only. The simplest and fastest m :ref:`TextureFilter` **TEXTURE_FILTER_LINEAR** = ``2`` -The texture filter blends between the nearest four pixels. Use this for most cases where you want to avoid a pixelated style. +The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_CanvasItem_constant_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: @@ -304,7 +304,9 @@ The texture filter blends between the nearest four pixels. Use this for most cas :ref:`TextureFilter` **TEXTURE_FILTER_NEAREST_WITH_MIPMAPS** = ``3`` -The texture filter reads from the nearest pixel in the nearest mipmap. This is the fastest way to read from textures with mipmaps. +The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look pixelated from up close, and smooth from a distance. + +Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. .. _class_CanvasItem_constant_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: @@ -312,7 +314,9 @@ The texture filter reads from the nearest pixel in the nearest mipmap. This is t :ref:`TextureFilter` **TEXTURE_FILTER_LINEAR_WITH_MIPMAPS** = ``4`` -The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. +The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look smooth from up close, and smooth from a distance. + +Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. .. _class_CanvasItem_constant_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC: @@ -320,9 +324,9 @@ The texture filter blends between the nearest 4 pixels and between the nearest 2 :ref:`TextureFilter` **TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC** = ``5`` -The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. +The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. -\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`TEXTURE_FILTER_NEAREST_WITH_MIPMAPS` is usually more appropriate. +\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`TEXTURE_FILTER_NEAREST_WITH_MIPMAPS` is usually more appropriate in this case. .. _class_CanvasItem_constant_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: @@ -330,9 +334,9 @@ The texture filter reads from the nearest pixel, but selects a mipmap based on t :ref:`TextureFilter` **TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC** = ``6`` -The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. +The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. -\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`TEXTURE_FILTER_LINEAR_WITH_MIPMAPS` is usually more appropriate. +\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`TEXTURE_FILTER_LINEAR_WITH_MIPMAPS` is usually more appropriate in this case. .. _class_CanvasItem_constant_TEXTURE_FILTER_MAX: @@ -1428,7 +1432,7 @@ Returns ``true`` if global transform notifications are communicated to children. :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 ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is consequently not drawn (see :ref:`_draw`). +Returns ``true`` if the node is present in the :ref:`SceneTree`, its :ref:`visible` property is ``true`` and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is therefore not drawn (see :ref:`_draw`). .. rst-class:: classref-item-separator diff --git a/classes/class_canvastexture.rst b/classes/class_canvastexture.rst index 61e53b65180..bf92b2dd98c 100644 --- a/classes/class_canvastexture.rst +++ b/classes/class_canvastexture.rst @@ -21,7 +21,7 @@ Description **CanvasTexture** is an alternative to :ref:`ImageTexture` for 2D rendering. It allows using normal maps and specular maps in any node that inherits from :ref:`CanvasItem`. **CanvasTexture** also allows overriding the texture's filter and repeat mode independently of the node's properties (or the project settings). -\ **Note:** **CanvasTexture** cannot be used in 3D rendering. For physically-based materials in 3D, use :ref:`BaseMaterial3D` instead. +\ **Note:** **CanvasTexture** cannot be used in 3D. It will not display correctly when applied to any :ref:`VisualInstance3D`, such as :ref:`Sprite3D` or :ref:`Decal`. For physically-based materials in 3D, use :ref:`BaseMaterial3D` instead. .. rst-class:: classref-introduction-group diff --git a/classes/class_collisionpolygon2d.rst b/classes/class_collisionpolygon2d.rst index 9ea51ee33b6..1b5918473e4 100644 --- a/classes/class_collisionpolygon2d.rst +++ b/classes/class_collisionpolygon2d.rst @@ -166,6 +166,8 @@ The margin used for one-way collision (in pixels). Higher values will make the s The polygon's list of vertices. Each point will be connected to the next, and the final point will be connected to the first. +\ **Note:** The returned vertices are in the local coordinate space of the given **CollisionPolygon2D**. + \ **Warning:** The returned value is a clone of the :ref:`PackedVector2Array`, not a reference. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` diff --git a/classes/class_color.rst b/classes/class_color.rst index a64c63d9030..0698715d5f5 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -17,7 +17,7 @@ A color represented in RGBA format. Description ----------- -A color represented in RGBA format by a red (:ref:`r`), green (:ref:`g`), blue (:ref:`b`), and alpha (:ref:`a`) component. Each component is a 16-bit floating-point value, usually ranging from ``0.0`` to ``1.0``. Some properties (such as :ref:`CanvasItem.modulate`) may support values greater than ``1.0``, for overbright or HDR (High Dynamic Range) colors. +A color represented in RGBA format by a red (:ref:`r`), green (:ref:`g`), blue (:ref:`b`), and alpha (:ref:`a`) component. Each component is a 32-bit floating-point value, usually ranging from ``0.0`` to ``1.0``. Some properties (such as :ref:`CanvasItem.modulate`) may support values greater than ``1.0``, for overbright or HDR (High Dynamic Range) colors. Colors can be created in various ways: By the various **Color** constructors, by static methods such as :ref:`from_hsv`, and by using a name from the set of standardized colors based on `X11 color names `__ with the addition of :ref:`TRANSPARENT`. GDScript also provides :ref:`@GDScript.Color8`, which uses integers from ``0`` to ``255`` and doesn't support overbright colors. diff --git a/classes/class_colorpicker.rst b/classes/class_colorpicker.rst index aa5f8e9a898..8cd48f4ff44 100644 --- a/classes/class_colorpicker.rst +++ b/classes/class_colorpicker.rst @@ -123,6 +123,8 @@ Theme Properties +-----------------------------------+----------------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`sample_bg` | | +-----------------------------------+----------------------------------------------------------------------------------------+---------+ + | :ref:`Texture2D` | :ref:`sample_revert` | | + +-----------------------------------+----------------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`screen_picker` | | +-----------------------------------+----------------------------------------------------------------------------------------+---------+ | :ref:`Texture2D` | :ref:`shape_circle` | | @@ -736,6 +738,18 @@ Background panel for the color preview box (visible when the color is translucen ---- +.. _class_ColorPicker_theme_icon_sample_revert: + +.. rst-class:: classref-themeproperty + +:ref:`Texture2D` **sample_revert** + +The icon for the revert button (visible on the middle of the "old" color when it differs from the currently selected color). This icon is modulated with a dark color if the "old" color is bright enough, so the icon should be bright to ensure visibility in both scenarios. + +.. rst-class:: classref-item-separator + +---- + .. _class_ColorPicker_theme_icon_screen_picker: .. rst-class:: classref-themeproperty diff --git a/classes/class_compressedcubemap.rst b/classes/class_compressedcubemap.rst index 4a26c7050a0..ad7a5e358d9 100644 --- a/classes/class_compressedcubemap.rst +++ b/classes/class_compressedcubemap.rst @@ -19,7 +19,7 @@ An optionally compressed :ref:`Cubemap`. Description ----------- -A cubemap that is loaded from a ``.ccube`` file. This file format is internal to Godot; it is created by importing other image formats with the import system. **CompressedCubemap** can use one of 4 compresson methods: +A cubemap that is loaded from a ``.ccube`` file. This file format is internal to Godot; it is created by importing other image formats with the import system. **CompressedCubemap** can use one of 4 compression methods: - Lossless (WebP or PNG, uncompressed on the GPU) diff --git a/classes/class_compressedcubemaparray.rst b/classes/class_compressedcubemaparray.rst index 4a286e4ea13..b3cf5e83510 100644 --- a/classes/class_compressedcubemaparray.rst +++ b/classes/class_compressedcubemaparray.rst @@ -19,7 +19,7 @@ An optionally compressed :ref:`CubemapArray`. Description ----------- -A cubemap array that is loaded from a ``.ccubearray`` file. This file format is internal to Godot; it is created by importing other image formats with the import system. **CompressedCubemapArray** can use one of 4 compresson methods: +A cubemap array that is loaded from a ``.ccubearray`` file. This file format is internal to Godot; it is created by importing other image formats with the import system. **CompressedCubemapArray** can use one of 4 compression methods: - Lossless (WebP or PNG, uncompressed on the GPU) diff --git a/classes/class_compressedtexture2darray.rst b/classes/class_compressedtexture2darray.rst index a2d0381d2e2..53ce44df3da 100644 --- a/classes/class_compressedtexture2darray.rst +++ b/classes/class_compressedtexture2darray.rst @@ -19,7 +19,7 @@ Array of 2-dimensional textures, optionally compressed. Description ----------- -A texture array that is loaded from a ``.ctexarray`` file. This file format is internal to Godot; it is created by importing other image formats with the import system. **CompressedTexture2DArray** can use one of 4 compresson methods: +A texture array that is loaded from a ``.ctexarray`` file. This file format is internal to Godot; it is created by importing other image formats with the import system. **CompressedTexture2DArray** can use one of 4 compression methods: - Lossless (WebP or PNG, uncompressed on the GPU) diff --git a/classes/class_cpuparticles2d.rst b/classes/class_cpuparticles2d.rst index 3dc97523b6c..87857581595 100644 --- a/classes/class_cpuparticles2d.rst +++ b/classes/class_cpuparticles2d.rst @@ -246,7 +246,7 @@ Particles are drawn in the order emitted. :ref:`DrawOrder` **DRAW_ORDER_LIFETIME** = ``1`` -Particles are drawn in order of remaining lifetime. +Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. .. rst-class:: classref-item-separator diff --git a/classes/class_cpuparticles3d.rst b/classes/class_cpuparticles3d.rst index a166efabf66..218c57d0e9b 100644 --- a/classes/class_cpuparticles3d.rst +++ b/classes/class_cpuparticles3d.rst @@ -262,7 +262,7 @@ Particles are drawn in the order emitted. :ref:`DrawOrder` **DRAW_ORDER_LIFETIME** = ``1`` -Particles are drawn in order of remaining lifetime. +Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. .. _class_CPUParticles3D_constant_DRAW_ORDER_VIEW_DEPTH: diff --git a/classes/class_csgpolygon3d.rst b/classes/class_csgpolygon3d.rst index 37a2c9c44ae..384a440cc0f 100644 --- a/classes/class_csgpolygon3d.rst +++ b/classes/class_csgpolygon3d.rst @@ -348,7 +348,7 @@ When :ref:`mode` is :ref:`MODE_PATH` value **)** - :ref:`PathRotation` **get_path_rotation** **(** **)** -When :ref:`mode` is :ref:`MODE_PATH`, the :ref:`PathRotation` method used to rotate the :ref:`polygon` as it is extruded. +When :ref:`mode` is :ref:`MODE_PATH`, the path rotation method used to rotate the :ref:`polygon` as it is extruded. .. rst-class:: classref-item-separator diff --git a/classes/class_curve2d.rst b/classes/class_curve2d.rst index 881032528dd..a2091861254 100644 --- a/classes/class_curve2d.rst +++ b/classes/class_curve2d.rst @@ -295,18 +295,16 @@ Cubic interpolation tends to follow the curves better, but linear is faster (and :ref:`Transform2D` **sample_baked_with_rotation** **(** :ref:`float` offset=0.0, :ref:`bool` cubic=false **)** |const| -Similar to :ref:`sample_baked`, but returns :ref:`Transform2D` that includes a rotation along the curve, with :ref:`Transform2D.origin` as the point position, :ref:`Transform2D.x` as the sideways vector, and :ref:`Transform2D.y` as the forward vector. Returns an empty transform if the length of the curve is ``0``. +Similar to :ref:`sample_baked`, but returns :ref:`Transform2D` that includes a rotation along the curve, with :ref:`Transform2D.origin` as the point position and the :ref:`Transform2D.x` vector pointing in the direction of the path at that point. Returns an empty transform if the length of the curve is ``0``. :: var baked = curve.sample_baked_with_rotation(offset) - # This will rotate and position the node with the up direction pointing along the curve. + # The returned Transform2D can be set directly. + transform = baked + # You can also read the origin and rotation separately from the returned Transform2D. position = baked.get_origin() rotation = baked.get_rotation() - # Alternatively, not preserving scale. - transform = baked * Transform2D.FLIP_Y - # To match the rotation of PathFollow2D, not preserving scale. - transform = Transform2D(baked.y, baked.x, baked.origin) .. rst-class:: classref-item-separator diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index 0664ca4713f..89a9d73ad34 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -237,6 +237,8 @@ Methods +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get` **(** :ref:`Variant` key, :ref:`Variant` default=null **)** |const| | +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`get_or_add` **(** :ref:`Variant` key, :ref:`Variant` default=null **)** | + +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has` **(** :ref:`Variant` key **)** |const| | +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_all` **(** :ref:`Array` keys **)** |const| | @@ -374,6 +376,18 @@ Returns the corresponding value for the given ``key`` in the dictionary. If the ---- +.. _class_Dictionary_method_get_or_add: + +.. rst-class:: classref-method + +:ref:`Variant` **get_or_add** **(** :ref:`Variant` key, :ref:`Variant` default=null **)** + +Gets a value and ensures the key is set. If the ``key`` exists in the dictionary, this behaves like :ref:`get`. Otherwise, the ``default`` value is inserted into the dictionary and returned. + +.. rst-class:: classref-item-separator + +---- + .. _class_Dictionary_method_has: .. rst-class:: classref-method diff --git a/classes/class_displayserver.rst b/classes/class_displayserver.rst index 21d52fb258f..f443494e5a4 100644 --- a/classes/class_displayserver.rst +++ b/classes/class_displayserver.rst @@ -31,343 +31,347 @@ Methods .. table:: :widths: auto - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`clipboard_get` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Image` | :ref:`clipboard_get_image` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`clipboard_get_primary` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`clipboard_has` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`clipboard_has_image` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`clipboard_set` **(** :ref:`String` clipboard **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`clipboard_set_primary` **(** :ref:`String` clipboard_primary **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`CursorShape` | :ref:`cursor_get_shape` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`cursor_set_custom_image` **(** :ref:`Resource` cursor, :ref:`CursorShape` shape=0, :ref:`Vector2` hotspot=Vector2(0, 0) **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`cursor_set_shape` **(** :ref:`CursorShape` shape **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`dialog_input_text` **(** :ref:`String` title, :ref:`String` description, :ref:`String` existing_text, :ref:`Callable` callback **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`dialog_show` **(** :ref:`String` title, :ref:`String` description, :ref:`PackedStringArray` buttons, :ref:`Callable` callback **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`enable_for_stealing_focus` **(** :ref:`int` process_id **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`file_dialog_show` **(** :ref:`String` title, :ref:`String` current_directory, :ref:`String` filename, :ref:`bool` show_hidden, :ref:`FileDialogMode` mode, :ref:`PackedStringArray` filters, :ref:`Callable` callback **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`force_process_and_drop_events` **(** **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Color` | :ref:`get_accent_color` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Rect2[]` | :ref:`get_display_cutouts` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Rect2i` | :ref:`get_display_safe_area` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_keyboard_focus_screen` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_name` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_primary_screen` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_screen_count` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_screen_from_rect` **(** :ref:`Rect2` rect **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`get_swap_cancel_ok` **(** **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_window_at_screen_position` **(** :ref:`Vector2i` position **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedInt32Array` | :ref:`get_window_list` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_add_check_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_add_icon_check_item` **(** :ref:`String` menu_root, :ref:`Texture2D` icon, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_add_icon_item` **(** :ref:`String` menu_root, :ref:`Texture2D` icon, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_add_icon_radio_check_item` **(** :ref:`String` menu_root, :ref:`Texture2D` icon, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_add_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_add_multistate_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`int` max_states, :ref:`int` default_state, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_add_radio_check_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_add_separator` **(** :ref:`String` menu_root, :ref:`int` index=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_add_submenu_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`String` submenu, :ref:`int` index=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_clear` **(** :ref:`String` menu_root **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Key` | :ref:`global_menu_get_item_accelerator` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Callable` | :ref:`global_menu_get_item_callback` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_get_item_count` **(** :ref:`String` menu_root **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Texture2D` | :ref:`global_menu_get_item_icon` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_get_item_indentation_level` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_get_item_index_from_tag` **(** :ref:`String` menu_root, :ref:`Variant` tag **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_get_item_index_from_text` **(** :ref:`String` menu_root, :ref:`String` text **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Callable` | :ref:`global_menu_get_item_key_callback` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_get_item_max_states` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`global_menu_get_item_state` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`global_menu_get_item_submenu` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant` | :ref:`global_menu_get_item_tag` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`global_menu_get_item_text` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`global_menu_get_item_tooltip` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`global_menu_is_item_checkable` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`global_menu_is_item_checked` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`global_menu_is_item_disabled` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`global_menu_is_item_hidden` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`global_menu_is_item_radio_checkable` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_remove_item` **(** :ref:`String` menu_root, :ref:`int` idx **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_accelerator` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Key` keycode **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_callback` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Callable` callback **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_checkable` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checkable **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_checked` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checked **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_disabled` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` disabled **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_hidden` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` hidden **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_hover_callbacks` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Callable` callback **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_icon` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Texture2D` icon **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_indentation_level` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`int` level **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_key_callback` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Callable` key_callback **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_max_states` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`int` max_states **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_radio_checkable` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checkable **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_state` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`int` state **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_submenu` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` submenu **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_tag` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Variant` tag **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_text` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` text **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_item_tooltip` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` tooltip **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`global_menu_set_popup_callbacks` **(** :ref:`String` menu_root, :ref:`Callable` open_callback, :ref:`Callable` close_callback **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`has_feature` **(** :ref:`Feature` feature **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`ime_get_selection` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`ime_get_text` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_dark_mode` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_dark_mode_supported` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_touchscreen_available` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`keyboard_get_current_layout` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Key` | :ref:`keyboard_get_keycode_from_physical` **(** :ref:`Key` keycode **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Key` | :ref:`keyboard_get_label_from_physical` **(** :ref:`Key` keycode **)** |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 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |bitfield|\<:ref:`MouseButtonMask`\> | :ref:`mouse_get_button_state` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`MouseMode` | :ref:`mouse_get_mode` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`mouse_get_position` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`mouse_set_mode` **(** :ref:`MouseMode` mouse_mode **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`process_events` **(** **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`screen_get_dpi` **(** :ref:`int` screen=-1 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Image` | :ref:`screen_get_image` **(** :ref:`int` screen=-1 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`screen_get_max_scale` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`ScreenOrientation` | :ref:`screen_get_orientation` **(** :ref:`int` screen=-1 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Color` | :ref:`screen_get_pixel` **(** :ref:`Vector2i` position **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`screen_get_position` **(** :ref:`int` screen=-1 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`screen_get_refresh_rate` **(** :ref:`int` screen=-1 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`screen_get_scale` **(** :ref:`int` screen=-1 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`screen_get_size` **(** :ref:`int` screen=-1 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Rect2i` | :ref:`screen_get_usable_rect` **(** :ref:`int` screen=-1 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`screen_is_kept_on` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`screen_set_keep_on` **(** :ref:`bool` enable **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`screen_set_orientation` **(** :ref:`ScreenOrientation` orientation, :ref:`int` screen=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_icon` **(** :ref:`Image` image **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_native_icon` **(** :ref:`String` filename **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`tablet_get_current_driver` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`tablet_get_driver_count` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`tablet_get_driver_name` **(** :ref:`int` idx **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`tablet_set_current_driver` **(** :ref:`String` name **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Dictionary[]` | :ref:`tts_get_voices` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`tts_get_voices_for_language` **(** :ref:`String` language **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`tts_is_paused` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`tts_is_speaking` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`tts_pause` **(** **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`tts_resume` **(** **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`tts_set_utterance_callback` **(** :ref:`TTSUtteranceEvent` event, :ref:`Callable` callable **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`tts_speak` **(** :ref:`String` text, :ref:`String` voice, :ref:`int` volume=50, :ref:`float` pitch=1.0, :ref:`float` rate=1.0, :ref:`int` utterance_id=0, :ref:`bool` interrupt=false **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`tts_stop` **(** **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`virtual_keyboard_get_height` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`virtual_keyboard_hide` **(** **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`virtual_keyboard_show` **(** :ref:`String` existing_text, :ref:`Rect2` position=Rect2(0, 0, 0, 0), :ref:`VirtualKeyboardType` type=0, :ref:`int` max_length=-1, :ref:`int` cursor_start=-1, :ref:`int` cursor_end=-1 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`warp_mouse` **(** :ref:`Vector2i` position **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`window_can_draw` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`window_get_active_popup` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`window_get_attached_instance_id` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`window_get_current_screen` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`window_get_flag` **(** :ref:`WindowFlags` flag, :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`window_get_max_size` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`window_get_min_size` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`WindowMode` | :ref:`window_get_mode` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`window_get_native_handle` **(** :ref:`HandleType` handle_type, :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Rect2i` | :ref:`window_get_popup_safe_rect` **(** :ref:`int` window **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`window_get_position` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`window_get_position_with_decorations` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector3i` | :ref:`window_get_safe_title_margins` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`window_get_size` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`window_get_size_with_decorations` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2i` | :ref:`window_get_title_size` **(** :ref:`String` title, :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`VSyncMode` | :ref:`window_get_vsync_mode` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`window_is_focused` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`window_is_maximize_allowed` **(** :ref:`int` window_id=0 **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`window_maximize_on_title_dbl_click` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`window_minimize_on_title_dbl_click` **(** **)** |const| | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_move_to_foreground` **(** :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_request_attention` **(** :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_current_screen` **(** :ref:`int` screen, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_drop_files_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_exclusive` **(** :ref:`int` window_id, :ref:`bool` exclusive **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_flag` **(** :ref:`WindowFlags` flag, :ref:`bool` enabled, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_ime_active` **(** :ref:`bool` active, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_ime_position` **(** :ref:`Vector2i` position, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_input_event_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_input_text_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_max_size` **(** :ref:`Vector2i` max_size, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_min_size` **(** :ref:`Vector2i` min_size, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_mode` **(** :ref:`WindowMode` mode, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_mouse_passthrough` **(** :ref:`PackedVector2Array` region, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_popup_safe_rect` **(** :ref:`int` window, :ref:`Rect2i` rect **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_position` **(** :ref:`Vector2i` position, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_rect_changed_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_size` **(** :ref:`Vector2i` size, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_title` **(** :ref:`String` title, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_transient` **(** :ref:`int` window_id, :ref:`int` parent_window_id **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_vsync_mode` **(** :ref:`VSyncMode` vsync_mode, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_window_buttons_offset` **(** :ref:`Vector2i` offset, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`window_set_window_event_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | - +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`clipboard_get` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Image` | :ref:`clipboard_get_image` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`clipboard_get_primary` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`clipboard_has` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`clipboard_has_image` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`clipboard_set` **(** :ref:`String` clipboard **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`clipboard_set_primary` **(** :ref:`String` clipboard_primary **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`CursorShape` | :ref:`cursor_get_shape` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`cursor_set_custom_image` **(** :ref:`Resource` cursor, :ref:`CursorShape` shape=0, :ref:`Vector2` hotspot=Vector2(0, 0) **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`cursor_set_shape` **(** :ref:`CursorShape` shape **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`dialog_input_text` **(** :ref:`String` title, :ref:`String` description, :ref:`String` existing_text, :ref:`Callable` callback **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`dialog_show` **(** :ref:`String` title, :ref:`String` description, :ref:`PackedStringArray` buttons, :ref:`Callable` callback **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`enable_for_stealing_focus` **(** :ref:`int` process_id **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`file_dialog_show` **(** :ref:`String` title, :ref:`String` current_directory, :ref:`String` filename, :ref:`bool` show_hidden, :ref:`FileDialogMode` mode, :ref:`PackedStringArray` filters, :ref:`Callable` callback **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`file_dialog_with_options_show` **(** :ref:`String` title, :ref:`String` current_directory, :ref:`String` root, :ref:`String` filename, :ref:`bool` show_hidden, :ref:`FileDialogMode` mode, :ref:`PackedStringArray` filters, :ref:`Dictionary[]` options, :ref:`Callable` callback **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`force_process_and_drop_events` **(** **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`get_accent_color` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2[]` | :ref:`get_display_cutouts` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2i` | :ref:`get_display_safe_area` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_keyboard_focus_screen` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_name` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_primary_screen` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_screen_count` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_screen_from_rect` **(** :ref:`Rect2` rect **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`get_swap_cancel_ok` **(** **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_window_at_screen_position` **(** :ref:`Vector2i` position **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedInt32Array` | :ref:`get_window_list` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_add_check_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_add_icon_check_item` **(** :ref:`String` menu_root, :ref:`Texture2D` icon, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_add_icon_item` **(** :ref:`String` menu_root, :ref:`Texture2D` icon, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_add_icon_radio_check_item` **(** :ref:`String` menu_root, :ref:`Texture2D` icon, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_add_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_add_multistate_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`int` max_states, :ref:`int` default_state, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_add_radio_check_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback=Callable(), :ref:`Callable` key_callback=Callable(), :ref:`Variant` tag=null, :ref:`Key` accelerator=0, :ref:`int` index=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_add_separator` **(** :ref:`String` menu_root, :ref:`int` index=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_add_submenu_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`String` submenu, :ref:`int` index=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_clear` **(** :ref:`String` menu_root **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Key` | :ref:`global_menu_get_item_accelerator` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Callable` | :ref:`global_menu_get_item_callback` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_get_item_count` **(** :ref:`String` menu_root **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Texture2D` | :ref:`global_menu_get_item_icon` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_get_item_indentation_level` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_get_item_index_from_tag` **(** :ref:`String` menu_root, :ref:`Variant` tag **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_get_item_index_from_text` **(** :ref:`String` menu_root, :ref:`String` text **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Callable` | :ref:`global_menu_get_item_key_callback` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_get_item_max_states` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`global_menu_get_item_state` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`global_menu_get_item_submenu` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`global_menu_get_item_tag` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`global_menu_get_item_text` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`global_menu_get_item_tooltip` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Dictionary` | :ref:`global_menu_get_system_menu_roots` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`global_menu_is_item_checkable` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`global_menu_is_item_checked` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`global_menu_is_item_disabled` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`global_menu_is_item_hidden` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`global_menu_is_item_radio_checkable` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_remove_item` **(** :ref:`String` menu_root, :ref:`int` idx **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_accelerator` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Key` keycode **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_callback` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Callable` callback **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_checkable` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checkable **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_checked` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checked **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_disabled` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` disabled **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_hidden` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` hidden **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_hover_callbacks` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Callable` callback **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_icon` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Texture2D` icon **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_indentation_level` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`int` level **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_key_callback` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Callable` key_callback **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_max_states` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`int` max_states **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_radio_checkable` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checkable **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_state` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`int` state **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_submenu` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` submenu **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_tag` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Variant` tag **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_text` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` text **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_item_tooltip` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` tooltip **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`global_menu_set_popup_callbacks` **(** :ref:`String` menu_root, :ref:`Callable` open_callback, :ref:`Callable` close_callback **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`has_feature` **(** :ref:`Feature` feature **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`ime_get_selection` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`ime_get_text` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_dark_mode` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_dark_mode_supported` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_touchscreen_available` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`keyboard_get_current_layout` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Key` | :ref:`keyboard_get_keycode_from_physical` **(** :ref:`Key` keycode **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Key` | :ref:`keyboard_get_label_from_physical` **(** :ref:`Key` keycode **)** |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 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |bitfield|\<:ref:`MouseButtonMask`\> | :ref:`mouse_get_button_state` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`MouseMode` | :ref:`mouse_get_mode` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`mouse_get_position` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`mouse_set_mode` **(** :ref:`MouseMode` mouse_mode **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`process_events` **(** **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`screen_get_dpi` **(** :ref:`int` screen=-1 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Image` | :ref:`screen_get_image` **(** :ref:`int` screen=-1 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`screen_get_max_scale` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`ScreenOrientation` | :ref:`screen_get_orientation` **(** :ref:`int` screen=-1 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`screen_get_pixel` **(** :ref:`Vector2i` position **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`screen_get_position` **(** :ref:`int` screen=-1 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`screen_get_refresh_rate` **(** :ref:`int` screen=-1 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`screen_get_scale` **(** :ref:`int` screen=-1 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`screen_get_size` **(** :ref:`int` screen=-1 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2i` | :ref:`screen_get_usable_rect` **(** :ref:`int` screen=-1 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`screen_is_kept_on` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`screen_set_keep_on` **(** :ref:`bool` enable **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`screen_set_orientation` **(** :ref:`ScreenOrientation` orientation, :ref:`int` screen=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_icon` **(** :ref:`Image` image **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_native_icon` **(** :ref:`String` filename **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`tablet_get_current_driver` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`tablet_get_driver_count` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`tablet_get_driver_name` **(** :ref:`int` idx **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`tablet_set_current_driver` **(** :ref:`String` name **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Dictionary[]` | :ref:`tts_get_voices` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`tts_get_voices_for_language` **(** :ref:`String` language **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`tts_is_paused` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`tts_is_speaking` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`tts_pause` **(** **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`tts_resume` **(** **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`tts_set_utterance_callback` **(** :ref:`TTSUtteranceEvent` event, :ref:`Callable` callable **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`tts_speak` **(** :ref:`String` text, :ref:`String` voice, :ref:`int` volume=50, :ref:`float` pitch=1.0, :ref:`float` rate=1.0, :ref:`int` utterance_id=0, :ref:`bool` interrupt=false **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`tts_stop` **(** **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`virtual_keyboard_get_height` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`virtual_keyboard_hide` **(** **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`virtual_keyboard_show` **(** :ref:`String` existing_text, :ref:`Rect2` position=Rect2(0, 0, 0, 0), :ref:`VirtualKeyboardType` type=0, :ref:`int` max_length=-1, :ref:`int` cursor_start=-1, :ref:`int` cursor_end=-1 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`warp_mouse` **(** :ref:`Vector2i` position **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`window_can_draw` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`window_get_active_popup` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`window_get_attached_instance_id` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`window_get_current_screen` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`window_get_flag` **(** :ref:`WindowFlags` flag, :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`window_get_max_size` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`window_get_min_size` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`WindowMode` | :ref:`window_get_mode` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`window_get_native_handle` **(** :ref:`HandleType` handle_type, :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2i` | :ref:`window_get_popup_safe_rect` **(** :ref:`int` window **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`window_get_position` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`window_get_position_with_decorations` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3i` | :ref:`window_get_safe_title_margins` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`window_get_size` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`window_get_size_with_decorations` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2i` | :ref:`window_get_title_size` **(** :ref:`String` title, :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`VSyncMode` | :ref:`window_get_vsync_mode` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`window_is_focused` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`window_is_maximize_allowed` **(** :ref:`int` window_id=0 **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`window_maximize_on_title_dbl_click` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`window_minimize_on_title_dbl_click` **(** **)** |const| | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_move_to_foreground` **(** :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_request_attention` **(** :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_current_screen` **(** :ref:`int` screen, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_drop_files_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_exclusive` **(** :ref:`int` window_id, :ref:`bool` exclusive **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_flag` **(** :ref:`WindowFlags` flag, :ref:`bool` enabled, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_ime_active` **(** :ref:`bool` active, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_ime_position` **(** :ref:`Vector2i` position, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_input_event_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_input_text_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_max_size` **(** :ref:`Vector2i` max_size, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_min_size` **(** :ref:`Vector2i` min_size, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_mode` **(** :ref:`WindowMode` mode, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_mouse_passthrough` **(** :ref:`PackedVector2Array` region, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_popup_safe_rect` **(** :ref:`int` window, :ref:`Rect2i` rect **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_position` **(** :ref:`Vector2i` position, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_rect_changed_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_size` **(** :ref:`Vector2i` size, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_title` **(** :ref:`String` title, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_transient` **(** :ref:`int` window_id, :ref:`int` parent_window_id **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_vsync_mode` **(** :ref:`VSyncMode` vsync_mode, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_window_buttons_offset` **(** :ref:`Vector2i` offset, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`window_set_window_event_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | + +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -414,7 +418,7 @@ Display server supports touchscreen input. **Windows, Linux (X11), Android, iOS, :ref:`Feature` **FEATURE_MOUSE** = ``3`` -Display server supports mouse input. **Windows, macOS, Linux (X11), Android, Web** +Display server supports mouse input. **Windows, macOS, Linux (X11/Wayland), Android, Web** .. _class_DisplayServer_constant_FEATURE_MOUSE_WARP: @@ -422,7 +426,7 @@ Display server supports mouse input. **Windows, macOS, Linux (X11), Android, Web :ref:`Feature` **FEATURE_MOUSE_WARP** = ``4`` -Display server supports warping mouse coordinates to keep the mouse cursor constrained within an area, but looping when one of the edges is reached. **Windows, macOS, Linux (X11)** +Display server supports warping mouse coordinates to keep the mouse cursor constrained within an area, but looping when one of the edges is reached. **Windows, macOS, Linux (X11/Wayland)** .. _class_DisplayServer_constant_FEATURE_CLIPBOARD: @@ -430,7 +434,7 @@ Display server supports warping mouse coordinates to keep the mouse cursor const :ref:`Feature` **FEATURE_CLIPBOARD** = ``5`` -Display server supports setting and getting clipboard data. See also :ref:`FEATURE_CLIPBOARD_PRIMARY`. **Windows, macOS, Linux (X11), Android, iOS, Web** +Display server supports setting and getting clipboard data. See also :ref:`FEATURE_CLIPBOARD_PRIMARY`. **Windows, macOS, Linux (X11/Wayland), Android, iOS, Web** .. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD: @@ -446,7 +450,7 @@ Display server supports popping up a virtual keyboard when requested to input te :ref:`Feature` **FEATURE_CURSOR_SHAPE** = ``7`` -Display server supports setting the mouse cursor shape to be different from the default. **Windows, macOS, Linux (X11), Android, Web** +Display server supports setting the mouse cursor shape to be different from the default. **Windows, macOS, Linux (X11/Wayland), Android, Web** .. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE: @@ -454,7 +458,7 @@ Display server supports setting the mouse cursor shape to be different from the :ref:`Feature` **FEATURE_CUSTOM_CURSOR_SHAPE** = ``8`` -Display server supports setting the mouse cursor shape to a custom image. **Windows, macOS, Linux (X11), Web** +Display server supports setting the mouse cursor shape to a custom image. **Windows, macOS, Linux (X11/Wayland), Web** .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG: @@ -462,7 +466,7 @@ Display server supports setting the mouse cursor shape to a custom image. **Wind :ref:`Feature` **FEATURE_NATIVE_DIALOG** = ``9`` -Display server supports spawning dialogs using the operating system's native look-and-feel. **macOS** +Display server supports spawning dialogs using the operating system's native look-and-feel. **Windows, macOS, Linux (X11/Wayland)** .. _class_DisplayServer_constant_FEATURE_IME: @@ -478,7 +482,7 @@ Display server supports `Input Method Editor ` **FEATURE_WINDOW_TRANSPARENCY** = ``11`` -Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. **Windows, macOS, Linux (X11)** +Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. **Windows, macOS, Linux (X11/Wayland)** .. _class_DisplayServer_constant_FEATURE_HIDPI: @@ -486,7 +490,7 @@ Display server supports windows can use per-pixel transparency to make windows b :ref:`Feature` **FEATURE_HIDPI** = ``12`` -Display server supports querying the operating system's display scale factor. This allows for *reliable* automatic hiDPI display detection, as opposed to guessing based on the screen resolution and reported display DPI (which can be unreliable due to broken monitor EDID). **Windows, macOS** +Display server supports querying the operating system's display scale factor. This allows for *reliable* automatic hiDPI display detection, as opposed to guessing based on the screen resolution and reported display DPI (which can be unreliable due to broken monitor EDID). **Windows, Linux (Wayland), macOS** .. _class_DisplayServer_constant_FEATURE_ICON: @@ -518,7 +522,7 @@ Display server supports changing the screen orientation. **Android, iOS** :ref:`Feature` **FEATURE_SWAP_BUFFERS** = ``16`` -Display server supports V-Sync status can be changed from the default (which is forced to be enabled platforms not supporting this feature). **Windows, macOS, Linux (X11)** +Display server supports V-Sync status can be changed from the default (which is forced to be enabled platforms not supporting this feature). **Windows, macOS, Linux (X11/Wayland)** .. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY: @@ -526,7 +530,7 @@ Display server supports V-Sync status can be changed from the default (which is :ref:`Feature` **FEATURE_CLIPBOARD_PRIMARY** = ``18`` -Display server supports Primary clipboard can be used. This is a different clipboard from :ref:`FEATURE_CLIPBOARD`. **Linux (X11)** +Display server supports Primary clipboard can be used. This is a different clipboard from :ref:`FEATURE_CLIPBOARD`. **Linux (X11/Wayland)** .. _class_DisplayServer_constant_FEATURE_TEXT_TO_SPEECH: @@ -534,7 +538,7 @@ Display server supports Primary clipboard can be used. This is a different clipb :ref:`Feature` **FEATURE_TEXT_TO_SPEECH** = ``19`` -Display server supports text-to-speech. See ``tts_*`` methods. **Windows, macOS, Linux (X11), Android, iOS, Web** +Display server supports text-to-speech. See ``tts_*`` methods. **Windows, macOS, Linux (X11/Wayland), Android, iOS, Web** .. _class_DisplayServer_constant_FEATURE_EXTEND_TO_TITLE: @@ -1062,7 +1066,7 @@ The window background can be transparent. \ **Note:** This flag has no effect if :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed` is set to ``false``. -\ **Note:** Transparency support is implemented on Linux (X11), macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. +\ **Note:** Transparency support is implemented on Linux (X11/Wayland), macOS, and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. .. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS: @@ -1206,7 +1210,7 @@ enum **VSyncMode**: :ref:`VSyncMode` **VSYNC_DISABLED** = ``0`` -No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (notwithstanding :ref:`Engine.max_fps`). +No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (regardless of :ref:`Engine.max_fps`). .. _class_DisplayServer_constant_VSYNC_ENABLED: @@ -1214,7 +1218,7 @@ No vertical synchronization, which means the engine will display frames as fast :ref:`VSyncMode` **VSYNC_ENABLED** = ``1`` -Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (notwithstanding :ref:`Engine.max_fps`). +Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (regardless of :ref:`Engine.max_fps`). .. _class_DisplayServer_constant_VSYNC_ADAPTIVE: @@ -1222,7 +1226,7 @@ Default vertical synchronization mode, the image is displayed only on vertical b :ref:`VSyncMode` **VSYNC_ADAPTIVE** = ``2`` -Behaves like :ref:`VSYNC_DISABLED` when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (notwithstanding :ref:`Engine.max_fps`). Behaves like :ref:`VSYNC_ENABLED` when using the Compatibility rendering method. +Behaves like :ref:`VSYNC_DISABLED` when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (regardless of :ref:`Engine.max_fps`). Behaves like :ref:`VSYNC_ENABLED` when using the Compatibility rendering method. .. _class_DisplayServer_constant_VSYNC_MAILBOX: @@ -1230,7 +1234,7 @@ Behaves like :ref:`VSYNC_DISABLED` :ref:`VSyncMode` **VSYNC_MAILBOX** = ``3`` -Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (notwithstanding :ref:`Engine.max_fps`). +Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (regardless of :ref:`Engine.max_fps`). Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag (also called "Fast" V-Sync mode). :ref:`VSYNC_MAILBOX` works best when at least twice as many frames as the display refresh rate are rendered. Behaves like :ref:`VSYNC_ENABLED` when using the Compatibility rendering method. @@ -1298,7 +1302,7 @@ OpenGL context (only with the GL Compatibility renderer): - Windows: ``HGLRC`` for the window (native GL), or ``EGLContext`` for the window (ANGLE). -- Linux: ``GLXContext*`` for the window. +- Linux (X11): ``GLXContext*`` for the window. - macOS: ``NSOpenGLContext*`` for the window (native GL), or ``EGLContext`` for the window (ANGLE). @@ -1363,6 +1367,8 @@ Constants Represents the screen containing the mouse pointer. +\ **Note:** On Linux (Wayland), this constant always represents the screen at index ``0``. + .. _class_DisplayServer_constant_SCREEN_WITH_KEYBOARD_FOCUS: .. rst-class:: classref-constant @@ -1371,6 +1377,8 @@ Represents the screen containing the mouse pointer. Represents the screen containing the window with the keyboard focus. +\ **Note:** On Linux (Wayland), this constant always represents the screen at index ``0``. + .. _class_DisplayServer_constant_SCREEN_PRIMARY: .. rst-class:: classref-constant @@ -1379,6 +1387,8 @@ Represents the screen containing the window with the keyboard focus. Represents the primary screen. +\ **Note:** On Linux (Wayland), this constant always represents the screen at index ``0``. + .. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW: .. rst-class:: classref-constant @@ -1387,6 +1397,8 @@ Represents the primary screen. Represents the screen where the main window is located. This is usually the default value in functions that allow specifying one of several screens. +\ **Note:** On Linux (Wayland), this constant always represents the screen at index ``0``. + .. _class_DisplayServer_constant_MAIN_WINDOW_ID: .. rst-class:: classref-constant @@ -1401,7 +1413,7 @@ The ID of the main window spawned by the engine, which can be passed to methods **INVALID_WINDOW_ID** = ``-1`` -The ID that refers to a nonexisting window. This is be returned by some **DisplayServer** methods if no window matches the requested result. +The ID that refers to a nonexistent window. This is returned by some **DisplayServer** methods if no window matches the requested result. .. rst-class:: classref-section-separator @@ -1444,7 +1456,7 @@ Returns the user's clipboard as an image if possible. Returns the user's `primary `__ clipboard as a string if possible. This is the clipboard that is set when the user selects text in any application, rather than when pressing :kbd:`Ctrl + C`. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism. -\ **Note:** This method is only implemented on Linux (X11). +\ **Note:** This method is only implemented on Linux (X11/Wayland). .. rst-class:: classref-item-separator @@ -1494,7 +1506,7 @@ void **clipboard_set_primary** **(** :ref:`String` clipboard_prima Sets the user's `primary `__ clipboard content to the given string. This is the clipboard that is set when the user selects text in any application, rather than when pressing :kbd:`Ctrl + C`. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism. -\ **Note:** This method is only implemented on Linux (X11). +\ **Note:** This method is only implemented on Linux (X11/Wayland). .. rst-class:: classref-item-separator @@ -1586,11 +1598,9 @@ Allows the ``process_id`` PID to steal focus from this window. In other words, t Displays OS native dialog for selecting files or directories in the file system. -Callbacks have the following arguments: ``bool status, PackedStringArray selected_paths, int selected_filter_index``. +Callbacks have the following arguments: ``status: bool, selected_paths: PackedStringArray, selected_filter_index: int``. -\ **Note:** This method is implemented if the display server has the :ref:`FEATURE_NATIVE_DIALOG` feature. - -\ **Note:** This method is implemented on Linux, Windows and macOS. +\ **Note:** This method is implemented if the display server has the :ref:`FEATURE_NATIVE_DIALOG` feature. Supported platforms include Linux (X11 and Wayland), Windows, and macOS. \ **Note:** ``current_directory`` might be ignored. @@ -1604,6 +1614,38 @@ Callbacks have the following arguments: ``bool status, PackedStringArray selecte ---- +.. _class_DisplayServer_method_file_dialog_with_options_show: + +.. rst-class:: classref-method + +:ref:`Error` **file_dialog_with_options_show** **(** :ref:`String` title, :ref:`String` current_directory, :ref:`String` root, :ref:`String` filename, :ref:`bool` show_hidden, :ref:`FileDialogMode` mode, :ref:`PackedStringArray` filters, :ref:`Dictionary[]` options, :ref:`Callable` callback **)** + +Displays OS native dialog for selecting files or directories in the file system with additional user selectable options. + +\ ``options`` is array of :ref:`Dictionary`\ s with the following keys: + +- ``"name"`` - option's name :ref:`String`. + +- ``"values"`` - :ref:`PackedStringArray` of values. If empty, boolean option (check box) is used. + +- ``"default"`` - default selected option index (:ref:`int`) or default boolean value (:ref:`bool`). + +Callbacks have the following arguments: ``status: bool, selected_paths: PackedStringArray, selected_filter_index: int, selected_option: Dictionary``. + +\ **Note:** This method is implemented if the display server has the :ref:`FEATURE_NATIVE_DIALOG` feature. Supported platforms include Linux (X11 and Wayland), Windows, and macOS. + +\ **Note:** ``current_directory`` might be ignored. + +\ **Note:** On Linux (X11), ``show_hidden`` is ignored. + +\ **Note:** On macOS, native file dialogs have no title. + +\ **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use :ref:`OS.get_granted_permissions` to get a list of saved bookmarks. + +.. rst-class:: classref-item-separator + +---- + .. _class_DisplayServer_method_force_process_and_drop_events: .. rst-class:: classref-method @@ -1676,9 +1718,9 @@ Returns the index of the screen containing the window with the keyboard focus, o :ref:`String` **get_name** **(** **)** |const| -Returns the name of the **DisplayServer** currently in use. Most operating systems only have a single **DisplayServer**, but Linux has access to more than one **DisplayServer** (although only X11 is currently implemented in Godot). +Returns the name of the **DisplayServer** currently in use. Most operating systems only have a single **DisplayServer**, but Linux has access to more than one **DisplayServer** (currently X11 and Wayland). -The names of built-in display servers are ``Windows``, ``macOS``, ``X11`` (Linux), ``Android``, ``iOS``, ``web`` (HTML5) and ``headless`` (when started with the ``--headless`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`). +The names of built-in display servers are ``Windows``, ``macOS``, ``X11`` (Linux), ``Wayland`` (Linux), ``Android``, ``iOS``, ``web`` (HTML5), and ``headless`` (when started with the ``--headless`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`). .. rst-class:: classref-item-separator @@ -1791,6 +1833,9 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -1818,6 +1863,9 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -1845,6 +1893,9 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -1874,6 +1925,9 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -1901,6 +1955,9 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -1932,6 +1989,9 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -1961,6 +2021,9 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -1984,6 +2047,9 @@ Returns index of the inserted item, it's not guaranteed to be the same as ``inde "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -2007,6 +2073,9 @@ Returns index of the inserted item, it's not guaranteed to be the same as ``inde "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -2028,6 +2097,9 @@ Removes all items from the global menu with ID ``menu_root``. "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). .. rst-class:: classref-item-separator @@ -2229,6 +2301,20 @@ Returns the tooltip associated with the specified index ``idx``. ---- +.. _class_DisplayServer_method_global_menu_get_system_menu_roots: + +.. rst-class:: classref-method + +:ref:`Dictionary` **global_menu_get_system_menu_roots** **(** **)** |const| + +Returns Dictionary of supported system menu IDs and names. + +\ **Note:** This method is implemented only on macOS. + +.. rst-class:: classref-item-separator + +---- + .. _class_DisplayServer_method_global_menu_is_item_checkable: .. rst-class:: classref-method @@ -2629,7 +2715,7 @@ Returns the composition string contained within the `Input Method Editor ` index **)** Sets the active keyboard layout. -\ **Note:** This method is implemented on Linux (X11), macOS and Windows. +\ **Note:** This method is implemented on Linux (X11/Wayland), macOS and Windows. .. rst-class:: classref-item-separator @@ -2840,7 +2926,7 @@ Returns the dots per inch density of the specified screen. If ``screen`` is :ref xxhdpi - 480 dpi xxxhdpi - 640 dpi -\ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows. Returns ``72`` on unsupported platforms. +\ **Note:** This method is implemented on Android, Linux (X11/Wayland), macOS and Windows. Returns ``72`` on unsupported platforms. .. rst-class:: classref-item-separator @@ -2927,6 +3013,8 @@ Returns the screen's top-left corner position in pixels. On multi-monitor setups See also :ref:`screen_get_size`. +\ **Note:** On Linux (Wayland) this method always returns ``(0, 0)``. + .. rst-class:: classref-item-separator ---- @@ -3105,6 +3193,14 @@ void **tablet_set_current_driver** **(** :ref:`String` name **)** Set active tablet driver name. +Supported drivers: + +- ``winink``: Windows Ink API, default (Windows 8.1+ required). + +- ``wintab``: Wacom Wintab API (compatible device driver required). + +- ``dummy``: Dummy driver, tablet input is disabled. + \ **Note:** This method is implemented only on Windows. .. rst-class:: classref-item-separator @@ -3129,7 +3225,7 @@ Each :ref:`Dictionary` contains two :ref:`String Note that Godot depends on system libraries for text-to-speech functionality. These libraries are installed by default on Windows and macOS, but not on all Linux distributions. If they are not present, this method will return an empty list. This applies to both Godot users on Linux, as well as end-users on Linux running Godot games that use text-to-speech. -\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech` should be ``true`` to use text-to-speech. @@ -3145,7 +3241,7 @@ Note that Godot depends on system libraries for text-to-speech functionality. Th Returns an :ref:`PackedStringArray` of voice identifiers for the ``language``. -\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech` should be ``true`` to use text-to-speech. @@ -3161,7 +3257,7 @@ Returns an :ref:`PackedStringArray` of voice identifier Returns ``true`` if the synthesizer is in a paused state. -\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech` should be ``true`` to use text-to-speech. @@ -3177,7 +3273,7 @@ Returns ``true`` if the synthesizer is in a paused state. Returns ``true`` if the synthesizer is generating speech, or have utterance waiting in the queue. -\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech` should be ``true`` to use text-to-speech. @@ -3193,7 +3289,7 @@ void **tts_pause** **(** **)** Puts the synthesizer into a paused state. -\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech` should be ``true`` to use text-to-speech. @@ -3209,7 +3305,7 @@ void **tts_resume** **(** **)** Resumes the synthesizer if it was paused. -\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech` should be ``true`` to use text-to-speech. @@ -3231,7 +3327,7 @@ Adds a callback, which is called when the utterance has started, finished, cance \ **Note:** The granularity of the boundary callbacks is engine dependent. -\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech` should be ``true`` to use text-to-speech. @@ -3257,11 +3353,11 @@ Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is clear - ``utterance_id`` is passed as a parameter to the callback functions. -\ **Note:** On Windows and Linux (X11), utterance ``text`` can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling :ref:`tts_speak`. +\ **Note:** On Windows and Linux (X11/Wayland), utterance ``text`` can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling :ref:`tts_speak`. \ **Note:** The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated. -\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech` should be ``true`` to use text-to-speech. @@ -3277,7 +3373,7 @@ void **tts_stop** **(** **)** Stops synthesis in progress and removes all utterances from the queue. -\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows. +\ **Note:** This method is implemented on Android, iOS, Web, Linux (X11/Linux), macOS, and Windows. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech` should be ``true`` to use text-to-speech. @@ -3343,7 +3439,7 @@ void **warp_mouse** **(** :ref:`Vector2i` position **)** Sets the mouse cursor position to the given ``position`` relative to an origin at the upper left corner of the currently focused game Window Manager window. -\ **Note:** :ref:`warp_mouse` is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web. +\ **Note:** :ref:`warp_mouse` is only supported on Windows, macOS, and Linux (X11/Wayland). It has no effect on Android, iOS, and Web. .. rst-class:: classref-item-separator @@ -3453,7 +3549,7 @@ Returns the mode of the given window. Returns internal structure pointers for use in plugins. -\ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows. +\ **Note:** This method is implemented on Android, Linux (X11/Wayland), macOS, and Windows. .. rst-class:: classref-item-separator @@ -3655,7 +3751,7 @@ Sets the ``callback`` that should be called when files are dropped from the oper \ **Warning:** Advanced users only! Adding such a callback to a :ref:`Window` node will override its default implementation, which can introduce bugs. -\ **Note:** This method is implemented on Windows, macOS, Linux (X11) and Web. +\ **Note:** This method is implemented on Windows, macOS, Linux (X11/Wayland), and Web. .. rst-class:: classref-item-separator @@ -3867,6 +3963,8 @@ See also :ref:`window_get_position` instead. +\ **Note:** On Linux (Wayland): this method is a no-op. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_editorexportplatform.rst b/classes/class_editorexportplatform.rst index 2d13cbe28ff..e7abcbb6889 100644 --- a/classes/class_editorexportplatform.rst +++ b/classes/class_editorexportplatform.rst @@ -30,7 +30,7 @@ Used in scripting by :ref:`EditorExportPlugin` to conf Tutorials --------- -- `$DOCS_URL/tutorials/platform/consoles.html `__ +- :doc:`Console support in Godot <../tutorials/platform/consoles>` .. rst-class:: classref-reftable-group diff --git a/classes/class_editorexportplatformandroid.rst b/classes/class_editorexportplatformandroid.rst index 0e7c5ce57f7..2e3b5aedb5b 100644 --- a/classes/class_editorexportplatformandroid.rst +++ b/classes/class_editorexportplatformandroid.rst @@ -834,7 +834,13 @@ If ``true``, package signing is enabled. :ref:`String` **package/unique_name** -Unique application identifier in a reverse-DNS format, can only contain alphanumeric characters (``A-Z``, ``a-z``, and ``0-9``), hyphens (``-``), and periods (``.``). +Unique application identifier in a reverse-DNS format. The reverse DNS format should preferably match a domain name you control, but this is not strictly required. For instance, if you own ``example.com``, your package unique name should preferably be of the form ``com.example.mygame``. This identifier can only contain lowercase alphanumeric characters (``a-z``, and ``0-9``), underscores (``_``), and periods (``.``). Each component of the reverse DNS format must start with a letter: for instance, ``com.example.8game`` is not valid. + +If ``$genname`` is present in the value, it will be replaced by the project name converted to lowercase. If there are invalid characters in the project name, they will be stripped. If all characters in the project name are stripped, ``$genname`` is replaced by ``noname``. + +\ **Note:** Changing the package name will cause the package to be considered as a new package, with its own installation and data paths. The new package won't be usable to update existing installations. + +\ **Note:** When publishing to Google Play, the package name must be *globally* unique. This means no other apps published on Google Play must be using the same package name as yours. Otherwise, you'll be prevented from publishing your app on Google Play. .. rst-class:: classref-item-separator diff --git a/classes/class_editorexportplatformios.rst b/classes/class_editorexportplatformios.rst index 87d7574541f..054fb517425 100644 --- a/classes/class_editorexportplatformios.rst +++ b/classes/class_editorexportplatformios.rst @@ -31,6 +31,8 @@ Properties .. table:: :widths: auto + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`application/additional_plist_content` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`application/app_store_team_id` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -48,7 +50,7 @@ Properties +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`application/icon_interpolation` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`application/launch_screens_interpolation` | + | :ref:`String` | :ref:`application/min_ios_version` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`application/provisioning_profile_uuid_debug` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -66,6 +68,10 @@ Properties +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`capabilities/access_wifi` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`capabilities/performance_a12` | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`capabilities/performance_gaming_tier` | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`capabilities/push_notifications` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`custom_template/debug` | @@ -96,28 +102,6 @@ Properties +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`icons/spotlight_80x80` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`landscape_launch_screens/ipad_1024x768` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`landscape_launch_screens/ipad_2048x1536` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`landscape_launch_screens/iphone_2208x1242` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`landscape_launch_screens/iphone_2436x1125` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`portrait_launch_screens/ipad_768x1024` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`portrait_launch_screens/ipad_1536x2048` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`portrait_launch_screens/iphone_640x960` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`portrait_launch_screens/iphone_640x1136` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`portrait_launch_screens/iphone_750x1334` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`portrait_launch_screens/iphone_1125x2436` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`portrait_launch_screens/iphone_1242x2208` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`privacy/camera_usage_description` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`privacy/camera_usage_description_localized` | @@ -140,8 +124,6 @@ Properties +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`storyboard/use_custom_bg_color` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`storyboard/use_launch_screen_storyboard` | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`user_data/accessible_from_files_app` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`user_data/accessible_from_itunes_sharing` | @@ -156,6 +138,23 @@ Properties Property Descriptions --------------------- +.. _class_EditorExportPlatformIOS_property_application/additional_plist_content: + +.. rst-class:: classref-property + +:ref:`String` **application/additional_plist_content** + +Additional data added to the root ```` section of the `Info.plist `__ file. The value should be an XML section with pairs of key-value elements, e.g.: + +:: + + key_name + value + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorExportPlatformIOS_property_application/app_store_team_id: .. rst-class:: classref-property @@ -252,13 +251,13 @@ Interpolation method used to resize application icon. ---- -.. _class_EditorExportPlatformIOS_property_application/launch_screens_interpolation: +.. _class_EditorExportPlatformIOS_property_application/min_ios_version: .. rst-class:: classref-property -:ref:`int` **application/launch_screens_interpolation** +:ref:`String` **application/min_ios_version** -Interpolation method used to resize launch screen images. +Minimum version of iOS required for this application to run in the ``major.minor.patch`` or ``major.minor`` format, can only contain numeric characters (``0-9``) and periods (``.``). .. rst-class:: classref-item-separator @@ -364,6 +363,34 @@ If ``true``, networking features related to Wi-Fi access are enabled. See `Requi ---- +.. _class_EditorExportPlatformIOS_property_capabilities/performance_a12: + +.. rst-class:: classref-property + +:ref:`bool` **capabilities/performance_a12** + +Requires the graphics performance and features of the A12 Bionic and later chips (devices supporting all Vulkan renderer features). + +Enabling this option limits supported devices to: iPhone XS, iPhone XR, iPad Mini (5th gen.), iPad Air (3rd gen.), iPad (8th gen) and newer. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorExportPlatformIOS_property_capabilities/performance_gaming_tier: + +.. rst-class:: classref-property + +:ref:`bool` **capabilities/performance_gaming_tier** + +Requires the graphics performance and features of the A17 Pro and later chips. + +Enabling this option limits supported devices to: iPhone 15 Pro and newer. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorExportPlatformIOS_property_capabilities/push_notifications: .. rst-class:: classref-property @@ -544,138 +571,6 @@ Spotlight icon file on iPad and iPhone (2x DPI). If left empty, it will fallback ---- -.. _class_EditorExportPlatformIOS_property_landscape_launch_screens/ipad_1024x768: - -.. rst-class:: classref-property - -:ref:`String` **landscape_launch_screens/ipad_1024x768** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_landscape_launch_screens/ipad_2048x1536: - -.. rst-class:: classref-property - -:ref:`String` **landscape_launch_screens/ipad_2048x1536** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_landscape_launch_screens/iphone_2208x1242: - -.. rst-class:: classref-property - -:ref:`String` **landscape_launch_screens/iphone_2208x1242** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_landscape_launch_screens/iphone_2436x1125: - -.. rst-class:: classref-property - -:ref:`String` **landscape_launch_screens/iphone_2436x1125** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_portrait_launch_screens/ipad_768x1024: - -.. rst-class:: classref-property - -:ref:`String` **portrait_launch_screens/ipad_768x1024** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_portrait_launch_screens/ipad_1536x2048: - -.. rst-class:: classref-property - -:ref:`String` **portrait_launch_screens/ipad_1536x2048** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_portrait_launch_screens/iphone_640x960: - -.. rst-class:: classref-property - -:ref:`String` **portrait_launch_screens/iphone_640x960** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_portrait_launch_screens/iphone_640x1136: - -.. rst-class:: classref-property - -:ref:`String` **portrait_launch_screens/iphone_640x1136** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_portrait_launch_screens/iphone_750x1334: - -.. rst-class:: classref-property - -:ref:`String` **portrait_launch_screens/iphone_750x1334** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_portrait_launch_screens/iphone_1125x2436: - -.. rst-class:: classref-property - -:ref:`String` **portrait_launch_screens/iphone_1125x2436** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_EditorExportPlatformIOS_property_portrait_launch_screens/iphone_1242x2208: - -.. rst-class:: classref-property - -:ref:`String` **portrait_launch_screens/iphone_1242x2208** - -Application launch screen image file. If left empty, it will fallback to :ref:`ProjectSettings.application/boot_splash/image`. - -.. rst-class:: classref-item-separator - ----- - .. _class_EditorExportPlatformIOS_property_privacy/camera_usage_description: .. rst-class:: classref-property @@ -808,18 +703,6 @@ If ``true``, :ref:`storyboard/custom_bg_color` **storyboard/use_launch_screen_storyboard** - -If ``true``, storyboard launch screen is used instead of launch screen images. - -.. rst-class:: classref-item-separator - ----- - .. _class_EditorExportPlatformIOS_property_user_data/accessible_from_files_app: .. rst-class:: classref-property diff --git a/classes/class_editorexportplatformmacos.rst b/classes/class_editorexportplatformmacos.rst index f0dd193e29a..798c79e2f38 100644 --- a/classes/class_editorexportplatformmacos.rst +++ b/classes/class_editorexportplatformmacos.rst @@ -31,6 +31,8 @@ Properties .. table:: :widths: auto + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`application/additional_plist_content` | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`application/app_category` | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -222,6 +224,23 @@ Properties Property Descriptions --------------------- +.. _class_EditorExportPlatformMacOS_property_application/additional_plist_content: + +.. rst-class:: classref-property + +:ref:`String` **application/additional_plist_content** + +Additional data added to the root ```` section of the `Info.plist `__ file. The value should be an XML section with pairs of key-value elements, e.g.: + +:: + + key_name + value + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorExportPlatformMacOS_property_application/app_category: .. rst-class:: classref-property diff --git a/classes/class_editorexportplatformweb.rst b/classes/class_editorexportplatformweb.rst index 3d661d43230..aca87a052d4 100644 --- a/classes/class_editorexportplatformweb.rst +++ b/classes/class_editorexportplatformweb.rst @@ -66,6 +66,8 @@ Properties +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`variant/extensions_support` | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`variant/thread_support` | + +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`vram_texture_compression/for_desktop` | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`vram_texture_compression/for_mobile` | @@ -312,6 +314,20 @@ The canvas resize policy determines how the canvas should be resized by Godot. ---- +.. _class_EditorExportPlatformWeb_property_variant/thread_support: + +.. rst-class:: classref-property + +:ref:`bool` **variant/thread_support** + +If enabled, the exported game will support threads. It requires `a "cross-origin isolated" website `__, which can be difficult to setup and brings some limitations (e.g. not being able to communicate with third-party websites). + +If disabled, the exported game will not support threads. As a result, it is more prone to performance and audio issues, but will only require to be run on a HTTPS website. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorExportPlatformWeb_property_vram_texture_compression/for_desktop: .. rst-class:: classref-property diff --git a/classes/class_editorimportplugin.rst b/classes/class_editorimportplugin.rst index 06e16c135e4..7f1f051cd21 100644 --- a/classes/class_editorimportplugin.rst +++ b/classes/class_editorimportplugin.rst @@ -154,6 +154,8 @@ Methods .. table:: :widths: auto + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`_can_import_threaded` **(** **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary[]` | :ref:`_get_import_options` **(** :ref:`String` path, :ref:`int` preset_index **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -191,6 +193,20 @@ Methods Method Descriptions ------------------- +.. _class_EditorImportPlugin_private_method__can_import_threaded: + +.. rst-class:: classref-method + +:ref:`bool` **_can_import_threaded** **(** **)** |virtual| |const| + +Tells whether this importer can be run in parallel on threads, or, on the contrary, it's only safe for the editor to call it from the main thread, for one file at a time. + +If this method is not overridden, it will return ``true`` by default (i.e., safe for parallel importing). + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorImportPlugin_private_method__get_import_options: .. rst-class:: classref-method diff --git a/classes/class_editorinspector.rst b/classes/class_editorinspector.rst index 98b057acd41..07c50c9094e 100644 --- a/classes/class_editorinspector.rst +++ b/classes/class_editorinspector.rst @@ -39,6 +39,8 @@ Properties .. table:: :widths: auto + +----------------------------------------------------+------------------------+-------------------------------------------------------------------------------------------------+ + | :ref:`bool` | follow_focus | ``true`` (overrides :ref:`ScrollContainer`) | +----------------------------------------------------+------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`ScrollMode` | horizontal_scroll_mode | ``0`` (overrides :ref:`ScrollContainer`) | +----------------------------------------------------+------------------------+-------------------------------------------------------------------------------------------------+ diff --git a/classes/class_editorinterface.rst b/classes/class_editorinterface.rst index fc3f8b45282..5663fb60291 100644 --- a/classes/class_editorinterface.rst +++ b/classes/class_editorinterface.rst @@ -59,103 +59,109 @@ Methods .. table:: :widths: auto - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | 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` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorCommandPalette` | :ref:`get_command_palette` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_current_directory` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_current_feature_profile` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_current_path` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Node` | :ref:`get_edited_scene_root` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`VBoxContainer` | :ref:`get_editor_main_screen` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorPaths` | :ref:`get_editor_paths` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_editor_scale` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorSettings` | :ref:`get_editor_settings` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Theme` | :ref:`get_editor_theme` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`SubViewport` | :ref:`get_editor_viewport_2d` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`SubViewport` | :ref:`get_editor_viewport_3d` **(** :ref:`int` idx=0 **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`FileSystemDock` | :ref:`get_file_system_dock` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorInspector` | :ref:`get_inspector` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_open_scenes` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_playing_scene` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorFileSystem` | :ref:`get_resource_filesystem` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorResourcePreview` | :ref:`get_resource_previewer` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`ScriptEditor` | :ref:`get_script_editor` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`get_selected_paths` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`EditorSelection` | :ref:`get_selection` **(** **)** |const| | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | 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:`Texture2D[]` | :ref:`make_mesh_previews` **(** :ref:`Mesh[]` meshes, :ref:`int` preview_size **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`mark_scene_as_unsaved` **(** **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | 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:`popup_dialog` **(** :ref:`Window` dialog, :ref:`Rect2i` rect=Rect2i(0, 0, 0, 0) **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`popup_dialog_centered` **(** :ref:`Window` dialog, :ref:`Vector2i` minsize=Vector2i(0, 0) **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`popup_dialog_centered_clamped` **(** :ref:`Window` dialog, :ref:`Vector2i` minsize=Vector2i(0, 0), :ref:`float` fallback_ratio=0.75 **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`popup_dialog_centered_ratio` **(** :ref:`Window` dialog, :ref:`float` ratio=0.8 **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`reload_scene_from_path` **(** :ref:`String` scene_filepath **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`restart_editor` **(** :ref:`bool` save=true **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`save_all_scenes` **(** **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :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_current_feature_profile` **(** :ref:`String` profile_name **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | 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` **(** **)** | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | 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` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorCommandPalette` | :ref:`get_command_palette` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_current_directory` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_current_feature_profile` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_current_path` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Node` | :ref:`get_edited_scene_root` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`VBoxContainer` | :ref:`get_editor_main_screen` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorPaths` | :ref:`get_editor_paths` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_editor_scale` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorSettings` | :ref:`get_editor_settings` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Theme` | :ref:`get_editor_theme` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`SubViewport` | :ref:`get_editor_viewport_2d` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`SubViewport` | :ref:`get_editor_viewport_3d` **(** :ref:`int` idx=0 **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`FileSystemDock` | :ref:`get_file_system_dock` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorInspector` | :ref:`get_inspector` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_open_scenes` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_playing_scene` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorFileSystem` | :ref:`get_resource_filesystem` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorResourcePreview` | :ref:`get_resource_previewer` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`ScriptEditor` | :ref:`get_script_editor` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_selected_paths` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`EditorSelection` | :ref:`get_selection` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`inspect_object` **(** :ref:`Object` object, :ref:`String` for_property="", :ref:`bool` inspector_only=false **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_multi_window_enabled` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_playing_scene` **(** **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_plugin_enabled` **(** :ref:`String` plugin **)** |const| | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Texture2D[]` | :ref:`make_mesh_previews` **(** :ref:`Mesh[]` meshes, :ref:`int` preview_size **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`mark_scene_as_unsaved` **(** **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | 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:`popup_dialog` **(** :ref:`Window` dialog, :ref:`Rect2i` rect=Rect2i(0, 0, 0, 0) **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`popup_dialog_centered` **(** :ref:`Window` dialog, :ref:`Vector2i` minsize=Vector2i(0, 0) **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`popup_dialog_centered_clamped` **(** :ref:`Window` dialog, :ref:`Vector2i` minsize=Vector2i(0, 0), :ref:`float` fallback_ratio=0.75 **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`popup_dialog_centered_ratio` **(** :ref:`Window` dialog, :ref:`float` ratio=0.8 **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`popup_node_selector` **(** :ref:`Callable` callback, :ref:`StringName[]` valid_types=[] **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`popup_property_selector` **(** :ref:`Object` object, :ref:`Callable` callback, :ref:`PackedInt32Array` type_filter=PackedInt32Array() **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`reload_scene_from_path` **(** :ref:`String` scene_filepath **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`restart_editor` **(** :ref:`bool` save=true **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`save_all_scenes` **(** **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :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_current_feature_profile` **(** :ref:`String` profile_name **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | 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` **(** **)** | + +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -329,6 +335,8 @@ Returns the edited (current) scene's root :ref:`Node`. Returns the editor control responsible for main screen plugins and tools. Use it with plugins that implement :ref:`EditorPlugin._has_main_screen`. +\ **Note:** This node is a :ref:`VBoxContainer`, which means that if you add a :ref:`Control` child to it, you need to set the child's :ref:`Control.size_flags_vertical` to :ref:`Control.SIZE_EXPAND_FILL` to make it use the full available space. + \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. .. rst-class:: classref-item-separator @@ -537,6 +545,24 @@ Shows the given property on the given ``object`` in the editor's Inspector dock. ---- +.. _class_EditorInterface_method_is_multi_window_enabled: + +.. rst-class:: classref-method + +:ref:`bool` **is_multi_window_enabled** **(** **)** |const| + +Returns ``true`` if multiple window support is enabled in the editor. Multiple window support is enabled if *all* of these statements are true: + +- :ref:`EditorSettings.interface/multi_window/enable` is ``true``. + +- :ref:`EditorSettings.interface/editor/single_window_mode` is ``false``. + +- :ref:`Viewport.gui_embed_subwindows` is ``false``. This is forced to ``true`` on platforms that don't support multiple windows such as Web, or when the ``--single-window`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>` is used. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorInterface_method_is_playing_scene: .. rst-class:: classref-method @@ -689,6 +715,58 @@ See also :ref:`Window.set_unparent_when_invisible` callback, :ref:`StringName[]` valid_types=[] **)** + +Pops up an editor dialog for selecting a :ref:`Node` from the edited scene. The ``callback`` must take a single argument of type :ref:`NodePath`. It is called on the selected :ref:`NodePath` or the empty path ``^""`` if the dialog is canceled. If ``valid_types`` is provided, the dialog will only show Nodes that match one of the listed Node types. + +\ **Example:**\ + +:: + + func _ready(): + if Engine.is_editor_hint(): + EditorInterface.popup_node_selector(_on_node_selected, ["Button"]) + + func _on_node_selected(node_path): + if node_path.is_empty(): + print("node selection canceled") + else: + print("selected ", node_path) + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorInterface_method_popup_property_selector: + +.. rst-class:: classref-method + +void **popup_property_selector** **(** :ref:`Object` object, :ref:`Callable` callback, :ref:`PackedInt32Array` type_filter=PackedInt32Array() **)** + +Pops up an editor dialog for selecting properties from ``object``. The ``callback`` must take a single argument of type :ref:`NodePath`. It is called on the selected property path (see :ref:`NodePath.get_as_property_path`) or the empty path ``^""`` if the dialog is canceled. If ``type_filter`` is provided, the dialog will only show properties that match one of the listed :ref:`Variant.Type` values. + +\ **Example:**\ + +:: + + func _ready(): + if Engine.is_editor_hint(): + EditorInterface.popup_property_selector(this, _on_property_selected, [TYPE_INT]) + + func _on_property_selected(property_path): + if property_path.is_empty(): + print("property selection canceled") + else: + print("selected ", property_path) + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorInterface_method_reload_scene_from_path: .. rst-class:: classref-method diff --git a/classes/class_editornode3dgizmo.rst b/classes/class_editornode3dgizmo.rst index 386ed1a4dc7..42280cd0d77 100644 --- a/classes/class_editornode3dgizmo.rst +++ b/classes/class_editornode3dgizmo.rst @@ -29,6 +29,8 @@ Methods .. table:: :widths: auto + +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_begin_handle_action` **(** :ref:`int` id, :ref:`bool` secondary **)** |virtual| | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_commit_handle` **(** :ref:`int` id, :ref:`bool` secondary, :ref:`Variant` restore, :ref:`bool` cancel **)** |virtual| | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -88,6 +90,20 @@ Methods Method Descriptions ------------------- +.. _class_EditorNode3DGizmo_private_method__begin_handle_action: + +.. rst-class:: classref-method + +void **_begin_handle_action** **(** :ref:`int` id, :ref:`bool` secondary **)** |virtual| + +.. container:: contribute + + There is currently no description for this method. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorNode3DGizmo_private_method__commit_handle: .. rst-class:: classref-method diff --git a/classes/class_editornode3dgizmoplugin.rst b/classes/class_editornode3dgizmoplugin.rst index 864e371402d..80c802252b0 100644 --- a/classes/class_editornode3dgizmoplugin.rst +++ b/classes/class_editornode3dgizmoplugin.rst @@ -38,6 +38,8 @@ Methods .. table:: :widths: auto + +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_begin_handle_action` **(** :ref:`EditorNode3DGizmo` gizmo, :ref:`int` handle_id, :ref:`bool` secondary **)** |virtual| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_can_be_hidden` **(** **)** |virtual| |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -93,6 +95,20 @@ Methods Method Descriptions ------------------- +.. _class_EditorNode3DGizmoPlugin_private_method__begin_handle_action: + +.. rst-class:: classref-method + +void **_begin_handle_action** **(** :ref:`EditorNode3DGizmo` gizmo, :ref:`int` handle_id, :ref:`bool` secondary **)** |virtual| + +.. container:: contribute + + There is currently no description for this method. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorNode3DGizmoPlugin_private_method__can_be_hidden: .. rst-class:: classref-method diff --git a/classes/class_editorplugin.rst b/classes/class_editorplugin.rst index e07b9af2433..0c87f971f14 100644 --- a/classes/class_editorplugin.rst +++ b/classes/class_editorplugin.rst @@ -217,7 +217,7 @@ Emitted when any project setting has changed. **resource_saved** **(** :ref:`Resource` resource **)** -Emitted when the given ``resource`` was saved on disc. +Emitted when the given ``resource`` was saved on disc. See also :ref:`scene_saved`. .. rst-class:: classref-item-separator @@ -241,7 +241,19 @@ Emitted when the scene is changed in the editor. The argument will return the ro **scene_closed** **(** :ref:`String` filepath **)** -Emitted when user closes a scene. The argument is file path to a closed scene. +Emitted when user closes a scene. The argument is a file path to the closed scene. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorPlugin_signal_scene_saved: + +.. rst-class:: classref-signal + +**scene_saved** **(** :ref:`String` filepath **)** + +Emitted when a scene was saved on disc. The argument is a file path to the saved scene. See also :ref:`resource_saved`. .. rst-class:: classref-section-separator @@ -956,7 +968,7 @@ Use :ref:`_set_window_layout` and :ref:`_make_visible` called when the editor requests them. If you have declared the methods :ref:`_forward_canvas_gui_input` and :ref:`_forward_3d_gui_input` these will be called too. -\ **Note:** Each plugin should handle only one type of objects at a time. If a plugin handes more types of objects and they are edited at the same time, it will result in errors. +\ **Note:** Each plugin should handle only one type of objects at a time. If a plugin handles more types of objects and they are edited at the same time, it will result in errors. .. rst-class:: classref-item-separator @@ -970,7 +982,7 @@ Implement this function if your plugin edits a specific type of object (Resource Returns ``true`` if this is a main screen editor plugin (it goes in the workspace selector together with **2D**, **3D**, **Script** and **AssetLib**). -When the plugin's workspace is selected, other main screen plugins will be hidden, but your plugin will not appear automatically. It needs to be added as a child of :ref:`EditorInterface.get_base_control` and made visible inside :ref:`_make_visible`. +When the plugin's workspace is selected, other main screen plugins will be hidden, but your plugin will not appear automatically. It needs to be added as a child of :ref:`EditorInterface.get_editor_main_screen` and made visible inside :ref:`_make_visible`. Use :ref:`_get_plugin_name` and :ref:`_get_plugin_icon` to customize the plugin button's appearance. diff --git a/classes/class_editorproperty.rst b/classes/class_editorproperty.rst index b37f4d12330..b13bfa3a641 100644 --- a/classes/class_editorproperty.rst +++ b/classes/class_editorproperty.rst @@ -29,21 +29,23 @@ Properties .. table:: :widths: auto - +-----------------------------+-----------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`checkable` | ``false`` | - +-----------------------------+-----------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`checked` | ``false`` | - +-----------------------------+-----------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`deletable` | ``false`` | - +-----------------------------+-----------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`draw_warning` | ``false`` | - +-----------------------------+-----------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`keying` | ``false`` | - +-----------------------------+-----------------------------------------------------------------+-----------+ - | :ref:`String` | :ref:`label` | ``""`` | - +-----------------------------+-----------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`read_only` | ``false`` | - +-----------------------------+-----------------------------------------------------------------+-----------+ + +-----------------------------+-----------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`checkable` | ``false`` | + +-----------------------------+-----------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`checked` | ``false`` | + +-----------------------------+-----------------------------------------------------------------------------------+-----------+ + | :ref:`String` | :ref:`configuration_warning` | ``""`` | + +-----------------------------+-----------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`deletable` | ``false`` | + +-----------------------------+-----------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`draw_warning` | ``false`` | + +-----------------------------+-----------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`keying` | ``false`` | + +-----------------------------+-----------------------------------------------------------------------------------+-----------+ + | :ref:`String` | :ref:`label` | ``""`` | + +-----------------------------+-----------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`read_only` | ``false`` | + +-----------------------------+-----------------------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group @@ -253,6 +255,23 @@ Used by the inspector, set to ``true`` when the property is checked. ---- +.. _class_EditorProperty_property_configuration_warning: + +.. rst-class:: classref-property + +:ref:`String` **configuration_warning** = ``""`` + +.. rst-class:: classref-property-setget + +- void **set_configuration_warning** **(** :ref:`String` value **)** +- :ref:`String` **get_configuration_warning** **(** **)** + +Used by the inspector, set to show a configuration warning on the property. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorProperty_property_deletable: .. rst-class:: classref-property diff --git a/classes/class_editorsceneformatimporter.rst b/classes/class_editorsceneformatimporter.rst index 2bd45a54496..73b7b0fdf03 100644 --- a/classes/class_editorsceneformatimporter.rst +++ b/classes/class_editorsceneformatimporter.rst @@ -60,6 +60,10 @@ Constants **IMPORT_SCENE** = ``1`` +.. container:: contribute + + There is currently no description for this constant. Please help us by :ref:`contributing one `! + .. _class_EditorSceneFormatImporter_constant_IMPORT_ANIMATION: @@ -68,6 +72,10 @@ Constants **IMPORT_ANIMATION** = ``2`` +.. container:: contribute + + There is currently no description for this constant. Please help us by :ref:`contributing one `! + .. _class_EditorSceneFormatImporter_constant_IMPORT_FAIL_ON_MISSING_DEPENDENCIES: @@ -76,6 +84,10 @@ Constants **IMPORT_FAIL_ON_MISSING_DEPENDENCIES** = ``4`` +.. container:: contribute + + There is currently no description for this constant. Please help us by :ref:`contributing one `! + .. _class_EditorSceneFormatImporter_constant_IMPORT_GENERATE_TANGENT_ARRAYS: @@ -84,6 +96,10 @@ Constants **IMPORT_GENERATE_TANGENT_ARRAYS** = ``8`` +.. container:: contribute + + There is currently no description for this constant. Please help us by :ref:`contributing one `! + .. _class_EditorSceneFormatImporter_constant_IMPORT_USE_NAMED_SKIN_BINDS: @@ -92,6 +108,10 @@ Constants **IMPORT_USE_NAMED_SKIN_BINDS** = ``16`` +.. container:: contribute + + There is currently no description for this constant. Please help us by :ref:`contributing one `! + .. _class_EditorSceneFormatImporter_constant_IMPORT_DISCARD_MESHES_AND_MATERIALS: @@ -100,6 +120,10 @@ Constants **IMPORT_DISCARD_MESHES_AND_MATERIALS** = ``32`` +.. container:: contribute + + There is currently no description for this constant. Please help us by :ref:`contributing one `! + .. _class_EditorSceneFormatImporter_constant_IMPORT_FORCE_DISABLE_MESH_COMPRESSION: @@ -108,6 +132,10 @@ Constants **IMPORT_FORCE_DISABLE_MESH_COMPRESSION** = ``64`` +.. container:: contribute + + There is currently no description for this constant. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator diff --git a/classes/class_editorsceneformatimporterblend.rst b/classes/class_editorsceneformatimporterblend.rst index cf4875a8a8d..aa111436f36 100644 --- a/classes/class_editorsceneformatimporterblend.rst +++ b/classes/class_editorsceneformatimporterblend.rst @@ -21,7 +21,7 @@ Description Imports Blender scenes in the ``.blend`` file format through the glTF 2.0 3D import pipeline. This importer requires Blender to be installed by the user, so that it can be used to export the scene as glTF 2.0. -The location of the Blender binary is set via the ``filesystem/import/blender/blender3_path`` editor setting. +The location of the Blender binary is set via the ``filesystem/import/blender/blender_path`` editor setting. This importer is only used if :ref:`ProjectSettings.filesystem/import/blender/enabled` is enabled, otherwise ``.blend`` files present in the project folder are not imported. diff --git a/classes/class_editorscenepostimportplugin.rst b/classes/class_editorscenepostimportplugin.rst index 90c4cfd2c61..0e6148ff7a8 100644 --- a/classes/class_editorscenepostimportplugin.rst +++ b/classes/class_editorscenepostimportplugin.rst @@ -74,6 +74,10 @@ enum **InternalImportCategory**: :ref:`InternalImportCategory` **INTERNAL_IMPORT_CATEGORY_NODE** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_EditorScenePostImportPlugin_constant_INTERNAL_IMPORT_CATEGORY_MESH_3D_NODE: @@ -82,6 +86,10 @@ enum **InternalImportCategory**: :ref:`InternalImportCategory` **INTERNAL_IMPORT_CATEGORY_MESH_3D_NODE** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_EditorScenePostImportPlugin_constant_INTERNAL_IMPORT_CATEGORY_MESH: @@ -90,6 +98,10 @@ enum **InternalImportCategory**: :ref:`InternalImportCategory` **INTERNAL_IMPORT_CATEGORY_MESH** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_EditorScenePostImportPlugin_constant_INTERNAL_IMPORT_CATEGORY_MATERIAL: @@ -98,6 +110,10 @@ enum **InternalImportCategory**: :ref:`InternalImportCategory` **INTERNAL_IMPORT_CATEGORY_MATERIAL** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_EditorScenePostImportPlugin_constant_INTERNAL_IMPORT_CATEGORY_ANIMATION: @@ -106,6 +122,10 @@ enum **InternalImportCategory**: :ref:`InternalImportCategory` **INTERNAL_IMPORT_CATEGORY_ANIMATION** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_EditorScenePostImportPlugin_constant_INTERNAL_IMPORT_CATEGORY_ANIMATION_NODE: @@ -114,6 +134,10 @@ enum **InternalImportCategory**: :ref:`InternalImportCategory` **INTERNAL_IMPORT_CATEGORY_ANIMATION_NODE** = ``5`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_EditorScenePostImportPlugin_constant_INTERNAL_IMPORT_CATEGORY_SKELETON_3D_NODE: @@ -122,6 +146,10 @@ enum **InternalImportCategory**: :ref:`InternalImportCategory` **INTERNAL_IMPORT_CATEGORY_SKELETON_3D_NODE** = ``6`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_EditorScenePostImportPlugin_constant_INTERNAL_IMPORT_CATEGORY_MAX: @@ -130,6 +158,10 @@ enum **InternalImportCategory**: :ref:`InternalImportCategory` **INTERNAL_IMPORT_CATEGORY_MAX** = ``7`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst index 1c51943a532..8bd34e7c07e 100644 --- a/classes/class_editorsettings.rst +++ b/classes/class_editorsettings.rst @@ -61,6 +61,8 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`debugger/auto_switch_to_remote_scene_tree` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`debugger/profile_native_calls` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debugger/profiler_frame_history_size` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debugger/profiler_frame_max_functions` | @@ -231,6 +233,10 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`filesystem/external_programs/raster_image_editor` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`filesystem/external_programs/terminal_emulator` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`filesystem/external_programs/terminal_emulator_flags` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`filesystem/external_programs/vector_image_editor` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`filesystem/file_dialog/display_mode` | @@ -239,7 +245,7 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`filesystem/file_dialog/thumbnail_size` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`filesystem/import/blender/blender3_path` | + | :ref:`String` | :ref:`filesystem/import/blender/blender_path` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`filesystem/import/blender/rpc_port` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -305,10 +311,14 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`interface/editor/single_window_mode` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`interface/editor/ui_layout_direction` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`interface/editor/unfocused_low_processor_mode_sleep_usec` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`interface/editor/use_embedded_menu` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`interface/editor/vsync_mode` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`interface/inspector/float_drag_speed` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`interface/inspector/max_array_dictionary_items_per_page` | @@ -331,10 +341,12 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`interface/theme/accent_color` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`interface/theme/additional_spacing` | + | :ref:`int` | :ref:`interface/theme/additional_spacing` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`interface/theme/base_color` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`interface/theme/base_spacing` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`interface/theme/border_size` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`interface/theme/contrast` | @@ -353,6 +365,8 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`interface/theme/relationship_line_opacity` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`interface/theme/spacing_preset` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`interface/touchscreen/enable_long_press_as_right_click` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`interface/touchscreen/enable_pan_and_scale_gestures` | @@ -361,6 +375,8 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`interface/touchscreen/scale_gizmo_handles` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`network/connection/network_mode` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`network/debug/remote_host` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`network/debug/remote_port` | @@ -385,6 +401,8 @@ Properties +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`run/output/font_size` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`run/platforms/linuxbsd/prefer_wayland` | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`run/window_placement/android_window` | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`run/window_placement/rect` | @@ -669,6 +687,18 @@ If ``true``, automatically switches to the **Remote** scene tree when running th ---- +.. _class_EditorSettings_property_debugger/profile_native_calls: + +.. rst-class:: classref-property + +:ref:`bool` **debugger/profile_native_calls** + +If ``true``, enables collection of profiling data from non-GDScript Godot functions, such as engine class methods. Enabling this slows execution while profiling further. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_debugger/profiler_frame_history_size: .. rst-class:: classref-property @@ -959,7 +989,9 @@ The color of the viewport border in the 2D editor. This border represents the vi :ref:`float` **editors/3d/default_fov** -The default camera field of view to use in the 3D editor (in degrees). The camera field of view can be adjusted on a per-scene basis using the **View** menu at the top of the 3D editor. If a scene had its camera field of view adjusted using the **View** menu, this setting is ignored in the scene in question. This setting is also ignored while a Camera3D node is being previewed in the editor. +The default camera vertical field of view to use in the 3D editor (in degrees). The camera field of view can be adjusted on a per-scene basis using the **View** menu at the top of the 3D editor. If a scene had its camera field of view adjusted using the **View** menu, this setting is ignored in the scene in question. This setting is also ignored while a :ref:`Camera3D` node is being previewed in the editor. + +\ **Note:** The editor camera always uses the **Keep Height** aspect mode. .. rst-class:: classref-item-separator @@ -971,7 +1003,7 @@ The default camera field of view to use in the 3D editor (in degrees). The camer :ref:`float` **editors/3d/default_z_far** -The default camera far clip distance to use in the 3D editor (in degrees). Higher values make it possible to view objects placed further away from the camera, at the cost of lower precision in the depth buffer (which can result in visible Z-fighting in the distance). The camera far clip distance can be adjusted on a per-scene basis using the **View** menu at the top of the 3D editor. If a scene had its camera far clip distance adjusted using the **View** menu, this setting is ignored in the scene in question. This setting is also ignored while a Camera3D node is being previewed in the editor. +The default camera far clip distance to use in the 3D editor (in degrees). Higher values make it possible to view objects placed further away from the camera, at the cost of lower precision in the depth buffer (which can result in visible Z-fighting in the distance). The camera far clip distance can be adjusted on a per-scene basis using the **View** menu at the top of the 3D editor. If a scene had its camera far clip distance adjusted using the **View** menu, this setting is ignored in the scene in question. This setting is also ignored while a :ref:`Camera3D` node is being previewed in the editor. .. rst-class:: classref-item-separator @@ -983,7 +1015,7 @@ The default camera far clip distance to use in the 3D editor (in degrees). Highe :ref:`float` **editors/3d/default_z_near** -The default camera near clip distance to use in the 3D editor (in degrees). Lower values make it possible to view objects placed closer to the camera, at the cost of lower precision in the depth buffer (which can result in visible Z-fighting in the distance). The camera near clip distance can be adjusted on a per-scene basis using the **View** menu at the top of the 3D editor. If a scene had its camera near clip distance adjusted using the **View** menu, this setting is ignored in the scene in question. This setting is also ignored while a Camera3D node is being previewed in the editor. +The default camera near clip distance to use in the 3D editor (in degrees). Lower values make it possible to view objects placed closer to the camera, at the cost of lower precision in the depth buffer (which can result in visible Z-fighting in the distance). The camera near clip distance can be adjusted on a per-scene basis using the **View** menu at the top of the 3D editor. If a scene had its camera near clip distance adjusted using the **View** menu, this setting is ignored in the scene in question. This setting is also ignored while a :ref:`Camera3D` node is being previewed in the editor. .. rst-class:: classref-item-separator @@ -1735,6 +1767,48 @@ The program that opens raster image files when clicking "Open in External Progra ---- +.. _class_EditorSettings_property_filesystem/external_programs/terminal_emulator: + +.. rst-class:: classref-property + +:ref:`String` **filesystem/external_programs/terminal_emulator** + +The terminal emulator program to use when using **Open in Terminal** context menu action in the FileSystem dock. You can enter an absolute path to a program binary, or a path to a program that is present in the ``PATH`` environment variable. + +If left empty, Godot will use the default terminal emulator for the system: + +- **Windows:** PowerShell + +- **macOS:** Terminal.app + +- **Linux:** The first terminal found on the system in this order: gnome-terminal, konsole, xfce4-terminal, lxterminal, kitty, alacritty, urxvt, xterm. + +To use Command Prompt (cmd) instead of PowerShell on Windows, enter ``cmd`` in this field and the correct flags will automatically be used. + +On macOS, make sure to point to the actual program binary located within the ``Programs/MacOS`` folder of the .app bundle, rather than the .app bundle directory. + +If specifying a custom terminal emulator, you may need to override :ref:`filesystem/external_programs/terminal_emulator_flags` so it opens in the correct folder. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorSettings_property_filesystem/external_programs/terminal_emulator_flags: + +.. rst-class:: classref-property + +:ref:`String` **filesystem/external_programs/terminal_emulator_flags** + +The command-line arguments to pass to the terminal emulator that is run when using **Open in Terminal** context menu action in the FileSystem dock. See also :ref:`filesystem/external_programs/terminal_emulator`. + +If left empty, the default flags are ``{directory}``, which is replaced by the absolute path to the directory that is being opened in the terminal. + +\ **Note:** If the terminal emulator is set to PowerShell, cmd, or Konsole, Godot will automatically prepend arguments to this list, as these terminals require nonstandard arguments to open in the correct folder. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_filesystem/external_programs/vector_image_editor: .. rst-class:: classref-property @@ -1787,11 +1861,11 @@ The thumbnail size to use in the editor's file dialogs (in pixels). See also :re ---- -.. _class_EditorSettings_property_filesystem/import/blender/blender3_path: +.. _class_EditorSettings_property_filesystem/import/blender/blender_path: .. rst-class:: classref-property -:ref:`String` **filesystem/import/blender/blender3_path** +:ref:`String` **filesystem/import/blender/blender_path** The path to the directory containing the Blender executable used for converting the Blender 3D scene files ``.blend`` to glTF 2.0 format during import. Blender 3.0 or later is required. @@ -2225,6 +2299,20 @@ The default **Auto** value will only enable this if the editor was compiled with If ``true``, embed modal windows such as docks inside the main editor window. When single-window mode is enabled, tooltips will also be embedded inside the main editor window, which means they can't be displayed outside of the editor window. +\ **Note:** To query whether the editor can use multiple windows in an editor plugin, use :ref:`EditorInterface.is_multi_window_enabled` instead of querying the value of this editor setting. + +.. rst-class:: classref-item-separator + +---- + +.. _class_EditorSettings_property_interface/editor/ui_layout_direction: + +.. rst-class:: classref-property + +:ref:`int` **interface/editor/ui_layout_direction** + +Editor UI default layout direction. + .. rst-class:: classref-item-separator ---- @@ -2255,6 +2343,22 @@ Specific to the macOS platform. ---- +.. _class_EditorSettings_property_interface/editor/vsync_mode: + +.. rst-class:: classref-property + +:ref:`int` **interface/editor/vsync_mode** + +Sets the V-Sync mode for the editor. Does not affect the project when run from the editor (this is controlled by :ref:`ProjectSettings.display/window/vsync/vsync_mode`). + +Depending on the platform and used renderer, the engine will fall back to **Enabled** if the desired mode is not supported. + +\ **Note:** V-Sync modes other than **Enabled** are only supported in the Forward+ and Mobile rendering methods, not Compatibility. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_interface/inspector/float_drag_speed: .. rst-class:: classref-property @@ -2297,10 +2401,12 @@ If ``true``, display OpenType features marked as ``hidden`` by the font file in :ref:`bool` **interface/multi_window/enable** -If ``true``, the multi window support in editor is enabled. The following panels can become dedicated windows (made floating): Docks, Script editor, and Shader editor. +If ``true``, multiple window support in editor is enabled. The following panels can become dedicated windows (i.e. made floating): Docks, Script editor, and Shader editor. \ **Note:** When :ref:`interface/editor/single_window_mode` is ``true``, the multi window support is always disabled. +\ **Note:** To query whether the editor can use multiple windows in an editor plugin, use :ref:`EditorInterface.is_multi_window_enabled` instead of querying the value of this editor setting. + .. rst-class:: classref-item-separator ---- @@ -2395,9 +2501,11 @@ The color to use for "highlighted" user interface elements in the editor (presse .. rst-class:: classref-property -:ref:`float` **interface/theme/additional_spacing** +:ref:`int` **interface/theme/additional_spacing** -The spacing to add for buttons and list items in the editor (in pixels). Increasing this value is useful to improve usability on touch screens, at the cost of reducing the amount of usable screen real estate. +The extra spacing to add to various GUI elements in the editor (in pixels). Increasing this value is useful to improve usability on touch screens, at the cost of reducing the amount of usable screen real estate. + +See also :ref:`interface/theme/spacing_preset`. .. rst-class:: classref-item-separator @@ -2415,6 +2523,18 @@ The base color to use for user interface elements in the editor. Secondary color ---- +.. _class_EditorSettings_property_interface/theme/base_spacing: + +.. rst-class:: classref-property + +:ref:`int` **interface/theme/base_spacing** + +The base spacing used by various GUI elements in the editor (in pixels). See also :ref:`interface/theme/spacing_preset`. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_interface/theme/border_size: .. rst-class:: classref-property @@ -2485,9 +2605,9 @@ The icon and font color scheme to use in the editor. - **Auto** determines the color scheme to use automatically based on :ref:`interface/theme/base_color`. -- **Dark** makes fonts and icons light (suitable for dark themes). +- **Dark** makes fonts and icons dark (suitable for light themes). Icon colors are automatically converted by the editor following the set of rules defined in `this file `__. -- **Light** makes fonts and icons dark (suitable for light themes). Icon colors are automatically converted by the editor following `this set of rules `__. +- **Light** makes fonts and icons light (suitable for dark themes). .. rst-class:: classref-item-separator @@ -2531,6 +2651,18 @@ The opacity to use when drawing relationship lines in the editor's :ref:`Tree` **interface/theme/spacing_preset** + +The editor theme spacing preset to use. See also :ref:`interface/theme/base_spacing` and :ref:`interface/theme/additional_spacing`. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_interface/touchscreen/enable_long_press_as_right_click: .. rst-class:: classref-property @@ -2587,6 +2719,18 @@ Specify the multiplier to apply to the scale for the editor gizmo handles to imp ---- +.. _class_EditorSettings_property_network/connection/network_mode: + +.. rst-class:: classref-property + +:ref:`int` **network/connection/network_mode** + +Determines whether online features are enabled in the editor, such as the Asset Library. Setting this property to "Offline" is recommended to limit editor's internet activity, especially if privacy is a concern. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_network/debug/remote_host: .. rst-class:: classref-property @@ -2735,6 +2879,18 @@ The size of the font in the **Output** panel at the bottom of the editor. This s ---- +.. _class_EditorSettings_property_run/platforms/linuxbsd/prefer_wayland: + +.. rst-class:: classref-property + +:ref:`bool` **run/platforms/linuxbsd/prefer_wayland** + +If ``true``, on Linux/BSD, the editor will check for Wayland first instead of X11 (if available). + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_run/window_placement/android_window: .. rst-class:: classref-property @@ -3205,7 +3361,7 @@ The number of pixels to scroll with every mouse wheel increment. Higher values m :ref:`bool` **text_editor/completion/add_type_hints** -If ``true``, adds static typing hints such as ``-> void`` and ``: int`` when using code autocompletion or when creating onready variables by drag and dropping nodes into the script editor while pressing the :kbd:`Ctrl` key. +If ``true``, adds :doc:`GDScript static typing <../tutorials/scripting/gdscript/static_typing>` hints such as ``-> void`` and ``: int`` when using code autocompletion or when creating onready variables by drag and dropping nodes into the script editor while pressing the :kbd:`Ctrl` key. If ``true``, newly created scripts will also automatically have type hints added to their method parameters and return types. .. rst-class:: classref-item-separator diff --git a/classes/class_engine.rst b/classes/class_engine.rst index 632de147e18..25660895a2a 100644 --- a/classes/class_engine.rst +++ b/classes/class_engine.rst @@ -167,7 +167,7 @@ Controls the maximum number of physics steps that can be simulated each rendered - void **set_physics_jitter_fix** **(** :ref:`float` value **)** - :ref:`float` **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. +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 good enough 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``. @@ -228,6 +228,10 @@ If ``false``, stops printing error and warning messages to the console and edito 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. This also affects :ref:`Timer` and :ref:`SceneTreeTimer` (see :ref:`SceneTree.create_timer` for how to control this). +\ **Note:** This does not affect audio playback speed. Use :ref:`AudioServer.playback_speed_scale` to adjust audio playback speed independently of :ref:`time_scale`. + +\ **Note:** This does not automatically adjust :ref:`physics_ticks_per_second`, which means that with time scales above 1.0, physics simulation may become less precise (as each physics tick will stretch over a larger period of engine time). If you're using :ref:`time_scale` to speed up simulation by a large factor, consider increasing :ref:`physics_ticks_per_second` as well to improve physics reliability. + .. rst-class:: classref-section-separator ---- @@ -538,8 +542,6 @@ Returns the current engine version information in a Dictionary. \ ``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: diff --git a/classes/class_fileaccess.rst b/classes/class_fileaccess.rst index bdcfbff1b83..2e00a7bc5b5 100644 --- a/classes/class_fileaccess.rst +++ b/classes/class_fileaccess.rst @@ -69,6 +69,8 @@ Tutorials - :doc:`File system <../tutorials/scripting/filesystem>` +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + - `3D Voxel Demo `__ .. rst-class:: classref-reftable-group diff --git a/classes/class_filedialog.rst b/classes/class_filedialog.rst index 22831cdb831..1bad9f7be2d 100644 --- a/classes/class_filedialog.rst +++ b/classes/class_filedialog.rst @@ -46,6 +46,8 @@ Properties +---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`mode_overrides_title` | ``true`` | +---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`option_count` | ``0`` | + +---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`root_subfolder` | ``""`` | +---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`show_hidden_files` | ``false`` | @@ -63,19 +65,35 @@ Methods .. table:: :widths: auto - +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`add_filter` **(** :ref:`String` filter, :ref:`String` description="" **)** | - +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`clear_filters` **(** **)** | - +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`deselect_all` **(** **)** | - +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`LineEdit` | :ref:`get_line_edit` **(** **)** | - +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`VBoxContainer` | :ref:`get_vbox` **(** **)** | - +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`invalidate` **(** **)** | - +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_filter` **(** :ref:`String` filter, :ref:`String` description="" **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_option` **(** :ref:`String` name, :ref:`PackedStringArray` values, :ref:`int` index **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`clear_filters` **(** **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`deselect_all` **(** **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`LineEdit` | :ref:`get_line_edit` **(** **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_option_default` **(** :ref:`int` option **)** |const| | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_option_name` **(** :ref:`int` option **)** |const| | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedStringArray` | :ref:`get_option_values` **(** :ref:`int` option **)** |const| | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Dictionary` | :ref:`get_selected_options` **(** **)** |const| | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`VBoxContainer` | :ref:`get_vbox` **(** **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`invalidate` **(** **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_option_default` **(** :ref:`int` option, :ref:`int` index **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_option_name` **(** :ref:`int` option, :ref:`String` name **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_option_values` **(** :ref:`int` option, :ref:`PackedStringArray` values **)** | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -367,6 +385,23 @@ If ``true``, changing the :ref:`file_mode` ---- +.. _class_FileDialog_property_option_count: + +.. rst-class:: classref-property + +:ref:`int` **option_count** = ``0`` + +.. rst-class:: classref-property-setget + +- void **set_option_count** **(** :ref:`int` value **)** +- :ref:`int` **get_option_count** **(** **)** + +The number of additional :ref:`OptionButton`\ s and :ref:`CheckBox`\ es in the dialog. + +.. rst-class:: classref-item-separator + +---- + .. _class_FileDialog_property_root_subfolder: .. rst-class:: classref-property @@ -441,6 +476,18 @@ For example, a ``filter`` of ``"*.png, *.jpg"`` and a ``description`` of ``"Imag ---- +.. _class_FileDialog_method_add_option: + +.. rst-class:: classref-method + +void **add_option** **(** :ref:`String` name, :ref:`PackedStringArray` values, :ref:`int` index **)** + +Adds an additional :ref:`OptionButton` to the file dialog. If ``values`` is empty, a :ref:`CheckBox` is added instead. + +.. rst-class:: classref-item-separator + +---- + .. _class_FileDialog_method_clear_filters: .. rst-class:: classref-method @@ -479,6 +526,54 @@ Returns the LineEdit for the selected file. ---- +.. _class_FileDialog_method_get_option_default: + +.. rst-class:: classref-method + +:ref:`int` **get_option_default** **(** :ref:`int` option **)** |const| + +Returns the default value index of the :ref:`OptionButton` or :ref:`CheckBox` with index ``option``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_FileDialog_method_get_option_name: + +.. rst-class:: classref-method + +:ref:`String` **get_option_name** **(** :ref:`int` option **)** |const| + +Returns the name of the :ref:`OptionButton` or :ref:`CheckBox` with index ``option``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_FileDialog_method_get_option_values: + +.. rst-class:: classref-method + +:ref:`PackedStringArray` **get_option_values** **(** :ref:`int` option **)** |const| + +Returns an array of values of the :ref:`OptionButton` with index ``option``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_FileDialog_method_get_selected_options: + +.. rst-class:: classref-method + +:ref:`Dictionary` **get_selected_options** **(** **)** |const| + +Returns a :ref:`Dictionary` with the selected values of the additional :ref:`OptionButton`\ s and/or :ref:`CheckBox`\ es. :ref:`Dictionary` keys are names and values are selected value indices. + +.. rst-class:: classref-item-separator + +---- + .. _class_FileDialog_method_get_vbox: .. rst-class:: classref-method @@ -501,6 +596,42 @@ void **invalidate** **(** **)** Invalidate and update the current dialog content list. +.. rst-class:: classref-item-separator + +---- + +.. _class_FileDialog_method_set_option_default: + +.. rst-class:: classref-method + +void **set_option_default** **(** :ref:`int` option, :ref:`int` index **)** + +Sets the default value index of the :ref:`OptionButton` or :ref:`CheckBox` with index ``option``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_FileDialog_method_set_option_name: + +.. rst-class:: classref-method + +void **set_option_name** **(** :ref:`int` option, :ref:`String` name **)** + +Sets the name of the :ref:`OptionButton` or :ref:`CheckBox` with index ``option``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_FileDialog_method_set_option_values: + +.. rst-class:: classref-method + +void **set_option_values** **(** :ref:`int` option, :ref:`PackedStringArray` values **)** + +Sets the option values of the :ref:`OptionButton` with index ``option``. + .. rst-class:: classref-section-separator ---- diff --git a/classes/class_flowcontainer.rst b/classes/class_flowcontainer.rst index f1102e108ed..48f466ba9a2 100644 --- a/classes/class_flowcontainer.rst +++ b/classes/class_flowcontainer.rst @@ -38,11 +38,13 @@ Properties .. table:: :widths: auto - +--------------------------------------------------------+----------------------------------------------------------+-----------+ - | :ref:`AlignmentMode` | :ref:`alignment` | ``0`` | - +--------------------------------------------------------+----------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`vertical` | ``false`` | - +--------------------------------------------------------+----------------------------------------------------------+-----------+ + +--------------------------------------------------------+----------------------------------------------------------------+-----------+ + | :ref:`AlignmentMode` | :ref:`alignment` | ``0`` | + +--------------------------------------------------------+----------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`reverse_fill` | ``false`` | + +--------------------------------------------------------+----------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`vertical` | ``false`` | + +--------------------------------------------------------+----------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group @@ -135,6 +137,25 @@ The alignment of the container's children (must be one of :ref:`ALIGNMENT_BEGIN< ---- +.. _class_FlowContainer_property_reverse_fill: + +.. rst-class:: classref-property + +:ref:`bool` **reverse_fill** = ``false`` + +.. rst-class:: classref-property-setget + +- void **set_reverse_fill** **(** :ref:`bool` value **)** +- :ref:`bool` **is_reverse_fill** **(** **)** + +If ``true``, reverses fill direction. Horizontal **FlowContainer**\ s will fill rows bottom to top, vertical **FlowContainer**\ s will fill columns right to left. + +When using a vertical **FlowContainer** with a right to left :ref:`Control.layout_direction`, columns will fill left to right instead. + +.. rst-class:: classref-item-separator + +---- + .. _class_FlowContainer_property_vertical: .. rst-class:: classref-property diff --git a/classes/class_font.rst b/classes/class_font.rst index 11f5a46d350..438729615d5 100644 --- a/classes/class_font.rst +++ b/classes/class_font.rst @@ -56,7 +56,7 @@ Methods +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_string_outline` **(** :ref:`RID` canvas_item, :ref:`Vector2` pos, :ref:`String` text, :ref:`HorizontalAlignment` alignment=0, :ref:`float` width=-1, :ref:`int` font_size=16, :ref:`int` size=1, :ref:`Color` modulate=Color(1, 1, 1, 1), |bitfield|\<:ref:`JustificationFlag`\> justification_flags=3, :ref:`Direction` direction=0, :ref:`Orientation` orientation=0 **)** |const| | +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`find_variation` **(** :ref:`Dictionary` variation_coordinates, :ref:`int` face_index=0, :ref:`float` strength=0.0, :ref:`Transform2D` transform=Transform2D(1, 0, 0, 1, 0, 0), :ref:`int` spacing_top=0, :ref:`int` spacing_bottom=0, :ref:`int` spacing_space=0, :ref:`int` spacing_glyph=0 **)** |const| | + | :ref:`RID` | :ref:`find_variation` **(** :ref:`Dictionary` variation_coordinates, :ref:`int` face_index=0, :ref:`float` strength=0.0, :ref:`Transform2D` transform=Transform2D(1, 0, 0, 1, 0, 0), :ref:`int` spacing_top=0, :ref:`int` spacing_bottom=0, :ref:`int` spacing_space=0, :ref:`int` spacing_glyph=0, :ref:`float` baseline_offset=0.0 **)** |const| | +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_ascent` **(** :ref:`int` font_size=16 **)** |const| | +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -230,7 +230,7 @@ See also :ref:`CanvasItem.draw_string_outline` **find_variation** **(** :ref:`Dictionary` variation_coordinates, :ref:`int` face_index=0, :ref:`float` strength=0.0, :ref:`Transform2D` transform=Transform2D(1, 0, 0, 1, 0, 0), :ref:`int` spacing_top=0, :ref:`int` spacing_bottom=0, :ref:`int` spacing_space=0, :ref:`int` spacing_glyph=0 **)** |const| +:ref:`RID` **find_variation** **(** :ref:`Dictionary` variation_coordinates, :ref:`int` face_index=0, :ref:`float` strength=0.0, :ref:`Transform2D` transform=Transform2D(1, 0, 0, 1, 0, 0), :ref:`int` spacing_top=0, :ref:`int` spacing_bottom=0, :ref:`int` spacing_space=0, :ref:`int` spacing_glyph=0, :ref:`float` baseline_offset=0.0 **)** |const| Returns :ref:`TextServer` RID of the font cache for specific variation. diff --git a/classes/class_fontfile.rst b/classes/class_fontfile.rst index ea93c40942e..be350d31a50 100644 --- a/classes/class_fontfile.rst +++ b/classes/class_fontfile.rst @@ -56,6 +56,13 @@ Supported font formats: +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties @@ -139,6 +146,8 @@ Methods +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_embolden` **(** :ref:`int` cache_index **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_extra_baseline_offset` **(** :ref:`int` cache_index **)** |const| | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_extra_spacing` **(** :ref:`int` cache_index, :ref:`SpacingType` spacing **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_face_index` **(** :ref:`int` cache_index **)** |const| | @@ -215,6 +224,8 @@ Methods +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_embolden` **(** :ref:`int` cache_index, :ref:`float` strength **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_extra_baseline_offset` **(** :ref:`int` cache_index, :ref:`float` baseline_offset **)** | + +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_extra_spacing` **(** :ref:`int` cache_index, :ref:`SpacingType` spacing, :ref:`int` value **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_face_index` **(** :ref:`int` cache_index, :ref:`int` face_index **)** | @@ -745,6 +756,18 @@ Returns embolden strength, if is not equal to zero, emboldens the font outlines. ---- +.. _class_FontFile_method_get_extra_baseline_offset: + +.. rst-class:: classref-method + +:ref:`float` **get_extra_baseline_offset** **(** :ref:`int` cache_index **)** |const| + +Returns extra baseline offset (as a fraction of font height). + +.. rst-class:: classref-item-separator + +---- + .. _class_FontFile_method_get_extra_spacing: .. rst-class:: classref-method @@ -1211,6 +1234,18 @@ Sets embolden strength, if is not equal to zero, emboldens the font outlines. Ne ---- +.. _class_FontFile_method_set_extra_baseline_offset: + +.. rst-class:: classref-method + +void **set_extra_baseline_offset** **(** :ref:`int` cache_index, :ref:`float` baseline_offset **)** + +Sets extra baseline offset (as a fraction of font height). + +.. rst-class:: classref-item-separator + +---- + .. _class_FontFile_method_set_extra_spacing: .. rst-class:: classref-method diff --git a/classes/class_fontvariation.rst b/classes/class_fontvariation.rst index 754aa0b6342..023f5d3b47b 100644 --- a/classes/class_fontvariation.rst +++ b/classes/class_fontvariation.rst @@ -64,6 +64,8 @@ Properties +---------------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`Font` | :ref:`base_font` | | +---------------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ + | :ref:`float` | :ref:`baseline_offset` | ``0.0`` | + +---------------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`Dictionary` | :ref:`opentype_features` | ``{}`` | +---------------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`spacing_bottom` | ``0`` | @@ -121,6 +123,23 @@ Base font used to create a variation. If not set, default :ref:`Theme` **baseline_offset** = ``0.0`` + +.. rst-class:: classref-property-setget + +- void **set_baseline_offset** **(** :ref:`float` value **)** +- :ref:`float` **get_baseline_offset** **(** **)** + +Extra baseline offset (as a fraction of font height). + +.. rst-class:: classref-item-separator + +---- + .. _class_FontVariation_property_opentype_features: .. rst-class:: classref-property diff --git a/classes/class_gdextension.rst b/classes/class_gdextension.rst index 2b6cf2dfeec..04eec5a7d10 100644 --- a/classes/class_gdextension.rst +++ b/classes/class_gdextension.rst @@ -12,9 +12,25 @@ GDExtension **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -.. container:: contribute +A native library for GDExtension. - There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Description +----------- + +The **GDExtension** resource type represents a `shared library `__ which can expand the functionality of the engine. The :ref:`GDExtensionManager` singleton is responsible for loading, reloading, and unloading **GDExtension** resources. + +\ **Note:** GDExtension itself is not a scripting language and has no relation to :ref:`GDScript` resources. + +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`GDExtension overview <../tutorials/scripting/gdextension/what_is_gdextension>` + +- :doc:`GDExtension example in C++ <../tutorials/scripting/gdextension/gdextension_cpp_example>` .. rst-class:: classref-reftable-group @@ -57,7 +73,7 @@ enum **InitializationLevel**: :ref:`InitializationLevel` **INITIALIZATION_LEVEL_CORE** = ``0`` - +The library is initialized at the same time as the core features of the engine. .. _class_GDExtension_constant_INITIALIZATION_LEVEL_SERVERS: @@ -65,7 +81,7 @@ enum **InitializationLevel**: :ref:`InitializationLevel` **INITIALIZATION_LEVEL_SERVERS** = ``1`` - +The library is initialized at the same time as the engine's servers (such as :ref:`RenderingServer` or :ref:`PhysicsServer3D`). .. _class_GDExtension_constant_INITIALIZATION_LEVEL_SCENE: @@ -73,7 +89,7 @@ enum **InitializationLevel**: :ref:`InitializationLevel` **INITIALIZATION_LEVEL_SCENE** = ``2`` - +The library is initialized at the same time as the engine's scene-related classes. .. _class_GDExtension_constant_INITIALIZATION_LEVEL_EDITOR: @@ -81,7 +97,7 @@ enum **InitializationLevel**: :ref:`InitializationLevel` **INITIALIZATION_LEVEL_EDITOR** = ``3`` - +The library is initialized at the same time as the engine's editor classes. Only happens when loading the GDExtension in the editor. .. rst-class:: classref-section-separator @@ -98,9 +114,9 @@ Method Descriptions void **close_library** **(** **)** -.. container:: contribute +Closes the current library. - There is currently no description for this method. Please help us by :ref:`contributing one `! +\ **Note:** You normally should not call this method directly. This is handled automatically by :ref:`GDExtensionManager.unload_extension`. .. rst-class:: classref-item-separator @@ -112,9 +128,7 @@ void **close_library** **(** **)** :ref:`InitializationLevel` **get_minimum_library_initialization_level** **(** **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the lowest level required for this extension to be properly initialized (see the :ref:`InitializationLevel` enum). .. rst-class:: classref-item-separator @@ -126,9 +140,9 @@ void **close_library** **(** **)** void **initialize_library** **(** :ref:`InitializationLevel` level **)** -.. container:: contribute +Initializes the library bound to this GDextension at the given initialization ``level``. - There is currently no description for this method. Please help us by :ref:`contributing one `! +\ **Note:** You normally should not call this method directly. This is handled automatically by :ref:`GDExtensionManager.load_extension`. .. rst-class:: classref-item-separator @@ -140,9 +154,7 @@ void **initialize_library** **(** :ref:`InitializationLevel` **is_library_open** **(** **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns ``true`` if this extension's library has been opened. .. rst-class:: classref-item-separator @@ -154,9 +166,9 @@ void **initialize_library** **(** :ref:`InitializationLevel` **open_library** **(** :ref:`String` path, :ref:`String` entry_symbol **)** -.. container:: contribute +Opens the library at the specified ``path``. - There is currently no description for this method. Please help us by :ref:`contributing one `! +\ **Note:** You normally should not call this method directly. This is handled automatically by :ref:`GDExtensionManager.load_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.)` diff --git a/classes/class_gdextensionmanager.rst b/classes/class_gdextensionmanager.rst index 9c278824fb3..a8f748f6fc2 100644 --- a/classes/class_gdextensionmanager.rst +++ b/classes/class_gdextensionmanager.rst @@ -12,9 +12,25 @@ GDExtensionManager **Inherits:** :ref:`Object` -.. container:: contribute +Provides access to GDExtension functionality. - There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Description +----------- + +The GDExtensionManager loads, initializes, and keeps track of all available :ref:`GDExtension` libraries in the project. + +\ **Note:** Do not worry about GDExtension unless you know what you are doing. + +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`GDExtension overview <../tutorials/scripting/gdextension/what_is_gdextension>` + +- :doc:`GDExtension example in C++ <../tutorials/scripting/gdextension/gdextension_cpp_example>` .. rst-class:: classref-reftable-group @@ -53,7 +69,7 @@ Signals **extensions_reloaded** **(** **)** -Emitted after the editor has automatically reloaded any extensions. +Emitted after the editor has finished reloading one or more extensions. .. rst-class:: classref-section-separator @@ -76,7 +92,7 @@ enum **LoadStatus**: :ref:`LoadStatus` **LOAD_STATUS_OK** = ``0`` - +The extension has loaded successfully. .. _class_GDExtensionManager_constant_LOAD_STATUS_FAILED: @@ -84,7 +100,7 @@ enum **LoadStatus**: :ref:`LoadStatus` **LOAD_STATUS_FAILED** = ``1`` - +The extension has failed to load, possibly because it does not exist or has missing dependencies. .. _class_GDExtensionManager_constant_LOAD_STATUS_ALREADY_LOADED: @@ -92,7 +108,7 @@ enum **LoadStatus**: :ref:`LoadStatus` **LOAD_STATUS_ALREADY_LOADED** = ``2`` - +The extension has already been loaded. .. _class_GDExtensionManager_constant_LOAD_STATUS_NOT_LOADED: @@ -100,7 +116,7 @@ enum **LoadStatus**: :ref:`LoadStatus` **LOAD_STATUS_NOT_LOADED** = ``3`` - +The extension has not been loaded. .. _class_GDExtensionManager_constant_LOAD_STATUS_NEEDS_RESTART: @@ -108,7 +124,7 @@ enum **LoadStatus**: :ref:`LoadStatus` **LOAD_STATUS_NEEDS_RESTART** = ``4`` - +The extension requires the application to restart to fully load. .. rst-class:: classref-section-separator @@ -125,9 +141,7 @@ Method Descriptions :ref:`GDExtension` **get_extension** **(** :ref:`String` path **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the :ref:`GDExtension` at the given file ``path``, or ``null`` if it has not been loaded or does not exist. .. rst-class:: classref-item-separator @@ -139,9 +153,7 @@ Method Descriptions :ref:`PackedStringArray` **get_loaded_extensions** **(** **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the file paths of all currently loaded extensions. .. rst-class:: classref-item-separator @@ -153,9 +165,7 @@ Method Descriptions :ref:`bool` **is_extension_loaded** **(** :ref:`String` path **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns ``true`` if the extension at the given file ``path`` has already been loaded successfully. See also :ref:`get_loaded_extensions`. .. rst-class:: classref-item-separator @@ -167,9 +177,7 @@ Method Descriptions :ref:`LoadStatus` **load_extension** **(** :ref:`String` path **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Loads an extension by absolute file path. The ``path`` needs to point to a valid :ref:`GDExtension`. Returns :ref:`LOAD_STATUS_OK` if successful. .. rst-class:: classref-item-separator @@ -181,9 +189,9 @@ Method Descriptions :ref:`LoadStatus` **reload_extension** **(** :ref:`String` path **)** -.. container:: contribute +Reloads the extension at the given file path. The ``path`` needs to point to a valid :ref:`GDExtension`, otherwise this method may return either :ref:`LOAD_STATUS_NOT_LOADED` or :ref:`LOAD_STATUS_FAILED`. - There is currently no description for this method. Please help us by :ref:`contributing one `! +\ **Note:** You can only reload extensions in the editor. In release builds, this method always fails and returns :ref:`LOAD_STATUS_FAILED`. .. rst-class:: classref-item-separator @@ -195,9 +203,7 @@ Method Descriptions :ref:`LoadStatus` **unload_extension** **(** :ref:`String` path **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Unloads an extension by file path. The ``path`` needs to point to an already loaded :ref:`GDExtension`, otherwise this method returns :ref:`LOAD_STATUS_NOT_LOADED`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_generic6dofjoint3d.rst b/classes/class_generic6dofjoint3d.rst index 8d623aa460b..c76c75d5c16 100644 --- a/classes/class_generic6dofjoint3d.rst +++ b/classes/class_generic6dofjoint3d.rst @@ -312,6 +312,10 @@ The maximum force the linear motor will apply while trying to reach the velocity :ref:`Param` **PARAM_LINEAR_SPRING_STIFFNESS** = ``7`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Generic6DOFJoint3D_constant_PARAM_LINEAR_SPRING_DAMPING: @@ -320,6 +324,10 @@ The maximum force the linear motor will apply while trying to reach the velocity :ref:`Param` **PARAM_LINEAR_SPRING_DAMPING** = ``8`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Generic6DOFJoint3D_constant_PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT: @@ -328,6 +336,10 @@ The maximum force the linear motor will apply while trying to reach the velocity :ref:`Param` **PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT** = ``9`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Generic6DOFJoint3D_constant_PARAM_ANGULAR_LOWER_LIMIT: @@ -408,6 +420,10 @@ Maximum acceleration for the motor at the axes. :ref:`Param` **PARAM_ANGULAR_SPRING_STIFFNESS** = ``19`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Generic6DOFJoint3D_constant_PARAM_ANGULAR_SPRING_DAMPING: @@ -416,6 +432,10 @@ Maximum acceleration for the motor at the axes. :ref:`Param` **PARAM_ANGULAR_SPRING_DAMPING** = ``20`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Generic6DOFJoint3D_constant_PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT: @@ -424,6 +444,10 @@ Maximum acceleration for the motor at the axes. :ref:`Param` **PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT** = ``21`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Generic6DOFJoint3D_constant_PARAM_MAX: @@ -466,6 +490,10 @@ If enabled, rotational motion is possible within the given limits. :ref:`Flag` **FLAG_ENABLE_LINEAR_SPRING** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Generic6DOFJoint3D_constant_FLAG_ENABLE_ANGULAR_SPRING: @@ -474,6 +502,10 @@ If enabled, rotational motion is possible within the given limits. :ref:`Flag` **FLAG_ENABLE_ANGULAR_SPRING** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Generic6DOFJoint3D_constant_FLAG_ENABLE_MOTOR: diff --git a/classes/class_geometry3d.rst b/classes/class_geometry3d.rst index 9c9e3442758..111cf738fab 100644 --- a/classes/class_geometry3d.rst +++ b/classes/class_geometry3d.rst @@ -58,6 +58,8 @@ Methods +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`segment_intersects_triangle` **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`Vector3` a, :ref:`Vector3` b, :ref:`Vector3` c **)** | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedInt32Array` | :ref:`tetrahedralize_delaunay` **(** :ref:`PackedVector3Array` points **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -234,6 +236,18 @@ Checks if the segment (``from``, ``to``) intersects the sphere that is located a 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, returns ``null``. +.. rst-class:: classref-item-separator + +---- + +.. _class_Geometry3D_method_tetrahedralize_delaunay: + +.. rst-class:: classref-method + +:ref:`PackedInt32Array` **tetrahedralize_delaunay** **(** :ref:`PackedVector3Array` points **)** + +Tetrahedralizes the volume specified by a discrete set of ``points`` in 3D space, ensuring that no point lies within the circumsphere of any resulting tetrahedron. The method returns a :ref:`PackedInt32Array` where each tetrahedron consists of four consecutive point indices into the ``points`` array (resulting in an array with ``n * 4`` elements, where ``n`` is the number of tetrahedra found). If the tetrahedralization is unsuccessful, an empty :ref:`PackedInt32Array` 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_geometryinstance3d.rst b/classes/class_geometryinstance3d.rst index 7de3a297266..b4cc84eb457 100644 --- a/classes/class_geometryinstance3d.rst +++ b/classes/class_geometryinstance3d.rst @@ -292,7 +292,7 @@ The selected shadow casting flag. See :ref:`ShadowCastingSetting` value **)** - :ref:`AABB` **get_custom_aabb** **(** **)** -Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive :ref:`AABB` recalculation that happens when a skeleton is used with a :ref:`MeshInstance3D` or to have fine control over the :ref:`MeshInstance3D`'s bounding box. To use the default AABB, set value to an :ref:`AABB` with all fields set to ``0.0``. To avoid frustum culling, set :ref:`custom_aabb` to a very large AABB that covers your entire game world such as ``AABB(-10000, -10000, -10000, 20000, 20000, 20000)``. To disable all forms of culling (including occlusion culling), call :ref:`RenderingServer.instance_set_ignore_culling` on the **GeometryInstance3D**'s :ref:`RID`. +Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive :ref:`AABB` recalculation that happens when a skeleton is used with a :ref:`MeshInstance3D` or to have precise control over the :ref:`MeshInstance3D`'s bounding box. To use the default AABB, set value to an :ref:`AABB` with all fields set to ``0.0``. To avoid frustum culling, set :ref:`custom_aabb` to a very large AABB that covers your entire game world such as ``AABB(-10000, -10000, -10000, 20000, 20000, 20000)``. To disable all forms of culling (including occlusion culling), call :ref:`RenderingServer.instance_set_ignore_culling` on the **GeometryInstance3D**'s :ref:`RID`. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfaccessor.rst b/classes/class_gltfaccessor.rst index 4bf79eebd9c..c5bfc290b16 100644 --- a/classes/class_gltfaccessor.rst +++ b/classes/class_gltfaccessor.rst @@ -12,9 +12,25 @@ GLTFAccessor **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -.. container:: contribute +Represents a GLTF accessor. + +.. rst-class:: classref-introduction-group + +Description +----------- + +GLTFAccessor is a data structure representing GLTF a ``accessor`` that would be found in the ``"accessors"`` array. A buffer is a blob of binary data. A buffer view is a slice of a buffer. An accessor is a typed interpretation of the data in a buffer view. + +Most custom data stored in GLTF does not need accessors, only buffer views (see :ref:`GLTFBufferView`). Accessors are for more advanced use cases such as interleaved mesh data encoded for the GPU. + +.. rst-class:: classref-introduction-group - There is currently no description for this class. Please help us by :ref:`contributing one `! +Tutorials +--------- + +- `Buffers, BufferViews, and Accessors in Khronos glTF specification `__ + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` .. rst-class:: classref-reftable-group @@ -74,9 +90,7 @@ Property Descriptions - void **set_buffer_view** **(** :ref:`int` value **)** - :ref:`int` **get_buffer_view** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The index of the buffer view this accessor is referencing. If ``-1``, this accessor is not referencing any buffer view. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfanimation.rst b/classes/class_gltfanimation.rst index cf88430f2a4..7959e1f2a35 100644 --- a/classes/class_gltfanimation.rst +++ b/classes/class_gltfanimation.rst @@ -16,6 +16,13 @@ GLTFAnimation There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_gltfbufferview.rst b/classes/class_gltfbufferview.rst index 054fd1f9da0..154e3d3f10b 100644 --- a/classes/class_gltfbufferview.rst +++ b/classes/class_gltfbufferview.rst @@ -12,9 +12,25 @@ GLTFBufferView **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -.. container:: contribute +Represents a GLTF buffer view. - There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Description +----------- + +GLTFBufferView is a data structure representing GLTF a ``bufferView`` that would be found in the ``"bufferViews"`` array. A buffer is a blob of binary data. A buffer view is a slice of a buffer that can be used to identify and extract data from the buffer. + +Most custom uses of buffers only need to use the :ref:`buffer`, :ref:`byte_length`, and :ref:`byte_offset`. The :ref:`byte_stride` and :ref:`indices` properties are for more advanced use cases such as interleaved mesh data encoded for the GPU. + +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- `Buffers, BufferViews, and Accessors in Khronos glTF specification `__ + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` .. rst-class:: classref-reftable-group @@ -36,6 +52,18 @@ Properties | :ref:`bool` | :ref:`indices` | ``false`` | +-------------------------+---------------------------------------------------------------+-----------+ +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedByteArray` | :ref:`load_buffer_view_data` **(** :ref:`GLTFState` state **)** |const| | + +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + .. rst-class:: classref-section-separator ---- @@ -56,9 +84,7 @@ Property Descriptions - void **set_buffer** **(** :ref:`int` value **)** - :ref:`int` **get_buffer** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The index of the buffer this buffer view is referencing. If ``-1``, this buffer view is not referencing any buffer. .. rst-class:: classref-item-separator @@ -75,9 +101,7 @@ Property Descriptions - void **set_byte_length** **(** :ref:`int` value **)** - :ref:`int` **get_byte_length** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The length, in bytes, of this buffer view. If ``0``, this buffer view is empty. .. rst-class:: classref-item-separator @@ -94,9 +118,7 @@ Property Descriptions - void **set_byte_offset** **(** :ref:`int` value **)** - :ref:`int` **get_byte_offset** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The offset, in bytes, from the start of the buffer to the start of this buffer view. .. rst-class:: classref-item-separator @@ -113,9 +135,7 @@ Property Descriptions - void **set_byte_stride** **(** :ref:`int` value **)** - :ref:`int` **get_byte_stride** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The stride, in bytes, between interleaved data. If ``-1``, this buffer view is not interleaved. .. rst-class:: classref-item-separator @@ -132,9 +152,24 @@ Property Descriptions - void **set_indices** **(** :ref:`bool` value **)** - :ref:`bool` **get_indices** **(** **)** -.. container:: contribute +True if the GLTFBufferView's OpenGL GPU buffer type is an ``ELEMENT_ARRAY_BUFFER`` used for vertex indices (integer constant ``34963``). False if the buffer type is ``ARRAY_BUFFER`` used for vertex attributes (integer constant ``34962``) or when any other value. See `Buffers, BufferViews, and Accessors `__ for possible values. This property is set but never used, setting this property will do nothing. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_GLTFBufferView_method_load_buffer_view_data: + +.. rst-class:: classref-method + +:ref:`PackedByteArray` **load_buffer_view_data** **(** :ref:`GLTFState` state **)** |const| - There is currently no description for this property. Please help us by :ref:`contributing one `! +Loads the buffer view data from the buffer referenced by this buffer view in the given :ref:`GLTFState`. Interleaved data with a byte stride is not yet supported by this method. The data is returned as a :ref:`PackedByteArray`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_gltfcamera.rst b/classes/class_gltfcamera.rst index dfd15f1ca9a..ec53168547f 100644 --- a/classes/class_gltfcamera.rst +++ b/classes/class_gltfcamera.rst @@ -26,6 +26,8 @@ Represents a camera as defined by the base GLTF spec. Tutorials --------- +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + - `GLTF camera detailed specification `__ - `GLTF camera spec and example file `__ diff --git a/classes/class_gltfdocument.rst b/classes/class_gltfdocument.rst index eea1ac1cb9b..917505eb724 100644 --- a/classes/class_gltfdocument.rst +++ b/classes/class_gltfdocument.rst @@ -30,6 +30,8 @@ GLTFDocument can be extended with arbitrary functionality by extending the :ref: Tutorials --------- +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + - `glTF 'What the duck?' guide `__ - `Khronos glTF specification `__ @@ -282,7 +284,7 @@ Unregisters the given :ref:`GLTFDocumentExtension` Takes a :ref:`GLTFState` object through the ``state`` parameter and writes a glTF file to the filesystem. -\ **Note:** The extension of the glTF file determines if it is a .glb binary file or a .gltf file. +\ **Note:** The extension of the glTF file determines if it is a .glb binary file or a .gltf text 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.)` diff --git a/classes/class_gltfdocumentextension.rst b/classes/class_gltfdocumentextension.rst index 2d677a74658..c05a4386230 100644 --- a/classes/class_gltfdocumentextension.rst +++ b/classes/class_gltfdocumentextension.rst @@ -27,6 +27,13 @@ To use, make a new class extending GLTFDocumentExtension, override any methods y \ **Note:** Like GLTFDocument itself, all GLTFDocumentExtension classes must be stateless in order to function properly. If you need to store data, use the ``set_additional_data`` and ``get_additional_data`` methods in :ref:`GLTFState` or :ref:`GLTFNode`. +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Methods @@ -106,7 +113,7 @@ Runs when converting the data from a Godot scene node. This method can be used t Part of the export process. This method is run after :ref:`_get_saveable_image_formats` and before :ref:`_export_post`. If this **GLTFDocumentExtension** is used for exporting images, this runs after :ref:`_serialize_texture_json`. -This method can be used to modify the final JSON of each node. +This method can be used to modify the final JSON of each node. Data should be primarily stored in ``gltf_node`` prior to serializing the JSON, but the original Godot ``node`` is also provided if available. The node may be null if not available, such as when exporting GLTF data not generated from a Godot scene. .. rst-class:: classref-item-separator @@ -246,7 +253,7 @@ This method can be used to modify the final Godot scene generated by the import Part of the import process. This method is run after :ref:`_parse_node_extensions` and before :ref:`_generate_scene_node`. -This method can be used to modify any of the data imported so far, including any scene nodes, before running the final per-node import step. +This method can be used to modify any of the data imported so far after parsing, before generating the nodes and then running the final per-node import step. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfdocumentextensionconvertimportermesh.rst b/classes/class_gltfdocumentextensionconvertimportermesh.rst index 2af7845a342..08e01476bf6 100644 --- a/classes/class_gltfdocumentextensionconvertimportermesh.rst +++ b/classes/class_gltfdocumentextensionconvertimportermesh.rst @@ -16,6 +16,13 @@ GLTFDocumentExtensionConvertImporterMesh There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance'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 index 20805938cb0..a8bed0c99a0 100644 --- a/classes/class_gltflight.rst +++ b/classes/class_gltflight.rst @@ -26,6 +26,8 @@ Represents a light as defined by the ``KHR_lights_punctual`` GLTF extension. Tutorials --------- +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + - `KHR_lights_punctual GLTF extension spec `__ .. rst-class:: classref-reftable-group diff --git a/classes/class_gltfmesh.rst b/classes/class_gltfmesh.rst index 1aa58a6267a..5829f630c11 100644 --- a/classes/class_gltfmesh.rst +++ b/classes/class_gltfmesh.rst @@ -16,6 +16,13 @@ GLTFMesh There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_gltfnode.rst b/classes/class_gltfnode.rst index 2a6dde37f50..396bb8e18b8 100644 --- a/classes/class_gltfnode.rst +++ b/classes/class_gltfnode.rst @@ -28,6 +28,8 @@ GLTF nodes generally exist inside of :ref:`GLTFState` which rep Tutorials --------- +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + - `GLTF scene and node spec `__ .. rst-class:: classref-reftable-group diff --git a/classes/class_gltfphysicsbody.rst b/classes/class_gltfphysicsbody.rst index 51d8937dd8a..e3f77373e03 100644 --- a/classes/class_gltfphysicsbody.rst +++ b/classes/class_gltfphysicsbody.rst @@ -19,13 +19,15 @@ Represents a GLTF physics body. Description ----------- -Represents a physics body as defined by the ``OMI_physics_body`` GLTF extension. This class is an intermediary between the GLTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different GLTF physics extensions in the future. +Represents a physics body as an intermediary between the ``OMI_physics_body`` GLTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different GLTF physics extensions in the future. .. rst-class:: classref-introduction-group Tutorials --------- +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + - `OMI_physics_body GLTF extension `__ .. rst-class:: classref-reftable-group @@ -36,19 +38,23 @@ Properties .. table:: :widths: auto - +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+ - | :ref:`Vector3` | :ref:`angular_velocity` | ``Vector3(0, 0, 0)`` | - +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+ - | :ref:`String` | :ref:`body_type` | ``"static"`` | - +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+ - | :ref:`Vector3` | :ref:`center_of_mass` | ``Vector3(0, 0, 0)`` | - +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+ - | :ref:`Basis` | :ref:`inertia_tensor` | ``Basis(0, 0, 0, 0, 0, 0, 0, 0, 0)`` | - +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+ - | :ref:`Vector3` | :ref:`linear_velocity` | ``Vector3(0, 0, 0)`` | - +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+ - | :ref:`float` | :ref:`mass` | ``1.0`` | - +-------------------------------+--------------------------------------------------------------------------+--------------------------------------+ + +-------------------------------------+--------------------------------------------------------------------------------+--------------------------------------+ + | :ref:`Vector3` | :ref:`angular_velocity` | ``Vector3(0, 0, 0)`` | + +-------------------------------------+--------------------------------------------------------------------------------+--------------------------------------+ + | :ref:`String` | :ref:`body_type` | ``"rigid"`` | + +-------------------------------------+--------------------------------------------------------------------------------+--------------------------------------+ + | :ref:`Vector3` | :ref:`center_of_mass` | ``Vector3(0, 0, 0)`` | + +-------------------------------------+--------------------------------------------------------------------------------+--------------------------------------+ + | :ref:`Vector3` | :ref:`inertia_diagonal` | ``Vector3(0, 0, 0)`` | + +-------------------------------------+--------------------------------------------------------------------------------+--------------------------------------+ + | :ref:`Quaternion` | :ref:`inertia_orientation` | ``Quaternion(0, 0, 0, 1)`` | + +-------------------------------------+--------------------------------------------------------------------------------+--------------------------------------+ + | :ref:`Basis` | :ref:`inertia_tensor` | ``Basis(0, 0, 0, 0, 0, 0, 0, 0, 0)`` | + +-------------------------------------+--------------------------------------------------------------------------------+--------------------------------------+ + | :ref:`Vector3` | :ref:`linear_velocity` | ``Vector3(0, 0, 0)`` | + +-------------------------------------+--------------------------------------------------------------------------------+--------------------------------------+ + | :ref:`float` | :ref:`mass` | ``1.0`` | + +-------------------------------------+--------------------------------------------------------------------------------+--------------------------------------+ .. rst-class:: classref-reftable-group @@ -98,14 +104,14 @@ The angular velocity of the physics body, in radians per second. This is only us .. rst-class:: classref-property -:ref:`String` **body_type** = ``"static"`` +:ref:`String` **body_type** = ``"rigid"`` .. rst-class:: classref-property-setget - void **set_body_type** **(** :ref:`String` value **)** - :ref:`String` **get_body_type** **(** **)** -The type of the body. When importing, this controls what type of :ref:`CollisionObject3D` node Godot should generate. Valid values are "static", "kinematic", "character", "rigid", "vehicle", and "trigger". +The type of the body. When importing, this controls what type of :ref:`CollisionObject3D` node Godot should generate. Valid values are "static", "animatable", "character", "rigid", "vehicle", and "trigger". When exporting, this will be squashed down to one of "static", "kinematic", or "dynamic" motion types, or the "trigger" property. .. rst-class:: classref-item-separator @@ -128,6 +134,42 @@ The center of mass of the body, in meters. This is in local space relative to th ---- +.. _class_GLTFPhysicsBody_property_inertia_diagonal: + +.. rst-class:: classref-property + +:ref:`Vector3` **inertia_diagonal** = ``Vector3(0, 0, 0)`` + +.. rst-class:: classref-property-setget + +- void **set_inertia_diagonal** **(** :ref:`Vector3` value **)** +- :ref:`Vector3` **get_inertia_diagonal** **(** **)** + +The inertia strength of the physics body, in kilogram meter squared (kg⋅m²). This represents the inertia around the principle axes, the diagonal of the inertia tensor matrix. This is only used when the body type is "rigid" or "vehicle". + +When converted to a Godot :ref:`RigidBody3D` node, if this value is zero, then the inertia will be calculated automatically. + +.. rst-class:: classref-item-separator + +---- + +.. _class_GLTFPhysicsBody_property_inertia_orientation: + +.. rst-class:: classref-property + +:ref:`Quaternion` **inertia_orientation** = ``Quaternion(0, 0, 0, 1)`` + +.. rst-class:: classref-property-setget + +- void **set_inertia_orientation** **(** :ref:`Quaternion` value **)** +- :ref:`Quaternion` **get_inertia_orientation** **(** **)** + +The inertia orientation of the physics body. This defines the rotation of the inertia's principle axes relative to the object's local axes. This is only used when the body type is "rigid" or "vehicle" and :ref:`inertia_diagonal` is set to a non-zero value. + +.. rst-class:: classref-item-separator + +---- + .. _class_GLTFPhysicsBody_property_inertia_tensor: .. rst-class:: classref-property @@ -192,7 +234,7 @@ Method Descriptions :ref:`GLTFPhysicsBody` **from_dictionary** **(** :ref:`Dictionary` dictionary **)** |static| -Creates a new GLTFPhysicsBody instance by parsing the given :ref:`Dictionary`. +Creates a new GLTFPhysicsBody instance by parsing the given :ref:`Dictionary` in the ``OMI_physics_body`` GLTF extension format. .. rst-class:: classref-item-separator @@ -216,7 +258,7 @@ Create a new GLTFPhysicsBody instance from the given Godot :ref:`CollisionObject :ref:`Dictionary` **to_dictionary** **(** **)** |const| -Serializes this GLTFPhysicsBody instance into a :ref:`Dictionary`. +Serializes this GLTFPhysicsBody instance into a :ref:`Dictionary`. It will be in the format expected by the ``OMI_physics_body`` GLTF extension. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfphysicsshape.rst b/classes/class_gltfphysicsshape.rst index 5c9a8a08a5a..de66d681693 100644 --- a/classes/class_gltfphysicsshape.rst +++ b/classes/class_gltfphysicsshape.rst @@ -19,14 +19,18 @@ Represents a GLTF physics shape. Description ----------- -Represents a physics shape as defined by the ``OMI_collider`` GLTF extension. This class is an intermediary between the GLTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different GLTF physics extensions in the future. +Represents a physics shape as defined by the ``OMI_physics_shape`` or ``OMI_collider`` GLTF extensions. This class is an intermediary between the GLTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different GLTF physics extensions in the future. .. rst-class:: classref-introduction-group Tutorials --------- -- `OMI_collider GLTF extension `__ +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + +- `OMI_physics_shape GLTF extension `__ + +- `OMI_collider GLTF extension `__ .. rst-class:: classref-reftable-group @@ -235,7 +239,7 @@ Create a new GLTFPhysicsShape instance from the given Godot :ref:`CollisionShape :ref:`Dictionary` **to_dictionary** **(** **)** |const| -Serializes this GLTFPhysicsShape instance into a :ref:`Dictionary`. +Serializes this GLTFPhysicsShape instance into a :ref:`Dictionary` in the format defined by ``OMI_physics_shape``. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfskeleton.rst b/classes/class_gltfskeleton.rst index 1aa46311175..f864657c3e8 100644 --- a/classes/class_gltfskeleton.rst +++ b/classes/class_gltfskeleton.rst @@ -16,6 +16,13 @@ GLTFSkeleton There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_gltfskin.rst b/classes/class_gltfskin.rst index 868b66c4b0f..78424c80d62 100644 --- a/classes/class_gltfskin.rst +++ b/classes/class_gltfskin.rst @@ -16,6 +16,13 @@ GLTFSkin There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_gltfspecgloss.rst b/classes/class_gltfspecgloss.rst index 9afdb215cb8..4b632f34899 100644 --- a/classes/class_gltfspecgloss.rst +++ b/classes/class_gltfspecgloss.rst @@ -26,6 +26,8 @@ KHR_materials_pbrSpecularGlossiness is an archived GLTF extension. This means th Tutorials --------- +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + - `KHR_materials_pbrSpecularGlossiness GLTF extension spec `__ .. rst-class:: classref-reftable-group diff --git a/classes/class_gltfstate.rst b/classes/class_gltfstate.rst index 30797df50f2..d79dbaf5efe 100644 --- a/classes/class_gltfstate.rst +++ b/classes/class_gltfstate.rst @@ -28,6 +28,8 @@ GLTFState can be populated by :ref:`GLTFDocument` reading a Tutorials --------- +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + - `GLTF asset header schema `__ .. rst-class:: classref-reftable-group @@ -75,6 +77,8 @@ Methods +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_used_extension` **(** :ref:`String` extension_name, :ref:`bool` required **)** | +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`append_data_to_buffers` **(** :ref:`PackedByteArray` data, :ref:`bool` deduplication **)** | + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`GLTFAccessor[]` | :ref:`get_accessors` **(** **)** | +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_additional_data` **(** :ref:`StringName` extension_name **)** | @@ -437,6 +441,18 @@ Appends an extension to the list of extensions used by this GLTF file during ser ---- +.. _class_GLTFState_method_append_data_to_buffers: + +.. rst-class:: classref-method + +:ref:`int` **append_data_to_buffers** **(** :ref:`PackedByteArray` data, :ref:`bool` deduplication **)** + +Appends the given byte array data to the buffers and creates a :ref:`GLTFBufferView` for it. The index of the destination :ref:`GLTFBufferView` is returned. If ``deduplication`` is true, the buffers will first be searched for duplicate data, otherwise new bytes will always be appended. + +.. rst-class:: classref-item-separator + +---- + .. _class_GLTFState_method_get_accessors: .. rst-class:: classref-method diff --git a/classes/class_gltftexture.rst b/classes/class_gltftexture.rst index d33b2264fa5..ce77f726ff5 100644 --- a/classes/class_gltftexture.rst +++ b/classes/class_gltftexture.rst @@ -16,6 +16,13 @@ GLTFTexture There is currently no description for this class. Please help us by :ref:`contributing one `! +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_gltftexturesampler.rst b/classes/class_gltftexturesampler.rst index 9eebd5254e9..9808ea3140d 100644 --- a/classes/class_gltftexturesampler.rst +++ b/classes/class_gltftexturesampler.rst @@ -21,6 +21,13 @@ Description Represents a texture sampler as defined by the base GLTF spec. Texture samplers in GLTF specify how to sample data from the texture's base image, when rendering the texture on an object. +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_gpuparticles2d.rst b/classes/class_gpuparticles2d.rst index ce2af27c363..b1f43904827 100644 --- a/classes/class_gpuparticles2d.rst +++ b/classes/class_gpuparticles2d.rst @@ -160,7 +160,7 @@ Particles are drawn in the order emitted. :ref:`DrawOrder` **DRAW_ORDER_LIFETIME** = ``1`` -Particles are drawn in order of remaining lifetime. +Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. .. _class_GPUParticles2D_constant_DRAW_ORDER_REVERSE_LIFETIME: @@ -168,7 +168,7 @@ Particles are drawn in order of remaining lifetime. :ref:`DrawOrder` **DRAW_ORDER_REVERSE_LIFETIME** = ``2`` - +Particles are drawn in reverse order of remaining lifetime. In other words, the particle with the lowest lifetime is drawn at the front. .. rst-class:: classref-item-separator @@ -692,6 +692,8 @@ void **emit_particle** **(** :ref:`Transform2D` xform, :ref:` Emits a single particle. Whether ``xform``, ``velocity``, ``color`` and ``custom`` are applied depends on the value of ``flags``. See :ref:`EmitFlags`. +The default ParticleProcessMaterial will overwrite ``color`` and use the contents of ``custom`` as ``(rotation, age, animation, lifetime)``. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_gpuparticles3d.rst b/classes/class_gpuparticles3d.rst index 2079c7ed48b..4ab0ac4e0e0 100644 --- a/classes/class_gpuparticles3d.rst +++ b/classes/class_gpuparticles3d.rst @@ -170,7 +170,7 @@ Particles are drawn in the order emitted. :ref:`DrawOrder` **DRAW_ORDER_LIFETIME** = ``1`` -Particles are drawn in order of remaining lifetime. +Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. .. _class_GPUParticles3D_constant_DRAW_ORDER_REVERSE_LIFETIME: @@ -178,7 +178,7 @@ Particles are drawn in order of remaining lifetime. :ref:`DrawOrder` **DRAW_ORDER_REVERSE_LIFETIME** = ``2`` - +Particles are drawn in reverse order of remaining lifetime. In other words, the particle with the lowest lifetime is drawn at the front. .. _class_GPUParticles3D_constant_DRAW_ORDER_VIEW_DEPTH: @@ -254,6 +254,10 @@ enum **TransformAlign**: :ref:`TransformAlign` **TRANSFORM_ALIGN_DISABLED** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_GPUParticles3D_constant_TRANSFORM_ALIGN_Z_BILLBOARD: @@ -262,6 +266,10 @@ enum **TransformAlign**: :ref:`TransformAlign` **TRANSFORM_ALIGN_Z_BILLBOARD** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_GPUParticles3D_constant_TRANSFORM_ALIGN_Y_TO_VELOCITY: @@ -270,6 +278,10 @@ enum **TransformAlign**: :ref:`TransformAlign` **TRANSFORM_ALIGN_Y_TO_VELOCITY** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_GPUParticles3D_constant_TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY: @@ -278,6 +290,10 @@ enum **TransformAlign**: :ref:`TransformAlign` **TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator @@ -843,6 +859,8 @@ void **emit_particle** **(** :ref:`Transform3D` xform, :ref:` Emits a single particle. Whether ``xform``, ``velocity``, ``color`` and ``custom`` are applied depends on the value of ``flags``. See :ref:`EmitFlags`. +The default ParticleProcessMaterial will overwrite ``color`` and use the contents of ``custom`` as ``(rotation, age, animation, lifetime)``. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_graphedit.rst b/classes/class_graphedit.rst index 56ba0cb75c6..45f46809dc3 100644 --- a/classes/class_graphedit.rst +++ b/classes/class_graphedit.rst @@ -40,10 +40,12 @@ Properties +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`float` | :ref:`connection_lines_curvature` | ``0.5`` | +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ - | :ref:`float` | :ref:`connection_lines_thickness` | ``2.0`` | + | :ref:`float` | :ref:`connection_lines_thickness` | ``4.0`` | +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ + | :ref:`GridPattern` | :ref:`grid_pattern` | ``0`` | + +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`bool` | :ref:`minimap_enabled` | ``true`` | +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`float` | :ref:`minimap_opacity` | ``0.65`` | @@ -116,10 +118,14 @@ Methods +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`force_connection_drag_end` **(** **)** | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedVector2Array` | :ref:`get_connection_line` **(** :ref:`Vector2` from_node, :ref:`Vector2` to_node **)** | + | :ref:`Dictionary` | :ref:`get_closest_connection_at_point` **(** :ref:`Vector2` point, :ref:`float` max_distance=4.0 **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedVector2Array` | :ref:`get_connection_line` **(** :ref:`Vector2` from_node, :ref:`Vector2` to_node **)** |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary[]` | :ref:`get_connection_list` **(** **)** |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Dictionary[]` | :ref:`get_connections_intersecting_with_rect` **(** :ref:`Rect2` rect **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`HBoxContainer` | :ref:`get_menu_hbox` **(** **)** | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_node_connected` **(** :ref:`StringName` from_node, :ref:`int` from_port, :ref:`StringName` to_node, :ref:`int` to_port **)** | @@ -145,39 +151,45 @@ Theme Properties .. table:: :widths: auto - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :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:`port_hotzone_inner_extent` | ``22`` | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`int` | :ref:`port_hotzone_outer_extent` | ``26`` | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`Texture2D` | :ref:`grid_toggle` | | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`Texture2D` | :ref:`layout` | | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`Texture2D` | :ref:`minimap_toggle` | | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`Texture2D` | :ref:`snapping_toggle` | | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`Texture2D` | :ref:`zoom_in` | | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`Texture2D` | :ref:`zoom_out` | | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`Texture2D` | :ref:`zoom_reset` | | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`StyleBox` | :ref:`menu_panel` | | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ - | :ref:`StyleBox` | :ref:`panel` | | - +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+ + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Color` | :ref:`activity` | ``Color(1, 1, 1, 1)`` | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Color` | :ref:`connection_hover_tint_color` | ``Color(0, 0, 0, 0.3)`` | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Color` | :ref:`connection_rim_color` | ``Color(0.1, 0.1, 0.1, 0.6)`` | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Color` | :ref:`connection_valid_target_tint_color` | ``Color(1, 1, 1, 0.4)`` | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :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:`port_hotzone_inner_extent` | ``22`` | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`int` | :ref:`port_hotzone_outer_extent` | ``26`` | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Texture2D` | :ref:`grid_toggle` | | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Texture2D` | :ref:`layout` | | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Texture2D` | :ref:`minimap_toggle` | | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Texture2D` | :ref:`snapping_toggle` | | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Texture2D` | :ref:`zoom_in` | | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Texture2D` | :ref:`zoom_out` | | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`Texture2D` | :ref:`zoom_reset` | | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`StyleBox` | :ref:`menu_panel` | | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ + | :ref:`StyleBox` | :ref:`panel` | | + +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+ .. rst-class:: classref-section-separator @@ -194,7 +206,7 @@ Signals **begin_node_move** **(** **)** -Emitted at the beginning of a GraphNode movement. +Emitted at the beginning of a :ref:`GraphElement`'s movement. .. rst-class:: classref-item-separator @@ -266,7 +278,7 @@ Emitted when user drags a connection from an output port into the empty space of **copy_nodes_request** **(** **)** -Emitted when the user presses :kbd:`Ctrl + C`. +Emitted when this **GraphEdit** captures a ``ui_copy`` action (:kbd:`Ctrl + C` by default). In general, this signal indicates that the selected :ref:`GraphElement`\ s should be copied. .. rst-class:: classref-item-separator @@ -278,7 +290,9 @@ Emitted when the user presses :kbd:`Ctrl + C`. **delete_nodes_request** **(** :ref:`StringName[]` nodes **)** -Emitted when attempting to remove a GraphNode from the GraphEdit. Provides a list of node names to be removed (all selected nodes, excluding nodes without closing button). +Emitted when this **GraphEdit** captures a ``ui_graph_delete`` action (:kbd:`Delete` by default). + +\ ``nodes`` is an array of node names that should be removed. These usually include all selected nodes. .. rst-class:: classref-item-separator @@ -302,7 +316,7 @@ Emitted to the GraphEdit when the connection between ``from_port`` of ``from_nod **duplicate_nodes_request** **(** **)** -Emitted when a GraphNode is attempted to be duplicated in the GraphEdit. +Emitted when this **GraphEdit** captures a ``ui_graph_duplicate`` action (:kbd:`Ctrl + D` by default). In general, this signal indicates that the selected :ref:`GraphElement`\ s should be duplicated. .. rst-class:: classref-item-separator @@ -314,7 +328,7 @@ Emitted when a GraphNode is attempted to be duplicated in the GraphEdit. **end_node_move** **(** **)** -Emitted at the end of a GraphNode movement. +Emitted at the end of a :ref:`GraphElement`'s movement. .. rst-class:: classref-item-separator @@ -326,9 +340,7 @@ Emitted at the end of a GraphNode movement. **node_deselected** **(** :ref:`Node` node **)** -.. container:: contribute - - There is currently no description for this signal. Please help us by :ref:`contributing one `! +Emitted when the given :ref:`GraphElement` node is deselected. .. rst-class:: classref-item-separator @@ -340,7 +352,7 @@ Emitted at the end of a GraphNode movement. **node_selected** **(** :ref:`Node` node **)** -Emitted when a GraphNode is selected. +Emitted when the given :ref:`GraphElement` node is selected. .. rst-class:: classref-item-separator @@ -352,7 +364,7 @@ Emitted when a GraphNode is selected. **paste_nodes_request** **(** **)** -Emitted when the user presses :kbd:`Ctrl + V`. +Emitted when this **GraphEdit** captures a ``ui_paste`` action (:kbd:`Ctrl + V` by default). In general, this signal indicates that previously copied :ref:`GraphElement`\ s should be pasted. .. rst-class:: classref-item-separator @@ -409,6 +421,32 @@ enum **PanningScheme**: :kbd:`Mouse Wheel` will move the view, :kbd:`Ctrl + Mouse Wheel` will zoom. +.. rst-class:: classref-item-separator + +---- + +.. _enum_GraphEdit_GridPattern: + +.. rst-class:: classref-enumeration + +enum **GridPattern**: + +.. _class_GraphEdit_constant_GRID_PATTERN_LINES: + +.. rst-class:: classref-enumeration-constant + +:ref:`GridPattern` **GRID_PATTERN_LINES** = ``0`` + +Draw the grid using solid lines. + +.. _class_GraphEdit_constant_GRID_PATTERN_DOTS: + +.. rst-class:: classref-enumeration-constant + +:ref:`GridPattern` **GRID_PATTERN_DOTS** = ``1`` + +Draw the grid using dots. + .. rst-class:: classref-section-separator ---- @@ -456,7 +494,7 @@ The curvature of the lines between the nodes. 0 results in straight lines. .. rst-class:: classref-property -:ref:`float` **connection_lines_thickness** = ``2.0`` +:ref:`float` **connection_lines_thickness** = ``4.0`` .. rst-class:: classref-property-setget @@ -469,6 +507,23 @@ The thickness of the lines between the nodes. ---- +.. _class_GraphEdit_property_grid_pattern: + +.. rst-class:: classref-property + +:ref:`GridPattern` **grid_pattern** = ``0`` + +.. rst-class:: classref-property-setget + +- void **set_grid_pattern** **(** :ref:`GridPattern` value **)** +- :ref:`GridPattern` **get_grid_pattern** **(** **)** + +The pattern used for drawing the grid. + +.. rst-class:: classref-item-separator + +---- + .. _class_GraphEdit_property_minimap_enabled: .. rst-class:: classref-property @@ -988,6 +1043,31 @@ This is best used together with :ref:`connection_drag_started`. +.. rst-class:: classref-item-separator + +---- + +.. _class_GraphEdit_method_get_closest_connection_at_point: + +.. rst-class:: classref-method + +:ref:`Dictionary` **get_closest_connection_at_point** **(** :ref:`Vector2` point, :ref:`float` max_distance=4.0 **)** |const| + +Returns the closest connection to the given point in screen space. If no connection is found within ``max_distance`` pixels, an empty :ref:`Dictionary` is returned. + +A connection consists in a structure of the form ``{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }``. + +For example, getting a connection at a given mouse position can be achieved like this: + + +.. tabs:: + + .. code-tab:: gdscript + + var connection = get_closest_connection_at_point(mouse_event.get_position()) + + + .. rst-class:: classref-item-separator ---- @@ -996,7 +1076,7 @@ This is best used together with :ref:`connection_drag_started` **get_connection_line** **(** :ref:`Vector2` from_node, :ref:`Vector2` to_node **)** +:ref:`PackedVector2Array` **get_connection_line** **(** :ref:`Vector2` from_node, :ref:`Vector2` to_node **)** |const| Returns the points which would make up a connection between ``from_node`` and ``to_node``. @@ -1010,7 +1090,19 @@ Returns the points which would make up a connection between ``from_node`` and `` :ref:`Dictionary[]` **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" }``. +Returns an :ref:`Array` containing the list of connections. A connection consists in a structure of the form ``{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_GraphEdit_method_get_connections_intersecting_with_rect: + +.. rst-class:: classref-method + +:ref:`Dictionary[]` **get_connections_intersecting_with_rect** **(** :ref:`Rect2` rect **)** |const| + +Returns an :ref:`Array` containing the list of connections that intersect with the given :ref:`Rect2`. A connection consists in a structure of the form ``{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }``. .. rst-class:: classref-item-separator @@ -1129,7 +1221,43 @@ Theme Property Descriptions :ref:`Color` **activity** = ``Color(1, 1, 1, 1)`` -Color of the connection's activity (see :ref:`set_connection_activity`). +Color the connection line is interpolated to based on the activity value of a connection (see :ref:`set_connection_activity`). + +.. rst-class:: classref-item-separator + +---- + +.. _class_GraphEdit_theme_color_connection_hover_tint_color: + +.. rst-class:: classref-themeproperty + +:ref:`Color` **connection_hover_tint_color** = ``Color(0, 0, 0, 0.3)`` + +Color which is blended with the connection line when the mouse is hovering over it. + +.. rst-class:: classref-item-separator + +---- + +.. _class_GraphEdit_theme_color_connection_rim_color: + +.. rst-class:: classref-themeproperty + +:ref:`Color` **connection_rim_color** = ``Color(0.1, 0.1, 0.1, 0.6)`` + +Color of the rim around each connection line used for making intersecting lines more distinguishable. + +.. rst-class:: classref-item-separator + +---- + +.. _class_GraphEdit_theme_color_connection_valid_target_tint_color: + +.. rst-class:: classref-themeproperty + +:ref:`Color` **connection_valid_target_tint_color** = ``Color(1, 1, 1, 0.4)`` + +Color which is blended with the connection line when the currently dragged connection is hovering over a valid target port. .. rst-class:: classref-item-separator @@ -1141,7 +1269,7 @@ Color of the connection's activity (see :ref:`set_connection_activity` **grid_major** = ``Color(1, 1, 1, 0.2)`` -Color of major grid lines. +Color of major grid lines/dots. .. rst-class:: classref-item-separator @@ -1153,7 +1281,7 @@ Color of major grid lines. :ref:`Color` **grid_minor** = ``Color(1, 1, 1, 0.05)`` -Color of minor grid lines. +Color of minor grid lines/dots. .. rst-class:: classref-item-separator diff --git a/classes/class_graphnode.rst b/classes/class_graphnode.rst index 75aa4747a83..91a0ce19b4a 100644 --- a/classes/class_graphnode.rst +++ b/classes/class_graphnode.rst @@ -80,6 +80,10 @@ Methods +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_slot_color_right` **(** :ref:`int` slot_index **)** |const| | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Texture2D` | :ref:`get_slot_custom_icon_left` **(** :ref:`int` slot_index **)** |const| | + +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Texture2D` | :ref:`get_slot_custom_icon_right` **(** :ref:`int` slot_index **)** |const| | + +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_slot_type_left` **(** :ref:`int` slot_index **)** |const| | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_slot_type_right` **(** :ref:`int` slot_index **)** |const| | @@ -98,6 +102,10 @@ Methods +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_color_right` **(** :ref:`int` slot_index, :ref:`Color` color **)** | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_slot_custom_icon_left` **(** :ref:`int` slot_index, :ref:`Texture2D` custom_icon **)** | + +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_slot_custom_icon_right` **(** :ref:`int` slot_index, :ref:`Texture2D` custom_icon **)** | + +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_draw_stylebox` **(** :ref:`int` slot_index, :ref:`bool` enable **)** | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_enabled_left` **(** :ref:`int` slot_index, :ref:`bool` enable **)** | @@ -367,6 +375,30 @@ Returns the right (output) :ref:`Color` of the slot with the given ---- +.. _class_GraphNode_method_get_slot_custom_icon_left: + +.. rst-class:: classref-method + +:ref:`Texture2D` **get_slot_custom_icon_left** **(** :ref:`int` slot_index **)** |const| + +Returns the left (input) custom :ref:`Texture2D` of the slot with the given ``slot_index``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_GraphNode_method_get_slot_custom_icon_right: + +.. rst-class:: classref-method + +:ref:`Texture2D` **get_slot_custom_icon_right** **(** :ref:`int` slot_index **)** |const| + +Returns the right (output) custom :ref:`Texture2D` of the slot with the given ``slot_index``. + +.. rst-class:: classref-item-separator + +---- + .. _class_GraphNode_method_get_slot_type_left: .. rst-class:: classref-method @@ -487,6 +519,30 @@ Sets the :ref:`Color` of the right (output) side of the slot with t ---- +.. _class_GraphNode_method_set_slot_custom_icon_left: + +.. rst-class:: classref-method + +void **set_slot_custom_icon_left** **(** :ref:`int` slot_index, :ref:`Texture2D` custom_icon **)** + +Sets the custom :ref:`Texture2D` of the left (input) side of the slot with the given ``slot_index`` to ``custom_icon``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_GraphNode_method_set_slot_custom_icon_right: + +.. rst-class:: classref-method + +void **set_slot_custom_icon_right** **(** :ref:`int` slot_index, :ref:`Texture2D` custom_icon **)** + +Sets the custom :ref:`Texture2D` of the right (output) side of the slot with the given ``slot_index`` to ``custom_icon``. + +.. rst-class:: classref-item-separator + +---- + .. _class_GraphNode_method_set_slot_draw_stylebox: .. rst-class:: classref-method diff --git a/classes/class_heightmapshape3d.rst b/classes/class_heightmapshape3d.rst index 1f9c6296221..2e43c5717a6 100644 --- a/classes/class_heightmapshape3d.rst +++ b/classes/class_heightmapshape3d.rst @@ -39,6 +39,20 @@ Properties | :ref:`int` | :ref:`map_width` | ``2`` | +-----------------------------------------------------+-------------------------------------------------------------+------------------------------------+ +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +---------------------------+-----------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_max_height` **(** **)** |const| | + +---------------------------+-----------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_min_height` **(** **)** |const| | + +---------------------------+-----------------------------------------------------------------------------------------+ + .. rst-class:: classref-section-separator ---- @@ -59,7 +73,7 @@ Property Descriptions - void **set_map_data** **(** :ref:`PackedFloat32Array` value **)** - :ref:`PackedFloat32Array` **get_map_data** **(** **)** -Height map data, pool array must be of :ref:`map_width` \* :ref:`map_depth` size. +Height map data. The array's size must be equal to :ref:`map_width` multiplied by :ref:`map_depth`. .. rst-class:: classref-item-separator @@ -95,6 +109,35 @@ Number of vertices in the depth of the height map. Changing this will resize the Number of vertices in the width of the height map. Changing this will resize the :ref:`map_data`. +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_HeightMapShape3D_method_get_max_height: + +.. rst-class:: classref-method + +:ref:`float` **get_max_height** **(** **)** |const| + +Returns the largest height value found in :ref:`map_data`. Recalculates only when :ref:`map_data` changes. + +.. rst-class:: classref-item-separator + +---- + +.. _class_HeightMapShape3D_method_get_min_height: + +.. rst-class:: classref-method + +:ref:`float` **get_min_height** **(** **)** |const| + +Returns the smallest height value found in :ref:`map_data`. Recalculates only when :ref:`map_data` 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_hingejoint3d.rst b/classes/class_hingejoint3d.rst index a98df7aa472..00d79f08993 100644 --- a/classes/class_hingejoint3d.rst +++ b/classes/class_hingejoint3d.rst @@ -122,6 +122,10 @@ The speed with which the rotation across the axis perpendicular to the hinge get :ref:`Param` **PARAM_LIMIT_SOFTNESS** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_HingeJoint3D_constant_PARAM_LIMIT_RELAXATION: diff --git a/classes/class_httprequest.rst b/classes/class_httprequest.rst index 9856b5c0c4e..879ef1766dc 100644 --- a/classes/class_httprequest.rst +++ b/classes/class_httprequest.rst @@ -290,6 +290,10 @@ Request successful. :ref:`Result` **RESULT_CHUNKED_BODY_SIZE_MISMATCH** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_HTTPRequest_constant_RESULT_CANT_CONNECT: @@ -346,6 +350,10 @@ Request exceeded its maximum size limit, see :ref:`body_size_limit` **RESULT_BODY_DECOMPRESS_FAILED** = ``8`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_HTTPRequest_constant_RESULT_REQUEST_FAILED: diff --git a/classes/class_image.rst b/classes/class_image.rst index 8a1e4e1baa0..df3f4342bfd 100644 --- a/classes/class_image.rst +++ b/classes/class_image.rst @@ -32,6 +32,8 @@ Tutorials - :doc:`Importing images <../tutorials/assets_pipeline/importing_images>` +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties @@ -273,7 +275,7 @@ OpenGL texture format ``RGBA`` with four components, each with a bitdepth of 4. :ref:`Format` **FORMAT_RGB565** = ``7`` - +OpenGL texture format ``RGB`` with three components. Red and blue have a bitdepth of 5, and green has a bitdepth of 6. .. _class_Image_constant_FORMAT_RF: @@ -495,7 +497,7 @@ Texture format that uses `BPTC ` **FORMAT_ETC2_RA_AS_RG** = ``33`` - +`Ericsson Texture Compression format 2 `__ (``RGBA8`` variant), which compresses RA data and interprets it as two channels (red and green). See also :ref:`FORMAT_ETC2_RGBA8`. .. _class_Image_constant_FORMAT_DXT5_RA_AS_RG: @@ -503,7 +505,7 @@ Texture format that uses `BPTC ` **FORMAT_DXT5_RA_AS_RG** = ``34`` - +The `S3TC `__ texture format also known as Block Compression 3 or BC3, which compresses RA data and interprets it as two channels (red and green). See also :ref:`FORMAT_DXT5`. .. _class_Image_constant_FORMAT_ASTC_4x4: @@ -601,7 +603,7 @@ On the other hand, if the image already has mipmaps, they will be used, and a ne :ref:`Interpolation` **INTERPOLATE_LANCZOS** = ``4`` -Performs Lanczos interpolation. This is the slowest image resizing mode, but it typically gives the best results, especially when downscalng images. +Performs Lanczos interpolation. This is the slowest image resizing mode, but it typically gives the best results, especially when downscaling images. .. rst-class:: classref-item-separator @@ -711,7 +713,7 @@ enum **UsedChannels**: :ref:`UsedChannels` **USED_CHANNELS_L** = ``0`` - +The image only uses one channel for luminance (grayscale). .. _class_Image_constant_USED_CHANNELS_LA: @@ -719,7 +721,7 @@ enum **UsedChannels**: :ref:`UsedChannels` **USED_CHANNELS_LA** = ``1`` - +The image uses two channels for luminance and alpha, respectively. .. _class_Image_constant_USED_CHANNELS_R: @@ -727,7 +729,7 @@ enum **UsedChannels**: :ref:`UsedChannels` **USED_CHANNELS_R** = ``2`` - +The image only uses the red channel. .. _class_Image_constant_USED_CHANNELS_RG: @@ -735,7 +737,7 @@ enum **UsedChannels**: :ref:`UsedChannels` **USED_CHANNELS_RG** = ``3`` - +The image uses two channels for red and green. .. _class_Image_constant_USED_CHANNELS_RGB: @@ -743,7 +745,7 @@ enum **UsedChannels**: :ref:`UsedChannels` **USED_CHANNELS_RGB** = ``4`` - +The image uses three channels for red, green, and blue. .. _class_Image_constant_USED_CHANNELS_RGBA: @@ -751,7 +753,7 @@ enum **UsedChannels**: :ref:`UsedChannels` **USED_CHANNELS_RGBA** = ``5`` - +The image uses four channels for red, green, blue, and alpha. .. rst-class:: classref-item-separator @@ -870,9 +872,7 @@ Method Descriptions void **adjust_bcs** **(** :ref:`float` brightness, :ref:`float` contrast, :ref:`float` saturation **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Adjusts this image's ``brightness``, ``contrast``, and ``saturation`` by the given values. Does not work if the image is compressed (see :ref:`is_compressed`). .. rst-class:: classref-item-separator @@ -1088,9 +1088,7 @@ Returns :ref:`ALPHA_BLEND` if the image has da :ref:`UsedChannels` **detect_used_channels** **(** :ref:`CompressSource` source=0 **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the color channels used by this image, as one of the :ref:`UsedChannels` constants. If the image is compressed, the original ``source`` must be specified. .. rst-class:: classref-item-separator @@ -1162,9 +1160,9 @@ Flips the image vertically. :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``. Enabling ``renormalize`` when generating mipmaps for normal textures will make sure all resulting vector values are normalized. +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``. Enabling ``renormalize`` when generating mipmaps for normal map textures will make sure all resulting vector values are normalized. -It is possible to check if the image has mipmaps by calling :ref:`has_mipmaps` or :ref:`get_mipmap_count`. +It is possible to check if the image has mipmaps by calling :ref:`has_mipmaps` or :ref:`get_mipmap_count`. Calling :ref:`generate_mipmaps` on an image that already has mipmaps will replace existing mipmaps in the image. .. rst-class:: classref-item-separator @@ -1380,6 +1378,8 @@ 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. +\ **Note:** This method is only available in engine builds with the BMP module enabled. By default, the BMP module is enabled, but it can be disabled at build-time using the ``module_bmp_enabled=no`` SCons option. + .. rst-class:: classref-item-separator ---- @@ -1414,7 +1414,11 @@ Loads an image from the binary contents of a JPEG file. :ref:`Error` **load_ktx_from_buffer** **(** :ref:`PackedByteArray` buffer **)** -Loads an image from the binary contents of a KTX file. +Loads an image from the binary contents of a `KTX `__ file. Unlike most image formats, KTX can store VRAM-compressed data and embed mipmaps. + +\ **Note:** Godot's libktx implementation only supports 2D images. Cubemaps, texture arrays, and de-padding are not supported. + +\ **Note:** This method is only available in engine builds with the KTX module enabled. By default, the KTX module is enabled, but it can be disabled at build-time using the ``module_ktx_enabled=no`` SCons option. .. rst-class:: classref-item-separator @@ -1470,6 +1474,8 @@ Loads an image from the string contents of a SVG file (**.svg**). Loads an image from the binary contents of a TGA file. +\ **Note:** This method is only available in engine builds with the TGA module enabled. By default, the TGA module is enabled, but it can be disabled at build-time using the ``module_tga_enabled=no`` SCons option. + .. rst-class:: classref-item-separator ---- @@ -1504,7 +1510,7 @@ Converts the image's data to represent coordinates on a 3D plane. This is used w void **premultiply_alpha** **(** **)** -Multiplies color values with alpha values. Resulting color values for a pixel are ``(color * alpha)/256``. +Multiplies color values with alpha values. Resulting color values for a pixel are ``(color * alpha)/256``. See also :ref:`CanvasItemMaterial.blend_mode`. .. rst-class:: classref-item-separator @@ -1656,7 +1662,9 @@ Saves the image as a PNG file to a byte array. :ref:`Error` **save_webp** **(** :ref:`String` path, :ref:`bool` lossy=false, :ref:`float` quality=0.75 **)** |const| -Saves the image as a WebP (Web Picture) file to the file at ``path``. By default it will save lossless. If ``lossy`` is true, the image will be saved lossy, using the ``quality`` setting between 0.0 and 1.0 (inclusive). +Saves the image as a WebP (Web Picture) file to the file at ``path``. By default it will save lossless. If ``lossy`` is true, the image will be saved lossy, using the ``quality`` setting between 0.0 and 1.0 (inclusive). Lossless WebP offers more efficient compression than PNG. + +\ **Note:** The WebP format is limited to a size of 16383×16383 pixels, while PNG can save larger images. .. rst-class:: classref-item-separator @@ -1668,7 +1676,9 @@ Saves the image as a WebP (Web Picture) file to the file at ``path``. By default :ref:`PackedByteArray` **save_webp_to_buffer** **(** :ref:`bool` lossy=false, :ref:`float` quality=0.75 **)** |const| -Saves the image as a WebP (Web Picture) file to a byte array. By default it will save lossless. If ``lossy`` is true, the image will be saved lossy, using the ``quality`` setting between 0.0 and 1.0 (inclusive). +Saves the image as a WebP (Web Picture) file to a byte array. By default it will save lossless. If ``lossy`` is true, the image will be saved lossy, using the ``quality`` setting between 0.0 and 1.0 (inclusive). Lossless WebP offers more efficient compression than PNG. + +\ **Note:** The WebP format is limited to a size of 16383×16383 pixels, while PNG can save larger images. .. rst-class:: classref-item-separator @@ -1766,7 +1776,7 @@ This is the same as :ref:`set_pixel`, but with a : void **shrink_x2** **(** **)** -Shrinks the image by a factor of 2. +Shrinks the image by a factor of 2 on each axis (this divides the pixel count by 4). .. rst-class:: classref-item-separator diff --git a/classes/class_imageformatloader.rst b/classes/class_imageformatloader.rst index 19a9142f9c6..adef52d804a 100644 --- a/classes/class_imageformatloader.rst +++ b/classes/class_imageformatloader.rst @@ -44,6 +44,10 @@ flags **LoaderFlags**: :ref:`LoaderFlags` **FLAG_NONE** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ImageFormatLoader_constant_FLAG_FORCE_LINEAR: @@ -52,6 +56,10 @@ flags **LoaderFlags**: :ref:`LoaderFlags` **FLAG_FORCE_LINEAR** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ImageFormatLoader_constant_FLAG_CONVERT_COLORS: @@ -60,6 +68,10 @@ flags **LoaderFlags**: :ref:`LoaderFlags` **FLAG_CONVERT_COLORS** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` diff --git a/classes/class_input.rst b/classes/class_input.rst index b36ec486987..29fb4b54060 100644 --- a/classes/class_input.rst +++ b/classes/class_input.rst @@ -42,11 +42,15 @@ Properties .. table:: :widths: auto - +----------------------------------------+--------------------------------------------------------------------------+ - | :ref:`MouseMode` | :ref:`mouse_mode` | - +----------------------------------------+--------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`use_accumulated_input` | - +----------------------------------------+--------------------------------------------------------------------------+ + +----------------------------------------+--------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`emulate_mouse_from_touch` | + +----------------------------------------+--------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`emulate_touch_from_mouse` | + +----------------------------------------+--------------------------------------------------------------------------------+ + | :ref:`MouseMode` | :ref:`mouse_mode` | + +----------------------------------------+--------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`use_accumulated_input` | + +----------------------------------------+--------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -93,6 +97,8 @@ Methods +-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_joy_vibration_strength` **(** :ref:`int` device **)** | +-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`get_last_mouse_screen_velocity` **(** **)** | + +-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_last_mouse_velocity` **(** **)** | +-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_magnetometer` **(** **)** |const| | @@ -379,6 +385,40 @@ Help cursor. Usually a question mark. Property Descriptions --------------------- +.. _class_Input_property_emulate_mouse_from_touch: + +.. rst-class:: classref-property + +:ref:`bool` **emulate_mouse_from_touch** + +.. rst-class:: classref-property-setget + +- void **set_emulate_mouse_from_touch** **(** :ref:`bool` value **)** +- :ref:`bool` **is_emulating_mouse_from_touch** **(** **)** + +If ``true``, sends mouse input events when tapping or swiping on the touchscreen. See also :ref:`ProjectSettings.input_devices/pointing/emulate_mouse_from_touch`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Input_property_emulate_touch_from_mouse: + +.. rst-class:: classref-property + +:ref:`bool` **emulate_touch_from_mouse** + +.. rst-class:: classref-property-setget + +- void **set_emulate_touch_from_mouse** **(** :ref:`bool` value **)** +- :ref:`bool` **is_emulating_touch_from_mouse** **(** **)** + +If ``true``, sends touch input events when clicking or dragging the mouse. See also :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse`. + +.. rst-class:: classref-item-separator + +---- + .. _class_Input_property_mouse_mode: .. rst-class:: classref-property @@ -672,6 +712,18 @@ Returns the strength of the joypad vibration: x is the strength of the weak moto ---- +.. _class_Input_method_get_last_mouse_screen_velocity: + +.. rst-class:: classref-method + +:ref:`Vector2` **get_last_mouse_screen_velocity** **(** **)** + +Returns the last mouse velocity in screen coordinates. To provide a precise and jitter-free velocity, mouse velocity is only calculated every 0.1s. Therefore, mouse velocity will lag mouse movements. + +.. rst-class:: classref-item-separator + +---- + .. _class_Input_method_get_last_mouse_velocity: .. rst-class:: classref-method diff --git a/classes/class_inputeventjoypadbutton.rst b/classes/class_inputeventjoypadbutton.rst index ba3001a3d16..ad6dc8077a2 100644 --- a/classes/class_inputeventjoypadbutton.rst +++ b/classes/class_inputeventjoypadbutton.rst @@ -98,7 +98,9 @@ If ``true``, the button's state is pressed. If ``false``, the button's state is - void **set_pressure** **(** :ref:`float` value **)** - :ref:`float` **get_pressure** **(** **)** -Represents the pressure the user puts on the button with their finger, if the controller supports it. Ranges from ``0`` to ``1``. +Represents the pressure the user puts on a pressure-sensitive button. + +\ *Deprecated.* This property is never set by the engine and is always ``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.)` diff --git a/classes/class_inputeventkey.rst b/classes/class_inputeventkey.rst index b3606a1e9eb..1d448257208 100644 --- a/classes/class_inputeventkey.rst +++ b/classes/class_inputeventkey.rst @@ -40,19 +40,21 @@ Properties .. table:: :widths: auto - +-----------------------------------+------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`echo` | ``false`` | - +-----------------------------------+------------------------------------------------------------------------+-----------+ - | :ref:`Key` | :ref:`key_label` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------+-----------+ - | :ref:`Key` | :ref:`keycode` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------+-----------+ - | :ref:`Key` | :ref:`physical_keycode` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`pressed` | ``false`` | - +-----------------------------------+------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`unicode` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------+-----------+ + +---------------------------------------------------+------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`echo` | ``false`` | + +---------------------------------------------------+------------------------------------------------------------------------+-----------+ + | :ref:`Key` | :ref:`key_label` | ``0`` | + +---------------------------------------------------+------------------------------------------------------------------------+-----------+ + | :ref:`Key` | :ref:`keycode` | ``0`` | + +---------------------------------------------------+------------------------------------------------------------------------+-----------+ + | :ref:`KeyLocation` | :ref:`location` | ``0`` | + +---------------------------------------------------+------------------------------------------------------------------------+-----------+ + | :ref:`Key` | :ref:`physical_keycode` | ``0`` | + +---------------------------------------------------+------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`pressed` | ``false`` | + +---------------------------------------------------+------------------------------------------------------------------------+-----------+ + | :ref:`int` | :ref:`unicode` | ``0`` | + +---------------------------------------------------+------------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group @@ -67,6 +69,8 @@ Methods +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`as_text_keycode` **(** **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`as_text_location` **(** **)** |const| | + +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`as_text_physical_keycode` **(** **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Key` | :ref:`get_key_label_with_modifiers` **(** **)** |const| | @@ -156,6 +160,23 @@ To get a human-readable representation of the **InputEventKey**, use ``OS.get_ke ---- +.. _class_InputEventKey_property_location: + +.. rst-class:: classref-property + +:ref:`KeyLocation` **location** = ``0`` + +.. rst-class:: classref-property-setget + +- void **set_location** **(** :ref:`KeyLocation` value **)** +- :ref:`KeyLocation` **get_location** **(** **)** + +Represents the location of a key which has both left and right versions, such as :kbd:`Shift` or :kbd:`Alt`. + +.. rst-class:: classref-item-separator + +---- + .. _class_InputEventKey_property_physical_keycode: .. rst-class:: classref-property @@ -261,6 +282,18 @@ Returns a :ref:`String` representation of the event's :ref:`keycod ---- +.. _class_InputEventKey_method_as_text_location: + +.. rst-class:: classref-method + +:ref:`String` **as_text_location** **(** **)** |const| + +Returns a :ref:`String` representation of the event's :ref:`location`. This will be a blank string if the event is not specific to a location. + +.. rst-class:: classref-item-separator + +---- + .. _class_InputEventKey_method_as_text_physical_keycode: .. rst-class:: classref-method diff --git a/classes/class_inputeventmidi.rst b/classes/class_inputeventmidi.rst index 901b5215869..c68c144d91e 100644 --- a/classes/class_inputeventmidi.rst +++ b/classes/class_inputeventmidi.rst @@ -12,18 +12,18 @@ InputEventMIDI **Inherits:** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Represents an input event from a MIDI device, such as a piano. +Represents a MIDI message from a MIDI device, such as a musical keyboard. .. rst-class:: classref-introduction-group Description ----------- -InputEventMIDI allows receiving input events from MIDI (Musical Instrument Digital Interface) devices such as a piano. +InputEventMIDI stores information about messages from `MIDI `__ (Musical Instrument Digital Interface) devices. These may include musical keyboards, synthesizers, and drum machines. -MIDI signals can be sent over a 5-pin MIDI connector or over USB, if your device supports both be sure to check the settings in the device to see which output it's using. +MIDI messages can be received over a 5-pin MIDI connector or over USB. If your device supports both be sure to check the settings in the device to see which output it is using. -To receive input events from MIDI devices, you need to call :ref:`OS.open_midi_inputs`. You can check which devices are detected using :ref:`OS.get_connected_midi_inputs`. +By default, Godot does not detect MIDI devices. You need to call :ref:`OS.open_midi_inputs`, first. You can check which devices are detected with :ref:`OS.get_connected_midi_inputs`, and close the connection with :ref:`OS.close_midi_inputs`. .. tabs:: @@ -38,16 +38,16 @@ To receive input events from MIDI devices, you need to call :ref:`OS.open_midi_i if input_event is InputEventMIDI: _print_midi_info(input_event) - func _print_midi_info(midi_event: InputEventMIDI): + func _print_midi_info(midi_event): print(midi_event) - print("Channel " + str(midi_event.channel)) - print("Message " + str(midi_event.message)) - print("Pitch " + str(midi_event.pitch)) - print("Velocity " + str(midi_event.velocity)) - print("Instrument " + str(midi_event.instrument)) - print("Pressure " + str(midi_event.pressure)) - print("Controller number: " + str(midi_event.controller_number)) - print("Controller value: " + str(midi_event.controller_value)) + print("Channel ", midi_event.channel) + print("Message ", midi_event.message) + print("Pitch ", midi_event.pitch) + print("Velocity ", midi_event.velocity) + print("Instrument ", midi_event.instrument) + print("Pressure ", midi_event.pressure) + print("Controller number: ", midi_event.controller_number) + print("Controller value: ", midi_event.controller_value) .. code-tab:: csharp @@ -57,9 +57,9 @@ To receive input events from MIDI devices, you need to call :ref:`OS.open_midi_i GD.Print(OS.GetConnectedMidiInputs()); } - public override void _Input(InputEvent @event) + public override void _Input(InputEvent inputEvent) { - if (@event is InputEventMIDI midiEvent) + if (inputEvent is InputEventMIDI midiEvent) { PrintMIDIInfo(midiEvent); } @@ -80,7 +80,7 @@ To receive input events from MIDI devices, you need to call :ref:`OS.open_midi_i -Note that Godot does not currently support MIDI output, so there is no way to emit MIDI signals from Godot. Only MIDI input works. +\ **Note:** Godot does not support MIDI output, so there is no way to emit MIDI messages from Godot. Only MIDI input is supported. .. rst-class:: classref-introduction-group @@ -139,7 +139,7 @@ Property Descriptions - void **set_channel** **(** :ref:`int` value **)** - :ref:`int` **get_channel** **(** **)** -The MIDI channel of this input event. There are 16 channels, so this value ranges from 0 to 15. MIDI channel 9 is reserved for the use with percussion instruments, the rest of the channels are for non-percussion instruments. +The MIDI channel of this message, ranging from ``0`` to ``15``. MIDI channel ``9`` is reserved for percussion instruments. .. rst-class:: classref-item-separator @@ -156,7 +156,7 @@ The MIDI channel of this input event. There are 16 channels, so this value range - void **set_controller_number** **(** :ref:`int` value **)** - :ref:`int` **get_controller_number** **(** **)** -If the message is :ref:`@GlobalScope.MIDI_MESSAGE_CONTROL_CHANGE`, this indicates the controller number, otherwise this is zero. Controllers include devices such as pedals and levers. +The unique number of the controller, if :ref:`message` is :ref:`@GlobalScope.MIDI_MESSAGE_CONTROL_CHANGE`, otherwise this is ``0``. This value can be used to identify sliders for volume, balance, and panning, as well as switches and pedals on the MIDI device. See the `General MIDI specification `__ for a small list. .. rst-class:: classref-item-separator @@ -173,7 +173,7 @@ If the message is :ref:`@GlobalScope.MIDI_MESSAGE_CONTROL_CHANGE` value **)** - :ref:`int` **get_controller_value** **(** **)** -If the message is :ref:`@GlobalScope.MIDI_MESSAGE_CONTROL_CHANGE`, this indicates the controller value, otherwise this is zero. Controllers include devices such as pedals and levers. +The value applied to the controller. If :ref:`message` is :ref:`@GlobalScope.MIDI_MESSAGE_CONTROL_CHANGE`, this value ranges from ``0`` to ``127``, otherwise it is ``0``. See also :ref:`controller_value`. .. rst-class:: classref-item-separator @@ -190,7 +190,9 @@ If the message is :ref:`@GlobalScope.MIDI_MESSAGE_CONTROL_CHANGE` value **)** - :ref:`int` **get_instrument** **(** **)** -The instrument of this input event. This value ranges from 0 to 127. Refer to the instrument list on the General MIDI wikipedia article to see a list of instruments, except that this value is 0-index, so subtract one from every number on that chart. A standard piano will have an instrument number of 0. +The instrument (also called *program* or *preset*) used on this MIDI message. This value ranges from ``0`` to ``127``. + +To see what each value means, refer to the `General MIDI's instrument list `__. Keep in mind that the list is off by 1 because it does not begin from 0. A value of ``0`` corresponds to the acoustic grand piano. .. rst-class:: classref-item-separator @@ -207,15 +209,9 @@ The instrument of this input event. This value ranges from 0 to 127. Refer to th - void **set_message** **(** :ref:`MIDIMessage` value **)** - :ref:`MIDIMessage` **get_message** **(** **)** -Returns a value indicating the type of message for this MIDI signal. This is a member of the :ref:`MIDIMessage` enum. - -For MIDI messages between 0x80 and 0xEF, only the left half of the bits are returned as this value, as the other part is the channel (ex: 0x94 becomes 0x9). For MIDI messages from 0xF0 to 0xFF, the value is returned as-is. - -Notes will return :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_ON` when activated, but they might not always return :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_OFF` when deactivated, therefore your code should treat the input as stopped if some period of time has passed. - -Some MIDI devices may send :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_ON` with zero velocity instead of :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_OFF`. +Represents the type of MIDI message (see the :ref:`MIDIMessage` enum). -For more information, see the note in :ref:`velocity` and the MIDI message status byte list chart linked above. +For more information, see the `MIDI message status byte list chart `__. .. rst-class:: classref-item-separator @@ -232,7 +228,9 @@ For more information, see the note in :ref:`velocity` value **)** - :ref:`int` **get_pitch** **(** **)** -The pitch index number of this MIDI signal. This value ranges from 0 to 127. On a piano, middle C is 60, and A440 is 69, see the "MIDI note" column of the piano key frequency chart on Wikipedia for more information. +The pitch index number of this MIDI message. This value ranges from ``0`` to ``127``. + +On a piano, the **middle C** is ``60``, followed by a **C-sharp** (``61``), then a **D** (``62``), and so on. Each octave is split in offsets of 12. See the "MIDI note number" column of the `piano key frequency chart `__ a full list. .. rst-class:: classref-item-separator @@ -249,7 +247,9 @@ The pitch index number of this MIDI signal. This value ranges from 0 to 127. On - void **set_pressure** **(** :ref:`int` value **)** - :ref:`int` **get_pressure** **(** **)** -The pressure of the MIDI signal. This value ranges from 0 to 127. For many devices, this value is always zero. +The strength of the key being pressed. This value ranges from ``0`` to ``127``. + +\ **Note:** For many devices, this value is always ``0``. Other devices such as musical keyboards may simulate pressure by changing the :ref:`velocity`, instead. .. rst-class:: classref-item-separator @@ -266,9 +266,16 @@ The pressure of the MIDI signal. This value ranges from 0 to 127. For many devic - void **set_velocity** **(** :ref:`int` value **)** - :ref:`int` **get_velocity** **(** **)** -The velocity of the MIDI signal. This value ranges from 0 to 127. For a piano, this corresponds to how quickly the key was pressed, and is rarely above about 110 in practice. +The velocity of the MIDI message. This value ranges from ``0`` to ``127``. For a musical keyboard, this corresponds to how quickly the key was pressed, and is rarely above ``110`` in practice. + +\ **Note:** Some MIDI devices may send a :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_ON` message with ``0`` velocity and expect it to be treated the same as a :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_OFF` message. If necessary, this can be handled with a few lines of code: + +:: -\ **Note:** Some MIDI devices may send a :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_ON` message with zero velocity and expect this to be treated the same as a :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_OFF` message, but device implementations vary so Godot reports event data exactly as received. Depending on the hardware and the needs of the game/app, this MIDI quirk can be handled robustly with a couple lines of script (check for :ref:`@GlobalScope.MIDI_MESSAGE_NOTE_ON` with velocity zero). + func _input(event): + if event is InputEventMIDI: + if event.message == MIDI_MESSAGE_NOTE_ON and event.velocity > 0: + print("Note 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.)` diff --git a/classes/class_inputeventmousemotion.rst b/classes/class_inputeventmousemotion.rst index 0db5337e9b5..f28b1636b2f 100644 --- a/classes/class_inputeventmousemotion.rst +++ b/classes/class_inputeventmousemotion.rst @@ -42,17 +42,21 @@ Properties .. table:: :widths: auto - +-------------------------------+------------------------------------------------------------------------+-------------------+ - | :ref:`bool` | :ref:`pen_inverted` | ``false`` | - +-------------------------------+------------------------------------------------------------------------+-------------------+ - | :ref:`float` | :ref:`pressure` | ``0.0`` | - +-------------------------------+------------------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`relative` | ``Vector2(0, 0)`` | - +-------------------------------+------------------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`tilt` | ``Vector2(0, 0)`` | - +-------------------------------+------------------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`velocity` | ``Vector2(0, 0)`` | - +-------------------------------+------------------------------------------------------------------------+-------------------+ + +-------------------------------+------------------------------------------------------------------------------+-------------------+ + | :ref:`bool` | :ref:`pen_inverted` | ``false`` | + +-------------------------------+------------------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`pressure` | ``0.0`` | + +-------------------------------+------------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`relative` | ``Vector2(0, 0)`` | + +-------------------------------+------------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`screen_relative` | ``Vector2(0, 0)`` | + +-------------------------------+------------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`screen_velocity` | ``Vector2(0, 0)`` | + +-------------------------------+------------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`tilt` | ``Vector2(0, 0)`` | + +-------------------------------+------------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`velocity` | ``Vector2(0, 0)`` | + +-------------------------------+------------------------------------------------------------------------------+-------------------+ .. rst-class:: classref-section-separator @@ -114,6 +118,44 @@ 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. +\ **Note:** :ref:`relative` is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means mouse sensitivity will appear different depending on resolution when using :ref:`relative` in a script that handles mouse aiming with the :ref:`Input.MOUSE_MODE_CAPTURED` mouse mode. To avoid this, use :ref:`screen_relative` instead. + +.. rst-class:: classref-item-separator + +---- + +.. _class_InputEventMouseMotion_property_screen_relative: + +.. rst-class:: classref-property + +:ref:`Vector2` **screen_relative** = ``Vector2(0, 0)`` + +.. rst-class:: classref-property-setget + +- void **set_screen_relative** **(** :ref:`Vector2` value **)** +- :ref:`Vector2` **get_screen_relative** **(** **)** + +The unscaled mouse position relative to the previous position in the coordinate system of the screen (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. This coordinate is *not* scaled according to the content scale factor or calls to :ref:`InputEvent.xformed_by`. This should be preferred over :ref:`relative` for mouse aiming when using the :ref:`Input.MOUSE_MODE_CAPTURED` mouse mode, regardless of the project's stretch mode. + +.. rst-class:: classref-item-separator + +---- + +.. _class_InputEventMouseMotion_property_screen_velocity: + +.. rst-class:: classref-property + +:ref:`Vector2` **screen_velocity** = ``Vector2(0, 0)`` + +.. rst-class:: classref-property-setget + +- void **set_screen_velocity** **(** :ref:`Vector2` value **)** +- :ref:`Vector2` **get_screen_velocity** **(** **)** + +The unscaled mouse velocity in pixels per second in screen coordinates. This velocity is *not* scaled according to the content scale factor or calls to :ref:`InputEvent.xformed_by`. This should be preferred over :ref:`velocity` for mouse aiming when using the :ref:`Input.MOUSE_MODE_CAPTURED` mouse mode, regardless of the project's stretch mode. + .. rst-class:: classref-item-separator ---- @@ -148,6 +190,8 @@ Represents the angles of tilt of the pen. Positive X-coordinate value indicates The mouse velocity in pixels per second. +\ **Note:** :ref:`velocity` is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means mouse sensitivity will appear different depending on resolution when using :ref:`velocity` in a script that handles mouse aiming with the :ref:`Input.MOUSE_MODE_CAPTURED` mouse mode. To avoid this, use :ref:`screen_velocity` 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_inputeventscreendrag.rst b/classes/class_inputeventscreendrag.rst index 9807d00bd21..83d62ca1131 100644 --- a/classes/class_inputeventscreendrag.rst +++ b/classes/class_inputeventscreendrag.rst @@ -36,21 +36,25 @@ Properties .. table:: :widths: auto - +-------------------------------+-----------------------------------------------------------------------+-------------------+ - | :ref:`int` | :ref:`index` | ``0`` | - +-------------------------------+-----------------------------------------------------------------------+-------------------+ - | :ref:`bool` | :ref:`pen_inverted` | ``false`` | - +-------------------------------+-----------------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`position` | ``Vector2(0, 0)`` | - +-------------------------------+-----------------------------------------------------------------------+-------------------+ - | :ref:`float` | :ref:`pressure` | ``0.0`` | - +-------------------------------+-----------------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`relative` | ``Vector2(0, 0)`` | - +-------------------------------+-----------------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`tilt` | ``Vector2(0, 0)`` | - +-------------------------------+-----------------------------------------------------------------------+-------------------+ - | :ref:`Vector2` | :ref:`velocity` | ``Vector2(0, 0)`` | - +-------------------------------+-----------------------------------------------------------------------+-------------------+ + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ + | :ref:`int` | :ref:`index` | ``0`` | + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ + | :ref:`bool` | :ref:`pen_inverted` | ``false`` | + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`position` | ``Vector2(0, 0)`` | + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ + | :ref:`float` | :ref:`pressure` | ``0.0`` | + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`relative` | ``Vector2(0, 0)`` | + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`screen_relative` | ``Vector2(0, 0)`` | + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`screen_velocity` | ``Vector2(0, 0)`` | + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`tilt` | ``Vector2(0, 0)`` | + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ + | :ref:`Vector2` | :ref:`velocity` | ``Vector2(0, 0)`` | + +-------------------------------+-----------------------------------------------------------------------------+-------------------+ .. rst-class:: classref-section-separator @@ -142,6 +146,42 @@ Represents the pressure the user puts on the pen. Ranges from ``0.0`` to ``1.0`` The drag position relative to the previous position (position at the last frame). +\ **Note:** :ref:`relative` is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means touch sensitivity will appear different depending on resolution when using :ref:`relative` in a script that handles touch aiming. To avoid this, use :ref:`screen_relative` instead. + +.. rst-class:: classref-item-separator + +---- + +.. _class_InputEventScreenDrag_property_screen_relative: + +.. rst-class:: classref-property + +:ref:`Vector2` **screen_relative** = ``Vector2(0, 0)`` + +.. rst-class:: classref-property-setget + +- void **set_screen_relative** **(** :ref:`Vector2` value **)** +- :ref:`Vector2` **get_screen_relative** **(** **)** + +The unscaled drag position relative to the previous position in screen coordinates (position at the last frame). This position is *not* scaled according to the content scale factor or calls to :ref:`InputEvent.xformed_by`. This should be preferred over :ref:`relative` for touch aiming regardless of the project's stretch mode. + +.. rst-class:: classref-item-separator + +---- + +.. _class_InputEventScreenDrag_property_screen_velocity: + +.. rst-class:: classref-property + +:ref:`Vector2` **screen_velocity** = ``Vector2(0, 0)`` + +.. rst-class:: classref-property-setget + +- void **set_screen_velocity** **(** :ref:`Vector2` value **)** +- :ref:`Vector2` **get_screen_velocity** **(** **)** + +The unscaled drag velocity in pixels per second in screen coordinates. This velocity is *not* scaled according to the content scale factor or calls to :ref:`InputEvent.xformed_by`. This should be preferred over :ref:`velocity` for touch aiming regardless of the project's stretch mode. + .. rst-class:: classref-item-separator ---- @@ -176,6 +216,8 @@ Represents the angles of tilt of the pen. Positive X-coordinate value indicates The drag velocity. +\ **Note:** :ref:`velocity` is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means touch sensitivity will appear different depending on resolution when using :ref:`velocity` in a script that handles touch aiming. To avoid this, use :ref:`screen_velocity` 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_jsonrpc.rst b/classes/class_jsonrpc.rst index fc22403e764..17d6a8256aa 100644 --- a/classes/class_jsonrpc.rst +++ b/classes/class_jsonrpc.rst @@ -66,6 +66,10 @@ enum **ErrorCode**: :ref:`ErrorCode` **PARSE_ERROR** = ``-32700`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_JSONRPC_constant_INVALID_REQUEST: @@ -74,6 +78,10 @@ enum **ErrorCode**: :ref:`ErrorCode` **INVALID_REQUEST** = ``-32600`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_JSONRPC_constant_METHOD_NOT_FOUND: @@ -90,6 +98,10 @@ A method call was requested but no function of that name existed in the JSONRPC :ref:`ErrorCode` **INVALID_PARAMS** = ``-32602`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_JSONRPC_constant_INTERNAL_ERROR: @@ -98,6 +110,10 @@ A method call was requested but no function of that name existed in the JSONRPC :ref:`ErrorCode` **INTERNAL_ERROR** = ``-32603`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator diff --git a/classes/class_label.rst b/classes/class_label.rst index a2fc0ea1187..c1fc10a8678 100644 --- a/classes/class_label.rst +++ b/classes/class_label.rst @@ -41,6 +41,8 @@ Properties +-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`clip_text` | ``false`` | +-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`ellipsis_char` | ``"…"`` | + +-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ | :ref:`HorizontalAlignment` | :ref:`horizontal_alignment` | ``0`` | +-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ | |bitfield|\<:ref:`JustificationFlag`\> | :ref:`justification_flags` | ``163`` | @@ -88,15 +90,17 @@ Methods .. table:: :widths: auto - +-----------------------+--------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_line_count` **(** **)** |const| | - +-----------------------+--------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_line_height` **(** :ref:`int` line=-1 **)** |const| | - +-----------------------+--------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_total_character_count` **(** **)** |const| | - +-----------------------+--------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_visible_line_count` **(** **)** |const| | - +-----------------------+--------------------------------------------------------------------------------------------------------------+ + +---------------------------+--------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2` | :ref:`get_character_bounds` **(** :ref:`int` pos **)** |const| | + +---------------------------+--------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_line_count` **(** **)** |const| | + +---------------------------+--------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_line_height` **(** :ref:`int` line=-1 **)** |const| | + +---------------------------+--------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_total_character_count` **(** **)** |const| | + +---------------------------+--------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_visible_line_count` **(** **)** |const| | + +---------------------------+--------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -173,6 +177,23 @@ If ``true``, the Label only shows the text that fits inside its bounding rectang ---- +.. _class_Label_property_ellipsis_char: + +.. rst-class:: classref-property + +:ref:`String` **ellipsis_char** = ``"…"`` + +.. rst-class:: classref-property-setget + +- void **set_ellipsis_char** **(** :ref:`String` value **)** +- :ref:`String` **get_ellipsis_char** **(** **)** + +Ellipsis character used for text clipping. + +.. rst-class:: classref-item-separator + +---- + .. _class_Label_property_horizontal_alignment: .. rst-class:: classref-property @@ -471,6 +492,18 @@ The fraction of characters to display, relative to the total number of character Method Descriptions ------------------- +.. _class_Label_method_get_character_bounds: + +.. rst-class:: classref-method + +:ref:`Rect2` **get_character_bounds** **(** :ref:`int` pos **)** |const| + +Returns the bounding rectangle of the character at position ``pos``. If the character is a non-visual character or ``pos`` is outside the valid range, an empty :ref:`Rect2` is returned. If the character is a part of a composite grapheme, the bounding rectangle of the whole grapheme is returned. + +.. rst-class:: classref-item-separator + +---- + .. _class_Label_method_get_line_count: .. rst-class:: classref-method @@ -586,6 +619,8 @@ Text outline size. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field` enabled, its :ref:`FontFile.msdf_pixel_range` must be set to at least *twice* the value of :ref:`outline_size` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. +\ **Note:** Using a value that is larger than half the font size is not recommended, as the font outline may fail to be fully closed in this case. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_lightmapgi.rst b/classes/class_lightmapgi.rst index 9b9bf0166ad..0ea0a52b799 100644 --- a/classes/class_lightmapgi.rst +++ b/classes/class_lightmapgi.rst @@ -29,7 +29,7 @@ The **LightmapGI** node is used to compute and store baked lightmaps. Lightmaps \ **Note:** Lightmap baking on :ref:`CSGShape3D`\ s and :ref:`PrimitiveMesh`\ es is not supported, as these cannot store UV2 data required for baking. -\ **Note:** If no custom lightmappers are installed, **LightmapGI** can only be baked when using the Vulkan backend (Forward+ or Mobile), not OpenGL. +\ **Note:** If no custom lightmappers are installed, **LightmapGI** can only be baked from devices that support the Forward+ or Mobile rendering backends. .. rst-class:: classref-introduction-group @@ -77,6 +77,8 @@ Properties +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ | :ref:`BakeQuality` | :ref:`quality` | ``1`` | +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ + | :ref:`float` | :ref:`texel_scale` | ``1.0`` | + +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ | :ref:`bool` | :ref:`use_denoiser` | ``true`` | +---------------------------------------------------------+---------------------------------------------------------------------------------------+------------+ | :ref:`bool` | :ref:`use_texture_for_bounces` | ``true`` | @@ -587,6 +589,23 @@ To further speed up bake times, decrease :ref:`bounces` **texel_scale** = ``1.0`` + +.. rst-class:: classref-property-setget + +- void **set_texel_scale** **(** :ref:`float` value **)** +- :ref:`float` **get_texel_scale** **(** **)** + +Scales the lightmap texel density of all meshes for the current bake. This is a multiplier that builds upon the existing lightmap texel size defined in each imported 3D scene, along with the per-mesh density multiplier (which is designed to be used when the same mesh is used at different scales). Lower values will result in faster bake times. + +.. rst-class:: classref-item-separator + +---- + .. _class_LightmapGI_property_use_denoiser: .. rst-class:: classref-property diff --git a/classes/class_mainloop.rst b/classes/class_mainloop.rst index 0033b0939a9..419f4721129 100644 --- a/classes/class_mainloop.rst +++ b/classes/class_mainloop.rst @@ -23,7 +23,7 @@ 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 **MainLoop** :ref:`Script` is provided from the command line (with e.g. ``godot -s my_loop.gd`` or the "Main Loop Type" project setting is overwritten. +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 **MainLoop** :ref:`Script` is provided from the command line (with e.g. ``godot -s my_loop.gd``) or the "Main Loop Type" project setting is overwritten. Here is an example script implementing a simple **MainLoop**: diff --git a/classes/class_missingnode.rst b/classes/class_missingnode.rst index f1a5d9a88e5..8e1b66ea93f 100644 --- a/classes/class_missingnode.rst +++ b/classes/class_missingnode.rst @@ -19,7 +19,9 @@ An internal editor class intended for keeping the data of unrecognized nodes. Description ----------- -This is an internal editor class intended for keeping data of nodes of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in the scene. Ignore it if you don't know what it is. +This is an internal editor class intended for keeping data of nodes of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in a scene. + +\ **Warning:** Ignore missing nodes unless you know what you are doing. Existing properties on a missing node can be freely modified in code, regardless of the type they are intended to be. .. rst-class:: classref-reftable-group @@ -55,7 +57,7 @@ Property Descriptions - void **set_original_class** **(** :ref:`String` value **)** - :ref:`String` **get_original_class** **(** **)** -Returns the name of the type this node was originally. +The name of the class this node was supposed to be (see :ref:`Object.get_class`). .. rst-class:: classref-item-separator @@ -72,9 +74,7 @@ Returns the name of the type this node was originally. - void **set_recording_properties** **(** :ref:`bool` value **)** - :ref:`bool` **is_recording_properties** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If set to ``true``, allows new properties to be added on top of the existing ones with :ref:`Object.set`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_missingresource.rst b/classes/class_missingresource.rst index 3e39850411a..72412d7e9bd 100644 --- a/classes/class_missingresource.rst +++ b/classes/class_missingresource.rst @@ -19,7 +19,9 @@ An internal editor class intended for keeping the data of unrecognized resources Description ----------- -This is an internal editor class intended for keeping data of resources of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in the scene. Ignore it if you don't know what it is. +This is an internal editor class intended for keeping data of resources of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in a scene. + +\ **Warning:** Ignore missing resources unless you know what you are doing. Existing properties on a missing resource can be freely modified in code, regardless of the type they are intended to be. .. rst-class:: classref-reftable-group @@ -55,7 +57,7 @@ Property Descriptions - void **set_original_class** **(** :ref:`String` value **)** - :ref:`String` **get_original_class** **(** **)** -Returns the name of the class this resource was originally. +The name of the class this resource was supposed to be (see :ref:`Object.get_class`). .. rst-class:: classref-item-separator @@ -72,9 +74,7 @@ Returns the name of the class this resource was originally. - void **set_recording_properties** **(** :ref:`bool` value **)** - :ref:`bool` **is_recording_properties** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If set to ``true``, allows new properties to be added on top of the existing ones with :ref:`Object.set`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_multiplayerpeer.rst b/classes/class_multiplayerpeer.rst index a526e66186f..0dd972b71bf 100644 --- a/classes/class_multiplayerpeer.rst +++ b/classes/class_multiplayerpeer.rst @@ -344,7 +344,7 @@ Returns the channel over which the next available packet was received. See :ref: :ref:`TransferMode` **get_packet_mode** **(** **)** |const| -Returns the :ref:`TransferMode` the remote peer used to send the next available packet. See :ref:`PacketPeer.get_available_packet_count`. +Returns the transfer mode the remote peer used to send the next available packet. See :ref:`PacketPeer.get_available_packet_count`. .. rst-class:: classref-item-separator diff --git a/classes/class_multiplayerpeerextension.rst b/classes/class_multiplayerpeerextension.rst index 2cbbcade068..281547621fd 100644 --- a/classes/class_multiplayerpeerextension.rst +++ b/classes/class_multiplayerpeerextension.rst @@ -176,7 +176,7 @@ Called to get the channel over which the next available packet was received. See :ref:`TransferMode` **_get_packet_mode** **(** **)** |virtual| |const| -Called to get the :ref:`TransferMode` the remote peer used to send the next available packet. See :ref:`MultiplayerPeer.get_packet_mode`. +Called to get the transfer mode the remote peer used to send the next available packet. See :ref:`MultiplayerPeer.get_packet_mode`. .. rst-class:: classref-item-separator diff --git a/classes/class_navigationagent2d.rst b/classes/class_navigationagent2d.rst index c9dbd0af47a..8a3e1024762 100644 --- a/classes/class_navigationagent2d.rst +++ b/classes/class_navigationagent2d.rst @@ -153,7 +153,7 @@ Signals **link_reached** **(** :ref:`Dictionary` details **)** -Notifies when a navigation link has been reached. +Signals that the agent reached a navigation link. Emitted when the agent moves within :ref:`path_desired_distance` of the next position of the path when that position is a navigation link. The details dictionary may contain the following keys depending on the value of :ref:`path_metadata_flags`: @@ -179,7 +179,9 @@ The details dictionary may contain the following keys depending on the value of **navigation_finished** **(** **)** -Emitted once per loaded path when the agent internal navigation path index reaches the last index of the loaded path array. The agent internal navigation path index can be received with :ref:`get_current_navigation_path_index`. +Signals that the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path. + +This signal will be emitted just after :ref:`target_reached` when the target is reachable. .. rst-class:: classref-item-separator @@ -209,7 +211,11 @@ Emitted when the agent had to update the loaded path: **target_reached** **(** **)** -Emitted once per loaded path when the agent's global position is the first time within :ref:`target_desired_distance` to the :ref:`target_position`. +Signals that the agent reached the target, i.e. the agent moved within :ref:`target_desired_distance` of the :ref:`target_position`. This signal is emitted only once per loaded path. + +This signal will be emitted just before :ref:`navigation_finished` when the target is reachable. + +It may not always be possible to reach the target but it should always be possible to reach the final position. See :ref:`get_final_position`. .. rst-class:: classref-item-separator @@ -233,7 +239,7 @@ Notifies when the collision avoidance velocity is calculated. Emitted when :ref: **waypoint_reached** **(** :ref:`Dictionary` details **)** -Notifies when a waypoint along the path has been reached. +Signals that the agent reached a waypoint. Emitted when the agent moves within :ref:`path_desired_distance` of the next position of the path. The details dictionary may contain the following keys depending on the value of :ref:`path_metadata_flags`: @@ -486,7 +492,7 @@ The distance to search for other agents. - void **set_path_desired_distance** **(** :ref:`float` value **)** - :ref:`float` **get_path_desired_distance** **(** **)** -The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the next point on each physics frame update. +The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to it leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot the distance to the next point on each physics frame update. .. rst-class:: classref-item-separator @@ -590,7 +596,11 @@ Does not affect normal pathfinding. To change an actor's pathfinding radius bake - void **set_target_desired_distance** **(** :ref:`float` value **)** - :ref:`float` **get_target_desired_distance** **(** **)** -The distance threshold before the final target point is considered to be reached. This allows agents to not have to hit the point of the final target exactly, but only to reach its general area. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the final target point on each physics frame update. +The distance threshold before the target is considered to be reached. On reaching the target, :ref:`target_reached` is emitted and navigation ends (see :ref:`is_navigation_finished` and :ref:`navigation_finished`). + +You can make navigation end early by setting this property to a value greater than :ref:`path_desired_distance` (navigation will end before reaching the last waypoint). + +You can also make navigation end closer to the target than each individual path position by setting this property to a value lower than :ref:`path_desired_distance` (navigation won't immediately end when reaching the last waypoint). However, if the value set is too low, the agent will be stuck in a repath loop because it will constantly overshoot the distance to the target on each physics frame update. .. rst-class:: classref-item-separator @@ -807,9 +817,9 @@ Returns the :ref:`RID` of this agent on the :ref:`NavigationServer2D< :ref:`bool` **is_navigation_finished** **(** **)** -Returns ``true`` if the end of the currently loaded navigation path has been reached. +Returns ``true`` if the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. -\ **Note:** While true prefer to stop calling update functions like :ref:`get_next_path_position`. This avoids jittering the standing agent due to calling repeated path updates. +\ **Note:** While ``true`` prefer to stop calling update functions like :ref:`get_next_path_position`. This avoids jittering the standing agent due to calling repeated path updates. .. rst-class:: classref-item-separator @@ -833,7 +843,7 @@ Returns ``true`` if :ref:`get_final_position` **is_target_reached** **(** **)** |const| -Returns true if :ref:`target_position` is reached. It may not always be possible to reach the target position. It should always be possible to reach the final position though. See :ref:`get_final_position`. +Returns ``true`` if the agent reached the target, i.e. the agent moved within :ref:`target_desired_distance` of the :ref:`target_position`. It may not always be possible to reach the target but it should always be possible to reach the final position. See :ref:`get_final_position`. .. rst-class:: classref-item-separator diff --git a/classes/class_navigationagent3d.rst b/classes/class_navigationagent3d.rst index abcba3bae7d..b15e59a97dc 100644 --- a/classes/class_navigationagent3d.rst +++ b/classes/class_navigationagent3d.rst @@ -159,7 +159,7 @@ Signals **link_reached** **(** :ref:`Dictionary` details **)** -Notifies when a navigation link has been reached. +Signals that the agent reached a navigation link. Emitted when the agent moves within :ref:`path_desired_distance` of the next position of the path when that position is a navigation link. The details dictionary may contain the following keys depending on the value of :ref:`path_metadata_flags`: @@ -185,7 +185,9 @@ The details dictionary may contain the following keys depending on the value of **navigation_finished** **(** **)** -Emitted once per loaded path when the agent internal navigation path index reaches the last index of the loaded path array. The agent internal navigation path index can be received with :ref:`get_current_navigation_path_index`. +Signals that the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path. + +This signal will be emitted just after :ref:`target_reached` when the target is reachable. .. rst-class:: classref-item-separator @@ -215,7 +217,11 @@ Emitted when the agent had to update the loaded path: **target_reached** **(** **)** -Emitted once per loaded path when the agent's global position is the first time within :ref:`target_desired_distance` to the :ref:`target_position`. +Signals that the agent reached the target, i.e. the agent moved within :ref:`target_desired_distance` of the :ref:`target_position`. This signal is emitted only once per loaded path. + +This signal will be emitted just before :ref:`navigation_finished` when the target is reachable. + +It may not always be possible to reach the target but it should always be possible to reach the final position. See :ref:`get_final_position`. .. rst-class:: classref-item-separator @@ -239,7 +245,7 @@ Notifies when the collision avoidance velocity is calculated. Emitted when :ref: **waypoint_reached** **(** :ref:`Dictionary` details **)** -Notifies when a waypoint along the path has been reached. +Signals that the agent reached a waypoint. Emitted when the agent moves within :ref:`path_desired_distance` of the next position of the path. The details dictionary may contain the following keys depending on the value of :ref:`path_metadata_flags`: @@ -509,7 +515,7 @@ The distance to search for other agents. - void **set_path_desired_distance** **(** :ref:`float` value **)** - :ref:`float` **get_path_desired_distance** **(** **)** -The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the next point on each physics frame update. +The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to it leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot the distance to the next point on each physics frame update. .. rst-class:: classref-item-separator @@ -630,7 +636,11 @@ Does not affect normal pathfinding. To change an actor's pathfinding radius bake - void **set_target_desired_distance** **(** :ref:`float` value **)** - :ref:`float` **get_target_desired_distance** **(** **)** -The distance threshold before the final target point is considered to be reached. This allows agents to not have to hit the point of the final target exactly, but only to reach its general area. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the final target point on each physics frame update. +The distance threshold before the target is considered to be reached. On reaching the target, :ref:`target_reached` is emitted and navigation ends (see :ref:`is_navigation_finished` and :ref:`navigation_finished`). + +You can make navigation end early by setting this property to a value greater than :ref:`path_desired_distance` (navigation will end before reaching the last waypoint). + +You can also make navigation end closer to the target than each individual path position by setting this property to a value lower than :ref:`path_desired_distance` (navigation won't immediately end when reaching the last waypoint). However, if the value set is too low, the agent will be stuck in a repath loop because it will constantly overshoot the distance to the target on each physics frame update. .. rst-class:: classref-item-separator @@ -866,9 +876,9 @@ Returns the :ref:`RID` of this agent on the :ref:`NavigationServer3D< :ref:`bool` **is_navigation_finished** **(** **)** -Returns ``true`` if the end of the currently loaded navigation path has been reached. +Returns ``true`` if the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. -\ **Note:** While true prefer to stop calling update functions like :ref:`get_next_path_position`. This avoids jittering the standing agent due to calling repeated path updates. +\ **Note:** While ``true`` prefer to stop calling update functions like :ref:`get_next_path_position`. This avoids jittering the standing agent due to calling repeated path updates. .. rst-class:: classref-item-separator @@ -892,7 +902,7 @@ Returns ``true`` if :ref:`get_final_position` **is_target_reached** **(** **)** |const| -Returns true if :ref:`target_position` is reached. It may not always be possible to reach the target position. It should always be possible to reach the final position though. See :ref:`get_final_position`. +Returns ``true`` if the agent reached the target, i.e. the agent moved within :ref:`target_desired_distance` of the :ref:`target_position`. It may not always be possible to reach the target but it should always be possible to reach the final position. See :ref:`get_final_position`. .. rst-class:: classref-item-separator diff --git a/classes/class_navigationlink2d.rst b/classes/class_navigationlink2d.rst index d7da9c51b34..b1c02aa3997 100644 --- a/classes/class_navigationlink2d.rst +++ b/classes/class_navigationlink2d.rst @@ -67,6 +67,8 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_navigation_layer_value` **(** :ref:`int` layer_number **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_rid` **(** **)** |const| | + +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_global_end_position` **(** :ref:`Vector2` position **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_global_start_position` **(** :ref:`Vector2` position **)** | @@ -251,6 +253,18 @@ Returns whether or not the specified layer of the :ref:`navigation_layers` **get_rid** **(** **)** |const| + +Returns the :ref:`RID` of this link on the :ref:`NavigationServer2D`. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationLink2D_method_set_global_end_position: .. rst-class:: classref-method diff --git a/classes/class_navigationlink3d.rst b/classes/class_navigationlink3d.rst index 9ed2fb436cd..6b9e96b0e5e 100644 --- a/classes/class_navigationlink3d.rst +++ b/classes/class_navigationlink3d.rst @@ -67,6 +67,8 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_navigation_layer_value` **(** :ref:`int` layer_number **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_rid` **(** **)** |const| | + +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_global_end_position` **(** :ref:`Vector3` position **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_global_start_position` **(** :ref:`Vector3` position **)** | @@ -251,6 +253,18 @@ Returns whether or not the specified layer of the :ref:`navigation_layers` **get_rid** **(** **)** |const| + +Returns the :ref:`RID` of this link on the :ref:`NavigationServer3D`. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationLink3D_method_set_global_end_position: .. rst-class:: classref-method diff --git a/classes/class_navigationmesh.rst b/classes/class_navigationmesh.rst index ba9bc496bce..485ee905f02 100644 --- a/classes/class_navigationmesh.rst +++ b/classes/class_navigationmesh.rst @@ -47,6 +47,8 @@ Properties +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`float` | :ref:`agent_radius` | ``0.5`` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`float` | :ref:`border_size` | ``0.0`` | + +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`float` | :ref:`cell_height` | ``0.25`` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`float` | :ref:`cell_size` | ``0.25`` | @@ -330,6 +332,27 @@ The distance to erode/shrink the walkable area of the heightfield away from obst ---- +.. _class_NavigationMesh_property_border_size: + +.. rst-class:: classref-property + +:ref:`float` **border_size** = ``0.0`` + +.. rst-class:: classref-property-setget + +- void **set_border_size** **(** :ref:`float` value **)** +- :ref:`float` **get_border_size** **(** **)** + +The size of the non-navigable border around the bake bounding area. + +In conjunction with the :ref:`filter_baking_aabb` and a :ref:`edge_max_error` value at ``1.0`` or below the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by :ref:`agent_radius`. + +\ **Note:** While baking and not zero, this value will be rounded up to the nearest multiple of :ref:`cell_size`. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationMesh_property_cell_height: .. rst-class:: classref-property diff --git a/classes/class_navigationpolygon.rst b/classes/class_navigationpolygon.rst index ccf7cce51b2..be1e25a0f27 100644 --- a/classes/class_navigationpolygon.rst +++ b/classes/class_navigationpolygon.rst @@ -89,6 +89,12 @@ Properties +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`float` | :ref:`agent_radius` | ``10.0`` | +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`Rect2` | :ref:`baking_rect` | ``Rect2(0, 0, 0, 0)`` | + +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`Vector2` | :ref:`baking_rect_offset` | ``Vector2(0, 0)`` | + +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`float` | :ref:`border_size` | ``0.0`` | + +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`float` | :ref:`cell_size` | ``1.0`` | +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`int` | :ref:`parsed_collision_mask` | ``4294967295`` | @@ -263,6 +269,59 @@ The distance to erode/shrink the walkable surface when baking the navigation mes ---- +.. _class_NavigationPolygon_property_baking_rect: + +.. rst-class:: classref-property + +:ref:`Rect2` **baking_rect** = ``Rect2(0, 0, 0, 0)`` + +.. rst-class:: classref-property-setget + +- void **set_baking_rect** **(** :ref:`Rect2` value **)** +- :ref:`Rect2` **get_baking_rect** **(** **)** + +If the baking :ref:`Rect2` has an area the navigation mesh baking will be restricted to its enclosing area. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationPolygon_property_baking_rect_offset: + +.. rst-class:: classref-property + +:ref:`Vector2` **baking_rect_offset** = ``Vector2(0, 0)`` + +.. rst-class:: classref-property-setget + +- void **set_baking_rect_offset** **(** :ref:`Vector2` value **)** +- :ref:`Vector2` **get_baking_rect_offset** **(** **)** + +The position offset applied to the :ref:`baking_rect` :ref:`Rect2`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationPolygon_property_border_size: + +.. rst-class:: classref-property + +:ref:`float` **border_size** = ``0.0`` + +.. rst-class:: classref-property-setget + +- void **set_border_size** **(** :ref:`float` value **)** +- :ref:`float` **get_border_size** **(** **)** + +The size of the non-navigable border around the bake bounding area defined by the :ref:`baking_rect` :ref:`Rect2`. + +In conjunction with the :ref:`baking_rect` the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by :ref:`agent_radius`. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationPolygon_property_cell_size: .. rst-class:: classref-property diff --git a/classes/class_navigationregion2d.rst b/classes/class_navigationregion2d.rst index 23624ff31ce..6efc4cd45b2 100644 --- a/classes/class_navigationregion2d.rst +++ b/classes/class_navigationregion2d.rst @@ -85,6 +85,10 @@ Methods +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_region_rid` **(** **)** |const| | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_rid` **(** **)** |const| | + +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_baking` **(** **)** |const| | + +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_avoidance_layer_value` **(** :ref:`int` layer_number, :ref:`bool` value **)** | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_navigation_layer_value` **(** :ref:`int` layer_number, :ref:`bool` value **)** | @@ -327,12 +331,38 @@ Returns the current navigation map :ref:`RID` used by this region. :ref:`RID` **get_region_rid** **(** **)** |const| +Returns the :ref:`RID` of this region on the :ref:`NavigationServer2D`. + +\ *Deprecated.* Use :ref:`get_rid` instead. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationRegion2D_method_get_rid: + +.. rst-class:: classref-method + +:ref:`RID` **get_rid** **(** **)** |const| + Returns the :ref:`RID` of this region on the :ref:`NavigationServer2D`. Combined with :ref:`NavigationServer2D.map_get_closest_point_owner` can be used to identify the **NavigationRegion2D** closest to a point on the merged navigation map. .. rst-class:: classref-item-separator ---- +.. _class_NavigationRegion2D_method_is_baking: + +.. rst-class:: classref-method + +:ref:`bool` **is_baking** **(** **)** |const| + +Returns ``true`` when the :ref:`NavigationPolygon` is being baked on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationRegion2D_method_set_avoidance_layer_value: .. rst-class:: classref-method diff --git a/classes/class_navigationregion3d.rst b/classes/class_navigationregion3d.rst index d600a0f937d..d8e7389527b 100644 --- a/classes/class_navigationregion3d.rst +++ b/classes/class_navigationregion3d.rst @@ -79,6 +79,10 @@ Methods +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_region_rid` **(** **)** |const| | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_rid` **(** **)** |const| | + +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_baking` **(** **)** |const| | + +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_navigation_layer_value` **(** :ref:`int` layer_number, :ref:`bool` value **)** | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_navigation_map` **(** :ref:`RID` navigation_map **)** | @@ -271,12 +275,38 @@ Returns the current navigation map :ref:`RID` used by this region. :ref:`RID` **get_region_rid** **(** **)** |const| +Returns the :ref:`RID` of this region on the :ref:`NavigationServer3D`. + +\ *Deprecated.* Use :ref:`get_rid` instead. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationRegion3D_method_get_rid: + +.. rst-class:: classref-method + +:ref:`RID` **get_rid** **(** **)** |const| + Returns the :ref:`RID` of this region on the :ref:`NavigationServer3D`. Combined with :ref:`NavigationServer3D.map_get_closest_point_owner` can be used to identify the **NavigationRegion3D** closest to a point on the merged navigation map. .. rst-class:: classref-item-separator ---- +.. _class_NavigationRegion3D_method_is_baking: + +.. rst-class:: classref-method + +:ref:`bool` **is_baking** **(** **)** |const| + +Returns ``true`` when the :ref:`NavigationMesh` is being baked on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationRegion3D_method_set_navigation_layer_value: .. rst-class:: classref-method diff --git a/classes/class_navigationserver2d.rst b/classes/class_navigationserver2d.rst index 19efc01bb7a..bdac6ca8546 100644 --- a/classes/class_navigationserver2d.rst +++ b/classes/class_navigationserver2d.rst @@ -57,10 +57,34 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_get_avoidance_enabled` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`agent_get_avoidance_layers` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`agent_get_avoidance_mask` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_avoidance_priority` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`agent_get_map` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`agent_get_max_neighbors` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_max_speed` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_neighbor_distance` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_get_paused` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`agent_get_position` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_radius` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_time_horizon_agents` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_time_horizon_obstacles` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`agent_get_velocity` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`agent_has_avoidance_callback` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_is_map_changed` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`agent_set_avoidance_callback` **(** :ref:`RID` agent, :ref:`Callable` callback **)** | @@ -105,6 +129,8 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID[]` | :ref:`get_maps` **(** **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_baking_navigation_polygon` **(** :ref:`NavigationPolygon` navigation_polygon **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`link_create` **(** **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`link_get_enabled` **(** :ref:`RID` link **)** |const| | @@ -165,6 +191,8 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedVector2Array` | :ref:`map_get_path` **(** :ref:`RID` map, :ref:`Vector2` origin, :ref:`Vector2` destination, :ref:`bool` optimize, :ref:`int` navigation_layers=1 **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`map_get_random_point` **(** :ref:`RID` map, :ref:`int` navigation_layers, :ref:`bool` uniformly **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID[]` | :ref:`map_get_regions` **(** :ref:`RID` map **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_get_use_edge_connections` **(** :ref:`RID` map **)** |const| | @@ -185,10 +213,20 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`obstacle_get_avoidance_enabled` **(** :ref:`RID` obstacle **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`obstacle_get_avoidance_layers` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`obstacle_get_map` **(** :ref:`RID` obstacle **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`obstacle_get_paused` **(** :ref:`RID` obstacle **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`obstacle_get_position` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`obstacle_get_radius` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`obstacle_get_velocity` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedVector2Array` | :ref:`obstacle_get_vertices` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`obstacle_set_avoidance_enabled` **(** :ref:`RID` obstacle, :ref:`bool` enabled **)** | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`obstacle_set_avoidance_layers` **(** :ref:`RID` obstacle, :ref:`int` layers **)** | @@ -227,6 +265,10 @@ Methods +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`region_get_owner_id` **(** :ref:`RID` region **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`region_get_random_point` **(** :ref:`RID` region, :ref:`int` navigation_layers, :ref:`bool` uniformly **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform2D` | :ref:`region_get_transform` **(** :ref:`RID` region **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`region_get_travel_cost` **(** :ref:`RID` region **)** |const| | +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`region_get_use_edge_connections` **(** :ref:`RID` region **)** |const| | @@ -316,6 +358,42 @@ Return ``true`` if the specified ``agent`` uses avoidance. ---- +.. _class_NavigationServer2D_method_agent_get_avoidance_layers: + +.. rst-class:: classref-method + +:ref:`int` **agent_get_avoidance_layers** **(** :ref:`RID` agent **)** |const| + +Returns the ``avoidance_layers`` bitmask of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_agent_get_avoidance_mask: + +.. rst-class:: classref-method + +:ref:`int` **agent_get_avoidance_mask** **(** :ref:`RID` agent **)** |const| + +Returns the ``avoidance_mask`` bitmask of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_agent_get_avoidance_priority: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_avoidance_priority** **(** :ref:`RID` agent **)** |const| + +Returns the ``avoidance_priority`` of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_agent_get_map: .. rst-class:: classref-method @@ -328,6 +406,42 @@ Returns the navigation map :ref:`RID` the requested ``agent`` is curr ---- +.. _class_NavigationServer2D_method_agent_get_max_neighbors: + +.. rst-class:: classref-method + +:ref:`int` **agent_get_max_neighbors** **(** :ref:`RID` agent **)** |const| + +Returns the maximum number of other agents the specified ``agent`` takes into account in the navigation. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_agent_get_max_speed: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_max_speed** **(** :ref:`RID` agent **)** |const| + +Returns the maximum speed of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_agent_get_neighbor_distance: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_neighbor_distance** **(** :ref:`RID` agent **)** |const| + +Returns the maximum distance to other agents the specified ``agent`` takes into account in the navigation. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_agent_get_paused: .. rst-class:: classref-method @@ -340,6 +454,78 @@ Returns ``true`` if the specified ``agent`` is paused. ---- +.. _class_NavigationServer2D_method_agent_get_position: + +.. rst-class:: classref-method + +:ref:`Vector2` **agent_get_position** **(** :ref:`RID` agent **)** |const| + +Returns the position of the specified ``agent`` in world space. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_agent_get_radius: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_radius** **(** :ref:`RID` agent **)** |const| + +Returns the radius of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_agent_get_time_horizon_agents: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_time_horizon_agents** **(** :ref:`RID` agent **)** |const| + +Returns the minimal amount of time for which the specified ``agent``'s velocities that are computed by the simulation are safe with respect to other agents. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_agent_get_time_horizon_obstacles: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_time_horizon_obstacles** **(** :ref:`RID` agent **)** |const| + +Returns the minimal amount of time for which the specified ``agent``'s velocities that are computed by the simulation are safe with respect to static avoidance obstacles. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_agent_get_velocity: + +.. rst-class:: classref-method + +:ref:`Vector2` **agent_get_velocity** **(** :ref:`RID` agent **)** |const| + +Returns the velocity of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_agent_has_avoidance_callback: + +.. rst-class:: classref-method + +:ref:`bool` **agent_has_avoidance_callback** **(** :ref:`RID` agent **)** |const| + +Return ``true`` if the specified ``agent`` has an avoidance callback. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_agent_is_map_changed: .. rst-class:: classref-method @@ -608,6 +794,18 @@ Returns all created navigation map :ref:`RID`\ s on the NavigationSer ---- +.. _class_NavigationServer2D_method_is_baking_navigation_polygon: + +.. rst-class:: classref-method + +:ref:`bool` **is_baking_navigation_polygon** **(** :ref:`NavigationPolygon` navigation_polygon **)** |const| + +Returns ``true`` when the provided navigation polygon is being baked on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_link_create: .. rst-class:: classref-method @@ -858,7 +1056,7 @@ This function immediately forces synchronization of the specified navigation ``m Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. -Avoidance processing and dispatch of the ``safe_velocity`` signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame. +Avoidance processing and dispatch of the ``safe_velocity`` signals is unaffected by this function and continues to happen for all maps and agents at the end of the physics frame. \ **Note:** With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight. @@ -974,6 +1172,22 @@ Returns the navigation path to reach the destination from the origin. ``navigati ---- +.. _class_NavigationServer2D_method_map_get_random_point: + +.. rst-class:: classref-method + +:ref:`Vector2` **map_get_random_point** **(** :ref:`RID` map, :ref:`int` navigation_layers, :ref:`bool` uniformly **)** |const| + +Returns a random position picked from all map region polygons with matching ``navigation_layers``. + +If ``uniformly`` is ``true``, all map regions, polygons, and faces are weighted by their surface area (slower). + +If ``uniformly`` is ``false``, just a random region and a random polygon are picked (faster). + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_map_get_regions: .. rst-class:: classref-method @@ -1094,6 +1308,18 @@ Returns ``true`` if the provided ``obstacle`` has avoidance enabled. ---- +.. _class_NavigationServer2D_method_obstacle_get_avoidance_layers: + +.. rst-class:: classref-method + +:ref:`int` **obstacle_get_avoidance_layers** **(** :ref:`RID` obstacle **)** |const| + +Returns the ``avoidance_layers`` bitmask of the specified ``obstacle``. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_obstacle_get_map: .. rst-class:: classref-method @@ -1118,6 +1344,54 @@ Returns ``true`` if the specified ``obstacle`` is paused. ---- +.. _class_NavigationServer2D_method_obstacle_get_position: + +.. rst-class:: classref-method + +:ref:`Vector2` **obstacle_get_position** **(** :ref:`RID` obstacle **)** |const| + +Returns the position of the specified ``obstacle`` in world space. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_obstacle_get_radius: + +.. rst-class:: classref-method + +:ref:`float` **obstacle_get_radius** **(** :ref:`RID` obstacle **)** |const| + +Returns the radius of the specified dynamic ``obstacle``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_obstacle_get_velocity: + +.. rst-class:: classref-method + +:ref:`Vector2` **obstacle_get_velocity** **(** :ref:`RID` obstacle **)** |const| + +Returns the velocity of the specified dynamic ``obstacle``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_obstacle_get_vertices: + +.. rst-class:: classref-method + +:ref:`PackedVector2Array` **obstacle_get_vertices** **(** :ref:`RID` obstacle **)** |const| + +Returns the outline vertices for the specified ``obstacle``. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_obstacle_set_avoidance_enabled: .. rst-class:: classref-method @@ -1350,6 +1624,34 @@ Returns the ``ObjectID`` of the object which manages this region. ---- +.. _class_NavigationServer2D_method_region_get_random_point: + +.. rst-class:: classref-method + +:ref:`Vector2` **region_get_random_point** **(** :ref:`RID` region, :ref:`int` navigation_layers, :ref:`bool` uniformly **)** |const| + +Returns a random position picked from all region polygons with matching ``navigation_layers``. + +If ``uniformly`` is ``true``, all region polygons and faces are weighted by their surface area (slower). + +If ``uniformly`` is ``false``, just a random polygon and face is picked (faster). + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer2D_method_region_get_transform: + +.. rst-class:: classref-method + +:ref:`Transform2D` **region_get_transform** **(** :ref:`RID` region **)** |const| + +Returns the global transformation of this ``region``. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_region_get_travel_cost: .. rst-class:: classref-method diff --git a/classes/class_navigationserver3d.rst b/classes/class_navigationserver3d.rst index 6f1338dff4f..1aecacde725 100644 --- a/classes/class_navigationserver3d.rst +++ b/classes/class_navigationserver3d.rst @@ -57,12 +57,38 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_get_avoidance_enabled` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`agent_get_avoidance_layers` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`agent_get_avoidance_mask` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_avoidance_priority` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_height` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`agent_get_map` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`agent_get_max_neighbors` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_max_speed` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_neighbor_distance` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_get_paused` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`agent_get_position` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_radius` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_time_horizon_agents` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`agent_get_time_horizon_obstacles` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_get_use_3d_avoidance` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`agent_get_velocity` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`agent_has_avoidance_callback` **(** :ref:`RID` agent **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`agent_is_map_changed` **(** :ref:`RID` agent **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`agent_set_avoidance_callback` **(** :ref:`RID` agent, :ref:`Callable` callback **)** | @@ -113,6 +139,8 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_process_info` **(** :ref:`ProcessInfo` process_info **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_baking_navigation_mesh` **(** :ref:`NavigationMesh` navigation_mesh **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`link_create` **(** **)** | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`link_get_enabled` **(** :ref:`RID` link **)** |const| | @@ -179,6 +207,8 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedVector3Array` | :ref:`map_get_path` **(** :ref:`RID` map, :ref:`Vector3` origin, :ref:`Vector3` destination, :ref:`bool` optimize, :ref:`int` navigation_layers=1 **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`map_get_random_point` **(** :ref:`RID` map, :ref:`int` navigation_layers, :ref:`bool` uniformly **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID[]` | :ref:`map_get_regions` **(** :ref:`RID` map **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`map_get_up` **(** :ref:`RID` map **)** |const| | @@ -205,12 +235,24 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`obstacle_get_avoidance_enabled` **(** :ref:`RID` obstacle **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`obstacle_get_avoidance_layers` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`obstacle_get_height` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`obstacle_get_map` **(** :ref:`RID` obstacle **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`obstacle_get_paused` **(** :ref:`RID` obstacle **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`obstacle_get_position` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`obstacle_get_radius` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`obstacle_get_use_3d_avoidance` **(** :ref:`RID` obstacle **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`obstacle_get_velocity` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedVector3Array` | :ref:`obstacle_get_vertices` **(** :ref:`RID` obstacle **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`obstacle_set_avoidance_enabled` **(** :ref:`RID` obstacle, :ref:`bool` enabled **)** | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`obstacle_set_avoidance_layers` **(** :ref:`RID` obstacle, :ref:`int` layers **)** | @@ -255,6 +297,10 @@ Methods +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`region_get_owner_id` **(** :ref:`RID` region **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`region_get_random_point` **(** :ref:`RID` region, :ref:`int` navigation_layers, :ref:`bool` uniformly **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform3D` | :ref:`region_get_transform` **(** :ref:`RID` region **)** |const| | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`region_get_travel_cost` **(** :ref:`RID` region **)** |const| | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`region_get_use_edge_connections` **(** :ref:`RID` region **)** |const| | @@ -445,6 +491,54 @@ Returns ``true`` if the provided ``agent`` has avoidance enabled. ---- +.. _class_NavigationServer3D_method_agent_get_avoidance_layers: + +.. rst-class:: classref-method + +:ref:`int` **agent_get_avoidance_layers** **(** :ref:`RID` agent **)** |const| + +Returns the ``avoidance_layers`` bitmask of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_agent_get_avoidance_mask: + +.. rst-class:: classref-method + +:ref:`int` **agent_get_avoidance_mask** **(** :ref:`RID` agent **)** |const| + +Returns the ``avoidance_mask`` bitmask of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_agent_get_avoidance_priority: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_avoidance_priority** **(** :ref:`RID` agent **)** |const| + +Returns the ``avoidance_priority`` of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_agent_get_height: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_height** **(** :ref:`RID` agent **)** |const| + +Returns the ``height`` of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_agent_get_map: .. rst-class:: classref-method @@ -457,6 +551,42 @@ Returns the navigation map :ref:`RID` the requested ``agent`` is curr ---- +.. _class_NavigationServer3D_method_agent_get_max_neighbors: + +.. rst-class:: classref-method + +:ref:`int` **agent_get_max_neighbors** **(** :ref:`RID` agent **)** |const| + +Returns the maximum number of other agents the specified ``agent`` takes into account in the navigation. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_agent_get_max_speed: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_max_speed** **(** :ref:`RID` agent **)** |const| + +Returns the maximum speed of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_agent_get_neighbor_distance: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_neighbor_distance** **(** :ref:`RID` agent **)** |const| + +Returns the maximum distance to other agents the specified ``agent`` takes into account in the navigation. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_agent_get_paused: .. rst-class:: classref-method @@ -469,6 +599,54 @@ Returns ``true`` if the specified ``agent`` is paused. ---- +.. _class_NavigationServer3D_method_agent_get_position: + +.. rst-class:: classref-method + +:ref:`Vector3` **agent_get_position** **(** :ref:`RID` agent **)** |const| + +Returns the position of the specified ``agent`` in world space. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_agent_get_radius: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_radius** **(** :ref:`RID` agent **)** |const| + +Returns the radius of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_agent_get_time_horizon_agents: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_time_horizon_agents** **(** :ref:`RID` agent **)** |const| + +Returns the minimal amount of time for which the specified ``agent``'s velocities that are computed by the simulation are safe with respect to other agents. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_agent_get_time_horizon_obstacles: + +.. rst-class:: classref-method + +:ref:`float` **agent_get_time_horizon_obstacles** **(** :ref:`RID` agent **)** |const| + +Returns the minimal amount of time for which the specified ``agent``'s velocities that are computed by the simulation are safe with respect to static avoidance obstacles. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_agent_get_use_3d_avoidance: .. rst-class:: classref-method @@ -481,6 +659,30 @@ Returns ``true`` if the provided ``agent`` uses avoidance in 3D space Vector3(x, ---- +.. _class_NavigationServer3D_method_agent_get_velocity: + +.. rst-class:: classref-method + +:ref:`Vector3` **agent_get_velocity** **(** :ref:`RID` agent **)** |const| + +Returns the velocity of the specified ``agent``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_agent_has_avoidance_callback: + +.. rst-class:: classref-method + +:ref:`bool` **agent_has_avoidance_callback** **(** :ref:`RID` agent **)** |const| + +Return ``true`` if the specified ``agent`` has an avoidance callback. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_agent_is_map_changed: .. rst-class:: classref-method @@ -685,7 +887,7 @@ void **agent_set_use_3d_avoidance** **(** :ref:`RID` agent, :ref:`boo Sets if the agent uses the 2D avoidance or the 3D avoidance while avoidance is enabled. -If ``true`` the agent calculates avoidance velocities in 3D for the xyz-axis, e.g. for games that take place in air, unterwater or space. The 3D using agent only avoids other 3D avoidance using agent's. The 3D using agent only reacts to radius based avoidance obstacles. The 3D using agent ignores any vertices based obstacles. The 3D using agent only avoids other 3D using agent's. +If ``true`` the agent calculates avoidance velocities in 3D for the xyz-axis, e.g. for games that take place in air, underwater or space. The 3D using agent only avoids other 3D avoidance using agent's. The 3D using agent only reacts to radius based avoidance obstacles. The 3D using agent ignores any vertices based obstacles. The 3D using agent only avoids other 3D using agent's. If ``false`` the agent calculates avoidance velocities in 2D along the xz-axis ignoring the y-axis. The 2D using agent only avoids other 2D avoidance using agent's. The 2D using agent reacts to radius avoidance obstacles. The 2D using agent reacts to vertices based avoidance obstacles. The 2D using agent only avoids other 2D using agent's. 2D using agents will ignore other 2D using agents or obstacles that are below their current position or above their current position including the agents height in 2D avoidance. @@ -789,6 +991,18 @@ Returns information about the current state of the NavigationServer. See :ref:`P ---- +.. _class_NavigationServer3D_method_is_baking_navigation_mesh: + +.. rst-class:: classref-method + +:ref:`bool` **is_baking_navigation_mesh** **(** :ref:`NavigationMesh` navigation_mesh **)** |const| + +Returns ``true`` when the provided navigation mesh is being baked on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_link_create: .. rst-class:: classref-method @@ -1039,7 +1253,7 @@ This function immediately forces synchronization of the specified navigation ``m Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. -Avoidance processing and dispatch of the ``safe_velocity`` signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame. +Avoidance processing and dispatch of the ``safe_velocity`` signals is unaffected by this function and continues to happen for all maps and agents at the end of the physics frame. \ **Note:** With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight. @@ -1191,6 +1405,22 @@ Returns the navigation path to reach the destination from the origin. ``navigati ---- +.. _class_NavigationServer3D_method_map_get_random_point: + +.. rst-class:: classref-method + +:ref:`Vector3` **map_get_random_point** **(** :ref:`RID` map, :ref:`int` navigation_layers, :ref:`bool` uniformly **)** |const| + +Returns a random position picked from all map region polygons with matching ``navigation_layers``. + +If ``uniformly`` is ``true``, all map regions, polygons, and faces are weighted by their surface area (slower). + +If ``uniformly`` is ``false``, just a random region and a random polygon are picked (faster). + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_map_get_regions: .. rst-class:: classref-method @@ -1347,6 +1577,30 @@ Returns ``true`` if the provided ``obstacle`` has avoidance enabled. ---- +.. _class_NavigationServer3D_method_obstacle_get_avoidance_layers: + +.. rst-class:: classref-method + +:ref:`int` **obstacle_get_avoidance_layers** **(** :ref:`RID` obstacle **)** |const| + +Returns the ``avoidance_layers`` bitmask of the specified ``obstacle``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_obstacle_get_height: + +.. rst-class:: classref-method + +:ref:`float` **obstacle_get_height** **(** :ref:`RID` obstacle **)** |const| + +Returns the ``height`` of the specified ``obstacle``. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_obstacle_get_map: .. rst-class:: classref-method @@ -1371,6 +1625,30 @@ Returns ``true`` if the specified ``obstacle`` is paused. ---- +.. _class_NavigationServer3D_method_obstacle_get_position: + +.. rst-class:: classref-method + +:ref:`Vector3` **obstacle_get_position** **(** :ref:`RID` obstacle **)** |const| + +Returns the position of the specified ``obstacle`` in world space. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_obstacle_get_radius: + +.. rst-class:: classref-method + +:ref:`float` **obstacle_get_radius** **(** :ref:`RID` obstacle **)** |const| + +Returns the radius of the specified dynamic ``obstacle``. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_obstacle_get_use_3d_avoidance: .. rst-class:: classref-method @@ -1383,6 +1661,30 @@ Returns ``true`` if the provided ``obstacle`` uses avoidance in 3D space Vector3 ---- +.. _class_NavigationServer3D_method_obstacle_get_velocity: + +.. rst-class:: classref-method + +:ref:`Vector3` **obstacle_get_velocity** **(** :ref:`RID` obstacle **)** |const| + +Returns the velocity of the specified dynamic ``obstacle``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_obstacle_get_vertices: + +.. rst-class:: classref-method + +:ref:`PackedVector3Array` **obstacle_get_vertices** **(** :ref:`RID` obstacle **)** |const| + +Returns the outline vertices for the specified ``obstacle``. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_obstacle_set_avoidance_enabled: .. rst-class:: classref-method @@ -1653,6 +1955,34 @@ Returns the ``ObjectID`` of the object which manages this region. ---- +.. _class_NavigationServer3D_method_region_get_random_point: + +.. rst-class:: classref-method + +:ref:`Vector3` **region_get_random_point** **(** :ref:`RID` region, :ref:`int` navigation_layers, :ref:`bool` uniformly **)** |const| + +Returns a random position picked from all region polygons with matching ``navigation_layers``. + +If ``uniformly`` is ``true``, all region polygons and faces are weighted by their surface area (slower). + +If ``uniformly`` is ``false``, just a random polygon and face is picked (faster). + +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationServer3D_method_region_get_transform: + +.. rst-class:: classref-method + +:ref:`Transform3D` **region_get_transform** **(** :ref:`RID` region **)** |const| + +Returns the global transformation of this ``region``. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_region_get_travel_cost: .. rst-class:: classref-method diff --git a/classes/class_node.rst b/classes/class_node.rst index e95fc85feca..15a8ea2014c 100644 --- a/classes/class_node.rst +++ b/classes/class_node.rst @@ -35,7 +35,7 @@ This means that when adding a node to the scene tree, the following order will b 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 instantiated what. This is mostly useful when writing editors and tools, though. +To keep track of the scene hierarchy (especially when instantiating scenes into other scenes), an "owner" can be set for the node with the :ref:`owner` property. This keeps track of who instantiated 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. @@ -43,7 +43,7 @@ Finally, when a node is freed with :ref:`Object.free` \ **Networking with nodes:** After connecting to a server (or making one, see :ref:`ENetMultiplayerPeer`), 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. -\ **Note:** The ``script`` property is part of the :ref:`Object` class, not **Node**. It isn't exposed like most properties but does have a setter and getter (``set_script()`` and ``get_script()``). +\ **Note:** The ``script`` property is part of the :ref:`Object` class, not **Node**. It isn't exposed like most properties but does have a setter and getter (see :ref:`Object.set_script` and :ref:`Object.get_script`). .. rst-class:: classref-introduction-group @@ -96,191 +96,191 @@ Methods .. table:: :widths: auto - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_enter_tree` **(** **)** |virtual| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_exit_tree` **(** **)** |virtual| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`_get_configuration_warnings` **(** **)** |virtual| |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | 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:`_shortcut_input` **(** :ref:`InputEvent` event **)** |virtual| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_unhandled_input` **(** :ref:`InputEvent` event **)** |virtual| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_unhandled_key_input` **(** :ref:`InputEvent` event **)** |virtual| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`add_child` **(** :ref:`Node` node, :ref:`bool` force_readable_name=false, :ref:`InternalMode` internal=0 **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`add_sibling` **(** :ref:`Node` sibling, :ref:`bool` force_readable_name=false **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`add_to_group` **(** :ref:`StringName` group, :ref:`bool` persistent=false **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant` | :ref:`call_deferred_thread_group` **(** :ref:`StringName` method, ... **)** |vararg| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant` | :ref:`call_thread_safe` **(** :ref:`StringName` method, ... **)** |vararg| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`can_process` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Tween` | :ref:`create_tween` **(** **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Node` | :ref:`duplicate` **(** :ref:`int` flags=15 **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Node` | :ref:`find_child` **(** :ref:`String` pattern, :ref:`bool` recursive=true, :ref:`bool` owned=true **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Node[]` | :ref:`find_children` **(** :ref:`String` pattern, :ref:`String` type="", :ref:`bool` recursive=true, :ref:`bool` owned=true **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Node` | :ref:`find_parent` **(** :ref:`String` pattern **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Node` | :ref:`get_child` **(** :ref:`int` idx, :ref:`bool` include_internal=false **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_child_count` **(** :ref:`bool` include_internal=false **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Node[]` | :ref:`get_children` **(** :ref:`bool` include_internal=false **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`StringName[]` | :ref:`get_groups` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_index` **(** :ref:`bool` include_internal=false **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Window` | :ref:`get_last_exclusive_window` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_multiplayer_authority` **(** **)** |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, :ref:`bool` use_unique_path=false **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_physics_process_delta_time` **(** **)** |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:`String` | :ref:`get_tree_string` **(** **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_tree_string_pretty` **(** **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Viewport` | :ref:`get_viewport` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Window` | :ref:`get_window` **(** **)** |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_ancestor_of` **(** :ref:`Node` node **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_displayed_folded` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_editable_instance` **(** :ref:`Node` node **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_greater_than` **(** :ref:`Node` node **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_in_group` **(** :ref:`StringName` group **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_inside_tree` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_multiplayer_authority` **(** **)** |const| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_node_ready` **(** **)** |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_shortcut_input` **(** **)** |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_index **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`notify_deferred_thread_group` **(** :ref:`int` what **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`notify_thread_safe` **(** :ref:`int` what **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`print_orphan_nodes` **(** **)** |static| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`print_tree` **(** **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`print_tree_pretty` **(** **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`propagate_call` **(** :ref:`StringName` method, :ref:`Array` args=[], :ref:`bool` parent_first=false **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`propagate_notification` **(** :ref:`int` what **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`queue_free` **(** **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`remove_child` **(** :ref:`Node` node **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`remove_from_group` **(** :ref:`StringName` group **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`reparent` **(** :ref:`Node` new_parent, :ref:`bool` keep_global_transform=true **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`replace_by` **(** :ref:`Node` node, :ref:`bool` keep_groups=false **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`request_ready` **(** **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`rpc` **(** :ref:`StringName` method, ... **)** |vararg| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`rpc_config` **(** :ref:`StringName` method, :ref:`Variant` config **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`rpc_id` **(** :ref:`int` peer_id, :ref:`StringName` method, ... **)** |vararg| | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_deferred_thread_group` **(** :ref:`StringName` property, :ref:`Variant` value **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_display_folded` **(** :ref:`bool` fold **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_editable_instance` **(** :ref:`Node` node, :ref:`bool` is_editable **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_multiplayer_authority` **(** :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_shortcut_input` **(** :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:`set_thread_safe` **(** :ref:`StringName` property, :ref:`Variant` value **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`update_configuration_warnings` **(** **)** | - +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_enter_tree` **(** **)** |virtual| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_exit_tree` **(** **)** |virtual| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Array` | :ref:`_get_configuration_warnings` **(** **)** |virtual| |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | 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:`_shortcut_input` **(** :ref:`InputEvent` event **)** |virtual| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_unhandled_input` **(** :ref:`InputEvent` event **)** |virtual| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_unhandled_key_input` **(** :ref:`InputEvent` event **)** |virtual| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_child` **(** :ref:`Node` node, :ref:`bool` force_readable_name=false, :ref:`InternalMode` internal=0 **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_sibling` **(** :ref:`Node` sibling, :ref:`bool` force_readable_name=false **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_to_group` **(** :ref:`StringName` group, :ref:`bool` persistent=false **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`call_deferred_thread_group` **(** :ref:`StringName` method, ... **)** |vararg| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`call_thread_safe` **(** :ref:`StringName` method, ... **)** |vararg| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`can_process` **(** **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Tween` | :ref:`create_tween` **(** **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Node` | :ref:`duplicate` **(** :ref:`int` flags=15 **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Node` | :ref:`find_child` **(** :ref:`String` pattern, :ref:`bool` recursive=true, :ref:`bool` owned=true **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Node[]` | :ref:`find_children` **(** :ref:`String` pattern, :ref:`String` type="", :ref:`bool` recursive=true, :ref:`bool` owned=true **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Node` | :ref:`find_parent` **(** :ref:`String` pattern **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Node` | :ref:`get_child` **(** :ref:`int` idx, :ref:`bool` include_internal=false **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_child_count` **(** :ref:`bool` include_internal=false **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Node[]` | :ref:`get_children` **(** :ref:`bool` include_internal=false **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName[]` | :ref:`get_groups` **(** **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_index` **(** :ref:`bool` include_internal=false **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Window` | :ref:`get_last_exclusive_window` **(** **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_multiplayer_authority` **(** **)** |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, :ref:`bool` use_unique_path=false **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_physics_process_delta_time` **(** **)** |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:`String` | :ref:`get_tree_string` **(** **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_tree_string_pretty` **(** **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Viewport` | :ref:`get_viewport` **(** **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Window` | :ref:`get_window` **(** **)** |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_ancestor_of` **(** :ref:`Node` node **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_displayed_folded` **(** **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_editable_instance` **(** :ref:`Node` node **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_greater_than` **(** :ref:`Node` node **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_in_group` **(** :ref:`StringName` group **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_inside_tree` **(** **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_multiplayer_authority` **(** **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_node_ready` **(** **)** |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_shortcut_input` **(** **)** |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_index **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`notify_deferred_thread_group` **(** :ref:`int` what **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`notify_thread_safe` **(** :ref:`int` what **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`print_orphan_nodes` **(** **)** |static| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`print_tree` **(** **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`print_tree_pretty` **(** **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`propagate_call` **(** :ref:`StringName` method, :ref:`Array` args=[], :ref:`bool` parent_first=false **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`propagate_notification` **(** :ref:`int` what **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`queue_free` **(** **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_child` **(** :ref:`Node` node **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_from_group` **(** :ref:`StringName` group **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`reparent` **(** :ref:`Node` new_parent, :ref:`bool` keep_global_transform=true **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`replace_by` **(** :ref:`Node` node, :ref:`bool` keep_groups=false **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`request_ready` **(** **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`rpc` **(** :ref:`StringName` method, ... **)** |vararg| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`rpc_config` **(** :ref:`StringName` method, :ref:`Variant` config **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`rpc_id` **(** :ref:`int` peer_id, :ref:`StringName` method, ... **)** |vararg| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_deferred_thread_group` **(** :ref:`StringName` property, :ref:`Variant` value **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_display_folded` **(** :ref:`bool` fold **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_editable_instance` **(** :ref:`Node` node, :ref:`bool` is_editable **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_multiplayer_authority` **(** :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_shortcut_input` **(** :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:`set_thread_safe` **(** :ref:`StringName` property, :ref:`Variant` value **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`update_configuration_warnings` **(** **)** | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -297,7 +297,7 @@ Signals **child_entered_tree** **(** :ref:`Node` node **)** -Emitted when a child node enters the scene tree, either because it entered on its own or because this node entered with it. +Emitted when the child ``node`` enters the :ref:`SceneTree`, usually because this node entered the tree (see :ref:`tree_entered`), or :ref:`add_child` has been called. This signal is emitted *after* the child node's own :ref:`NOTIFICATION_ENTER_TREE` and :ref:`tree_entered`. @@ -311,9 +311,9 @@ This signal is emitted *after* the child node's own :ref:`NOTIFICATION_ENTER_TRE **child_exiting_tree** **(** :ref:`Node` node **)** -Emitted when a child node is about to exit the scene tree, either because it is being removed or freed directly, or because this node is exiting the tree. +Emitted when the child ``node`` is about to exit the :ref:`SceneTree`, usually because this node is exiting the tree (see :ref:`tree_exiting`), or because the child ``node`` is being removed or freed. -When this signal is received, the child ``node`` is still in the tree and valid. This signal is emitted *after* the child node's own :ref:`tree_exiting` and :ref:`NOTIFICATION_EXIT_TREE`. +When this signal is received, the child ``node`` is still accessible inside the tree. This signal is emitted *after* the child node's own :ref:`tree_exiting` and :ref:`NOTIFICATION_EXIT_TREE`. .. rst-class:: classref-item-separator @@ -331,13 +331,25 @@ Emitted when the list of children is changed. This happens when child nodes are ---- +.. _class_Node_signal_editor_description_changed: + +.. rst-class:: classref-signal + +**editor_description_changed** **(** :ref:`Node` node **)** + +Emitted when the node's editor description field changed. + +.. rst-class:: classref-item-separator + +---- + .. _class_Node_signal_ready: .. rst-class:: classref-signal **ready** **(** **)** -Emitted when the node is ready. Comes after :ref:`_ready` callback and follows the same rules. +Emitted when the node is considered ready, after :ref:`_ready` is called. .. rst-class:: classref-item-separator @@ -349,7 +361,7 @@ Emitted when the node is ready. Comes after :ref:`_ready` is changed, if the node is inside the tree. .. rst-class:: classref-item-separator @@ -391,6 +403,8 @@ This signal is emitted *after* the related :ref:`NOTIFICATION_ENTER_TREE` notification. + .. rst-class:: classref-item-separator ---- @@ -401,9 +415,9 @@ Emitted after the node exits the tree and is no longer active. **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). +Emitted when the node is just about to exit the tree. The node is still valid. As such, this is the right place for de-initialization (or a "destructor", if you will). -This signal is emitted *before* the related :ref:`NOTIFICATION_EXIT_TREE` notification. +This signal is emitted *after* the node's :ref:`_exit_tree`, and *before* the related :ref:`NOTIFICATION_EXIT_TREE`. .. rst-class:: classref-section-separator @@ -426,7 +440,7 @@ enum **ProcessMode**: :ref:`ProcessMode` **PROCESS_MODE_INHERIT** = ``0`` -Inherits process mode from the node's parent. For the root node, it is equivalent to :ref:`PROCESS_MODE_PAUSABLE`. Default. +Inherits :ref:`process_mode` from the node's parent. For the root node, it is equivalent to :ref:`PROCESS_MODE_PAUSABLE`. This is the default for any newly created node. .. _class_Node_constant_PROCESS_MODE_PAUSABLE: @@ -434,7 +448,7 @@ Inherits process mode from the node's parent. For the root node, it is equivalen :ref:`ProcessMode` **PROCESS_MODE_PAUSABLE** = ``1`` -Stops processing when the :ref:`SceneTree` is paused (process when unpaused). This is the inverse of :ref:`PROCESS_MODE_WHEN_PAUSED`. +Stops processing when :ref:`SceneTree.paused` is ``true``. This is the inverse of :ref:`PROCESS_MODE_WHEN_PAUSED`. .. _class_Node_constant_PROCESS_MODE_WHEN_PAUSED: @@ -442,7 +456,7 @@ Stops processing when the :ref:`SceneTree` is paused (process w :ref:`ProcessMode` **PROCESS_MODE_WHEN_PAUSED** = ``2`` -Only process when the :ref:`SceneTree` is paused (don't process when unpaused). This is the inverse of :ref:`PROCESS_MODE_PAUSABLE`. +Process **only** when :ref:`SceneTree.paused` is ``true``. This is the inverse of :ref:`PROCESS_MODE_PAUSABLE`. .. _class_Node_constant_PROCESS_MODE_ALWAYS: @@ -450,7 +464,7 @@ Only process when the :ref:`SceneTree` is paused (don't process :ref:`ProcessMode` **PROCESS_MODE_ALWAYS** = ``3`` -Always process. Continue processing always, ignoring the :ref:`SceneTree`'s paused property. This is the inverse of :ref:`PROCESS_MODE_DISABLED`. +Always process. Keeps processing, ignoring :ref:`SceneTree.paused`. This is the inverse of :ref:`PROCESS_MODE_DISABLED`. .. _class_Node_constant_PROCESS_MODE_DISABLED: @@ -458,7 +472,7 @@ Always process. Continue processing always, ignoring the :ref:`SceneTree` **PROCESS_MODE_DISABLED** = ``4`` -Never process. Completely disables processing, ignoring the :ref:`SceneTree`'s paused property. This is the inverse of :ref:`PROCESS_MODE_ALWAYS`. +Never process. Completely disables processing, ignoring :ref:`SceneTree.paused`. This is the inverse of :ref:`PROCESS_MODE_ALWAYS`. .. rst-class:: classref-item-separator @@ -510,6 +524,10 @@ flags **ProcessThreadMessages**: :ref:`ProcessThreadMessages` **FLAG_PROCESS_THREAD_MESSAGES** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES_PHYSICS: @@ -518,6 +536,10 @@ flags **ProcessThreadMessages**: :ref:`ProcessThreadMessages` **FLAG_PROCESS_THREAD_MESSAGES_PHYSICS** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Node_constant_FLAG_PROCESS_THREAD_MESSAGES_ALL: @@ -526,6 +548,10 @@ flags **ProcessThreadMessages**: :ref:`ProcessThreadMessages` **FLAG_PROCESS_THREAD_MESSAGES_ALL** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -544,7 +570,7 @@ enum **DuplicateFlags**: :ref:`DuplicateFlags` **DUPLICATE_SIGNALS** = ``1`` -Duplicate the node's signals. +Duplicate the node's signal connections. .. _class_Node_constant_DUPLICATE_GROUPS: @@ -560,7 +586,7 @@ Duplicate the node's groups. :ref:`DuplicateFlags` **DUPLICATE_SCRIPTS** = ``4`` -Duplicate the node's scripts. +Duplicate the node's script (including the ancestor's script, if combined with :ref:`DUPLICATE_USE_INSTANTIATION`). .. _class_Node_constant_DUPLICATE_USE_INSTANTIATION: @@ -568,9 +594,7 @@ Duplicate the node's scripts. :ref:`DuplicateFlags` **DUPLICATE_USE_INSTANTIATION** = ``8`` -Duplicate using instancing. - -An instance stays linked to the original so when the original changes, the instance changes too. +Duplicate using :ref:`PackedScene.instantiate`. If the node comes from a scene saved on disk, re-uses :ref:`PackedScene.instantiate` as the base for the duplicated node and its children. .. rst-class:: classref-item-separator @@ -588,7 +612,7 @@ enum **InternalMode**: :ref:`InternalMode` **INTERNAL_MODE_DISABLED** = ``0`` -Node will not be internal. +The node will not be internal. .. _class_Node_constant_INTERNAL_MODE_FRONT: @@ -596,7 +620,7 @@ Node will not be internal. :ref:`InternalMode` **INTERNAL_MODE_FRONT** = ``1`` -Node will be placed at the front of parent's node list, before any non-internal sibling. +The node will be placed at the beginning of the parent's children list, before any non-internal sibling. .. _class_Node_constant_INTERNAL_MODE_BACK: @@ -604,7 +628,7 @@ Node will be placed at the front of parent's node list, before any non-internal :ref:`InternalMode` **INTERNAL_MODE_BACK** = ``2`` -Node will be placed at the back of parent's node list, after any non-internal sibling. +The node will be placed at the end of the parent's children list, after any non-internal sibling. .. rst-class:: classref-section-separator @@ -621,9 +645,9 @@ Constants **NOTIFICATION_ENTER_TREE** = ``10`` -Notification received when the node enters a :ref:`SceneTree`. +Notification received when the node enters a :ref:`SceneTree`. See :ref:`_enter_tree`. -This notification is emitted *before* the related :ref:`tree_entered`. +This notification is received *before* the related :ref:`tree_entered` signal. .. _class_Node_constant_NOTIFICATION_EXIT_TREE: @@ -631,9 +655,9 @@ This notification is emitted *before* the related :ref:`tree_entered`. +Notification received when the node is about to exit a :ref:`SceneTree`. See :ref:`_exit_tree`. -This notification is emitted *after* the related :ref:`tree_exiting`. +This notification is received *after* the related :ref:`tree_exiting` signal. .. _class_Node_constant_NOTIFICATION_MOVED_IN_PARENT: @@ -657,7 +681,7 @@ Notification received when the node is ready. See :ref:`_ready`. .. _class_Node_constant_NOTIFICATION_UNPAUSED: @@ -665,7 +689,7 @@ Notification received when the node is paused. **NOTIFICATION_UNPAUSED** = ``15`` -Notification received when the node is unpaused. +Notification received when the node is unpaused. See :ref:`process_mode`. .. _class_Node_constant_NOTIFICATION_PHYSICS_PROCESS: @@ -673,7 +697,7 @@ 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 received from the tree every physics frame when :ref:`is_physics_processing` returns ``true``. See :ref:`_physics_process`. .. _class_Node_constant_NOTIFICATION_PROCESS: @@ -681,7 +705,7 @@ Notification received every frame when the physics process flag is set (see :ref **NOTIFICATION_PROCESS** = ``17`` -Notification received every frame when the process flag is set (see :ref:`set_process`). +Notification received from the tree every rendered frame when :ref:`is_processing` returns ``true``. See :ref:`_process`. .. _class_Node_constant_NOTIFICATION_PARENTED: @@ -689,9 +713,9 @@ Notification received every frame when the process flag is set (see :ref:`set_pr **NOTIFICATION_PARENTED** = ``18`` -Notification received when a node is set as a child of another node. +Notification received when the node is set as a child of another node (see :ref:`add_child` and :ref:`add_sibling`). -\ **Note:** This doesn't mean that a node entered the :ref:`SceneTree`. +\ **Note:** This does *not* mean that the node entered the :ref:`SceneTree`. .. _class_Node_constant_NOTIFICATION_UNPARENTED: @@ -699,7 +723,9 @@ Notification received when a node is set as a child of another node. **NOTIFICATION_UNPARENTED** = ``19`` -Notification received when a node is unparented (parent removed it from the list of children). +Notification received when the parent node calls :ref:`remove_child` on this node. + +\ **Note:** This does *not* mean that the node exited the :ref:`SceneTree`. .. _class_Node_constant_NOTIFICATION_SCENE_INSTANTIATED: @@ -707,7 +733,7 @@ Notification received when a node is unparented (parent removed it from the list **NOTIFICATION_SCENE_INSTANTIATED** = ``20`` -Notification received by scene owner when its scene is instantiated. +Notification received *only* by the newly instantiated scene root node, when :ref:`PackedScene.instantiate` is completed. .. _class_Node_constant_NOTIFICATION_DRAG_BEGIN: @@ -737,7 +763,7 @@ Use :ref:`Viewport.gui_is_drag_successful` or one of its ancestors' :ref:`name` is changed. This notification is *not* received when the node is removed from the :ref:`SceneTree`. .. _class_Node_constant_NOTIFICATION_CHILD_ORDER_CHANGED: @@ -753,7 +779,7 @@ Notification received when the list of children is changed. This happens when ch **NOTIFICATION_INTERNAL_PROCESS** = ``25`` -Notification received every frame when the internal process flag is set (see :ref:`set_process_internal`). +Notification received from the tree every rendered frame when :ref:`is_processing_internal` returns ``true``. .. _class_Node_constant_NOTIFICATION_INTERNAL_PHYSICS_PROCESS: @@ -761,7 +787,7 @@ Notification received every frame when the internal process flag is set (see :re **NOTIFICATION_INTERNAL_PHYSICS_PROCESS** = ``26`` -Notification received every frame when the internal physics process flag is set (see :ref:`set_physics_process_internal`). +Notification received from the tree every physics frame when :ref:`is_physics_processing_internal` returns ``true``. .. _class_Node_constant_NOTIFICATION_POST_ENTER_TREE: @@ -769,7 +795,7 @@ Notification received every frame when the internal physics process flag is set **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 the tree, instead of only once. +Notification received when the node enters the tree, just before :ref:`NOTIFICATION_READY` may be received. Unlike the latter, it is sent every time the node enters tree, not just once. .. _class_Node_constant_NOTIFICATION_DISABLED: @@ -829,7 +855,7 @@ Implemented for embedded windows and on desktop and web platforms. **NOTIFICATION_WM_WINDOW_FOCUS_IN** = ``1004`` -Notification received when the node's parent :ref:`Window` is focused. This may be a change of focus between two windows of the same engine instance, or from the OS desktop or a third-party application to a window of the game (in which case :ref:`NOTIFICATION_APPLICATION_FOCUS_IN` is also emitted). +Notification received from the OS when the node's :ref:`Window` ancestor is focused. This may be a change of focus between two windows of the same engine instance, or from the OS desktop or a third-party application to a window of the game (in which case :ref:`NOTIFICATION_APPLICATION_FOCUS_IN` is also received). A :ref:`Window` node receives this notification when it is focused. @@ -839,7 +865,7 @@ A :ref:`Window` node receives this notification when it is focused **NOTIFICATION_WM_WINDOW_FOCUS_OUT** = ``1005`` -Notification received when the node's parent :ref:`Window` is defocused. This may be a change of focus between two windows of the same engine instance, or from a window of the game to the OS desktop or a third-party application (in which case :ref:`NOTIFICATION_APPLICATION_FOCUS_OUT` is also emitted). +Notification received from the OS when the node's :ref:`Window` ancestor is defocused. This may be a change of focus between two windows of the same engine instance, or from a window of the game to the OS desktop or a third-party application (in which case :ref:`NOTIFICATION_APPLICATION_FOCUS_OUT` is also received). A :ref:`Window` node receives this notification when it is defocused. @@ -861,7 +887,7 @@ Implemented on desktop platforms. 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. +Implemented only on iOS. .. _class_Node_constant_NOTIFICATION_WM_SIZE_CHANGED: @@ -869,7 +895,9 @@ Specific to the Android platform. **NOTIFICATION_WM_SIZE_CHANGED** = ``1008`` -Notification received from the OS when the window is resized. +Notification received when the window is resized. + +\ **Note:** Only the resized :ref:`Window` node receives this notification, and it's not propagated to the child nodes. .. _class_Node_constant_NOTIFICATION_WM_DPI_CHANGE: @@ -877,7 +905,7 @@ Notification received from the OS when the window is resized. **NOTIFICATION_WM_DPI_CHANGE** = ``1009`` -Notification received from the OS when the screen's DPI has been changed. Only implemented on macOS. +Notification received from the OS when the screen's dots per inch (DPI) scale is changed. Only implemented on macOS. .. _class_Node_constant_NOTIFICATION_VP_MOUSE_ENTER: @@ -903,7 +931,7 @@ Notification received when the mouse cursor leaves the :ref:`Viewport` is changed. .. rst-class:: classref-section-separator @@ -1011,7 +1039,7 @@ Property Descriptions - void **set_editor_description** **(** :ref:`String` value **)** - :ref:`String` **get_editor_description** **(** **)** -Add a custom description to a node. It will be displayed in a tooltip when hovered in editor's scene tree. +An optional description to the node. It will be displayed as a tooltip when hovering over the node in the editor's Scene dock. .. rst-class:: classref-item-separator @@ -1046,9 +1074,9 @@ The :ref:`MultiplayerAPI` instance associated with this no - void **set_name** **(** :ref:`StringName` value **)** - :ref:`StringName` **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. +The name of the node. This name must be unique among the siblings (other child nodes from the same parent). When set to an existing sibling's name, the node is 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. +\ **Note:** When changing the name, the following characters will be removed: (``.`` ``:`` ``@`` ``/`` ``"`` ``%``). In particular, the ``@`` character is reserved for auto-generated names. See also :ref:`String.validate_node_name`. .. rst-class:: classref-item-separator @@ -1065,9 +1093,9 @@ The name of the node. This name is unique among the siblings (other child nodes - void **set_owner** **(** :ref:`Node` value **)** - :ref:`Node` **get_owner** **(** **)** -The node owner. A node can have any ancestor node as owner (i.e. a parent, grandparent, etc. node ascending in the tree). This implies that :ref:`add_child` should be called before setting the owner, so that this relationship of parenting exists. When saving a node (using :ref:`PackedScene`), all the nodes it owns will be saved with it. This allows for the creation of complex scene trees, with instancing and subinstancing. +The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a :ref:`PackedScene`, all the nodes it owns are also saved with it. -\ **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 :doc:`tool scripts <../tutorials/plugins/running_code_in_the_editor>` and :doc:`editor plugins <../tutorials/plugins/editor/index>`. If a new node is added to the tree without setting its owner as an ancestor in that tree, it will be visible in the 2D/3D view, but not in the scene tree (and not persisted when packing or saving). +\ **Note:** In the editor, nodes not owned by the scene root are usually not displayed in the Scene dock, and will **not** be saved. To prevent this, remember to set the owner after calling :ref:`add_child`. See also (see :ref:`unique_name_in_owner`) .. rst-class:: classref-item-separator @@ -1084,7 +1112,7 @@ The node owner. A node can have any ancestor node as owner (i.e. a parent, grand - void **set_process_mode** **(** :ref:`ProcessMode` value **)** - :ref:`ProcessMode` **get_process_mode** **(** **)** -Can be used to pause or unpause the node, or make the node paused based on the :ref:`SceneTree`, or make it inherit the process mode from its parent (default). +The node's processing behavior (see :ref:`ProcessMode`). To check if the node can process in its current mode, use :ref:`can_process`. .. rst-class:: classref-item-separator @@ -1118,7 +1146,7 @@ Similar to :ref:`process_priority` but for - void **set_process_priority** **(** :ref:`int` value **)** - :ref:`int` **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. +The node's execution order of the process callbacks (:ref:`_process`, :ref:`_physics_process`, and internal processing). Nodes whose priority value is *lower* call their process callbacks first, regardless of tree order. .. rst-class:: classref-item-separator @@ -1192,7 +1220,7 @@ Set whether the current thread group will process messages (calls to :ref:`call_ - void **set_scene_file_path** **(** :ref:`String` value **)** - :ref:`String` **get_scene_file_path** **(** **)** -If a scene is instantiated from a file, its topmost node contains the absolute file path from which it was loaded in :ref:`scene_file_path` (e.g. ``res://levels/1.tscn``). Otherwise, :ref:`scene_file_path` is set to an empty string. +The original scene's file path, if the node has been instantiated from a :ref:`PackedScene` file. Only scene root nodes contains this. .. rst-class:: classref-item-separator @@ -1209,9 +1237,9 @@ If a scene is instantiated from a file, its topmost node contains the absolute f - void **set_unique_name_in_owner** **(** :ref:`bool` value **)** - :ref:`bool` **is_unique_name_in_owner** **(** **)** -Sets this node's name as a unique name in its :ref:`owner`. This allows the node to be accessed as ``%Name`` instead of the full path, from any node within that scene. +If ``true``, the node can be accessed from any node sharing the same :ref:`owner` or from the :ref:`owner` itself, with special ``%Name`` syntax in :ref:`get_node`. -If another node with the same owner already had that name declared as unique, that other node's name will no longer be set as having a unique name. +\ **Note:** If another node with the same :ref:`owner` shares the same :ref:`name` as this node, the other node will no longer be accessible as unique. .. rst-class:: classref-section-separator @@ -1228,7 +1256,7 @@ Method Descriptions 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. +Called when the node enters the :ref:`SceneTree` (e.g. upon instantiating, 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`. @@ -1254,10 +1282,18 @@ Corresponds to the :ref:`NOTIFICATION_EXIT_TREE` **_get_configuration_warnings** **(** **)** |virtual| |const| +:ref:`Array` **_get_configuration_warnings** **(** **)** |virtual| |const| The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a ``tool`` script. +Each array element must either be a :ref:`String` or a :ref:`Dictionary`. + +A dictionary element must contain a key ``message`` of type :ref:`String` which is shown in the user interface. + +The dictionary may optionally contain a key ``property`` of type :ref:`NodePath`, which also shows this warning in the inspector on the corresponding property. + +If a string is found in the returned array, it is converted to an equivalent dictionary with the ``message`` field set. + Returning an empty array produces no warnings. Call :ref:`update_configuration_warnings` when the warnings need to be updated for this node. @@ -1347,7 +1383,7 @@ Corresponds to the :ref:`NOTIFICATION_READY` 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 it again, :ref:`_ready` will not be called a second time. This can be bypassed by requesting another call with :ref:`request_ready`, which may be called anywhere before adding the node again. +\ **Note:** This method may be called only once for each node. After removing a node from the scene tree and adding it again, :ref:`_ready` will **not** be called a second time. This can be bypassed by requesting another call with :ref:`request_ready`, which may be called anywhere before adding the node again. .. rst-class:: classref-item-separator @@ -1425,9 +1461,9 @@ Adds a child ``node``. Nodes can have any number of children, but every child mu If ``force_readable_name`` is ``true``, improves the readability of the added ``node``. If not named, the ``node`` is renamed to its type, and if it shares :ref:`name` with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to ``false``, which assigns a dummy name featuring ``@`` in both situations. -If ``internal`` is different than :ref:`INTERNAL_MODE_DISABLED`, the child will be added as internal node. Such nodes are ignored by methods like :ref:`get_children`, unless their parameter ``include_internal`` is ``true``. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. :ref:`ColorPicker`. See :ref:`InternalMode` for available modes. +If ``internal`` is different than :ref:`INTERNAL_MODE_DISABLED`, the child will be added as internal node. These nodes are ignored by methods like :ref:`get_children`, unless their parameter ``include_internal`` is ``true``. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. :ref:`ColorPicker`. See :ref:`InternalMode` for available modes. -\ **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: +\ **Note:** If ``node`` already has a parent, this method will fail. Use :ref:`remove_child` first to remove ``node`` from its current parent. For example: .. tabs:: @@ -1464,13 +1500,13 @@ If you need the child node to be added below a specific node in the list of chil void **add_sibling** **(** :ref:`Node` sibling, :ref:`bool` force_readable_name=false **)** -Adds a ``sibling`` node to current's node parent, at the same level as that node, right below it. +Adds a ``sibling`` node to this node's parent, and moves the added sibling right below this node. If ``force_readable_name`` is ``true``, improves the readability of the added ``sibling``. If not named, the ``sibling`` is renamed to its type, and if it shares :ref:`name` with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to ``false``, which assigns a dummy name featuring ``@`` in both situations. Use :ref:`add_child` instead of this method if you don't need the child node to be added below a specific node in the list of children. -\ **Note:** If this node is internal, the new sibling will be internal too (see ``internal`` parameter in :ref:`add_child`). +\ **Note:** If this node is internal, the added sibling will be internal too (see :ref:`add_child`'s ``internal`` parameter). .. rst-class:: classref-item-separator @@ -1482,11 +1518,13 @@ Use :ref:`add_child` instead of this method if you void **add_to_group** **(** :ref:`StringName` 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`. +Adds the node to the ``group``. Groups can be helpful to organize a subset of nodes, for example ``"enemies"`` or ``"collectables"``. 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. +If ``persistent`` is ``true``, the group will be stored when saved inside a :ref:`PackedScene`. All groups created and displayed in the Node dock are persistent. -\ **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:** To improve performance, the order of group names is *not* guaranteed and may vary between project runs. Therefore, do not rely on the group order. + +\ **Note:** :ref:`SceneTree`'s group methods will *not* work on this node if not inside the tree (see :ref:`is_inside_tree`). .. rst-class:: classref-item-separator @@ -1522,7 +1560,19 @@ This function ensures that the calling of this function will succeed, no matter :ref:`bool` **can_process** **(** **)** |const| -Returns ``true`` if the node can process while the scene tree is paused (see :ref:`process_mode`). Always returns ``true`` if the scene tree is not paused, and ``false`` if the node is not in the tree. +Returns ``true`` if the node can receive processing notifications and input callbacks (:ref:`NOTIFICATION_PROCESS`, :ref:`_input`, etc) from the :ref:`SceneTree` and :ref:`Viewport`. The returned value depends on :ref:`process_mode`: + +- If set to :ref:`PROCESS_MODE_PAUSABLE`, returns ``true`` when the game is processing, i.e. :ref:`SceneTree.paused` is ``false``; + +- If set to :ref:`PROCESS_MODE_WHEN_PAUSED`, returns ``true`` when the game is paused, i.e. :ref:`SceneTree.paused` is ``true``; + +- If set to :ref:`PROCESS_MODE_ALWAYS`, always returns ``true``; + +- If set to :ref:`PROCESS_MODE_DISABLED`, always returns ``false``; + +- If set to :ref:`PROCESS_MODE_INHERIT`, use the parent node's :ref:`process_mode` to determine the result. + +If the node is not inside the tree, returns ``false`` no matter the value of :ref:`process_mode`. .. rst-class:: classref-item-separator @@ -1534,7 +1584,9 @@ Returns ``true`` if the node can process while the scene tree is paused (see :re :ref:`Tween` **create_tween** **(** **)** -Creates a new :ref:`Tween` and binds it to this node. This is equivalent of doing: +Creates a new :ref:`Tween` and binds it to this node. + +This is the equivalent of doing: .. tabs:: @@ -1549,7 +1601,9 @@ Creates a new :ref:`Tween` and binds it to this node. This is equiv -The Tween will start automatically on the next process frame or physics frame (depending on :ref:`TweenProcessMode`). +The Tween will start automatically on the next process frame or physics frame (depending on :ref:`TweenProcessMode`). See :ref:`Tween.bind_node` for more info on Tweens bound to nodes. + +\ **Note:** The method can still be used when the node is not inside :ref:`SceneTree`. It can fail in an unlikely case of using a custom :ref:`MainLoop`. .. rst-class:: classref-item-separator @@ -1561,11 +1615,9 @@ The Tween will start automatically on the next process frame or physics frame (d :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`). +Duplicates the node, returning a new node with all of its properties, signals and groups copied from the original. The behavior can be tweaked through 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. +\ **Note:** For nodes with a :ref:`Script` attached, if :ref:`Object._init` has been defined with required parameters, the duplicated node will not have a :ref:`Script`. .. rst-class:: classref-item-separator @@ -1577,17 +1629,13 @@ You can fine-tune the behavior using the ``flags`` (see :ref:`DuplicateFlags` **find_child** **(** :ref:`String` pattern, :ref:`bool` recursive=true, :ref:`bool` owned=true **)** |const| -Finds the first descendant of this node whose name matches ``pattern`` as in :ref:`String.match`. Internal children are also searched over (see ``internal`` parameter in :ref:`add_child`). +Finds the first descendant of this node whose :ref:`name` matches ``pattern``, returning ``null`` if no match is found. The matching is done against node names, *not* their paths, through :ref:`String.match`. As such, it is case-sensitive, ``"*"`` matches zero or more characters, and ``"?"`` matches any single character. -\ ``pattern`` does not match against the full path, just against individual node names. It is case-sensitive, with ``"*"`` matching zero or more characters and ``"?"`` matching any single character except ``"."``). +If ``recursive`` is ``false``, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see ``internal`` parameter in :ref:`add_child`). -If ``recursive`` is ``true``, all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If ``recursive`` is ``false``, only this node's direct children are matched. +If ``owned`` is ``true``, only descendants with a valid :ref:`owner` node are checked. -If ``owned`` is ``true``, this method only finds nodes who have an assigned :ref:`owner`. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. - -Returns ``null`` if no matching **Node** is found. - -\ **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` with unique names instead (see :ref:`unique_name_in_owner`), or caching the node references into variable. +\ **Note:** This method can be very slow. Consider storing a reference to the found node in a variable. Alternatively, use :ref:`get_node` with unique names (see :ref:`unique_name_in_owner`). \ **Note:** To find all descendant nodes matching a pattern or a class type, see :ref:`find_children`. @@ -1601,21 +1649,17 @@ Returns ``null`` if no matching **Node** is found. :ref:`Node[]` **find_children** **(** :ref:`String` pattern, :ref:`String` type="", :ref:`bool` recursive=true, :ref:`bool` owned=true **)** |const| -Finds descendants of this node whose name matches ``pattern`` as in :ref:`String.match`, and/or type matches ``type`` as in :ref:`Object.is_class`. Internal children are also searched over (see ``internal`` parameter in :ref:`add_child`). - -\ ``pattern`` does not match against the full path, just against individual node names. It is case-sensitive, with ``"*"`` matching zero or more characters and ``"?"`` matching any single character except ``"."``). +Finds all descendants of this node whose names match ``pattern``, returning an empty :ref:`Array` if no match is found. The matching is done against node names, *not* their paths, through :ref:`String.match`. As such, it is case-sensitive, ``"*"`` matches zero or more characters, and ``"?"`` matches any single character. -\ ``type`` will check equality or inheritance, and is case-sensitive. ``"Object"`` will match a node whose type is ``"Node"`` but not the other way around. +If ``type`` is not empty, only ancestors inheriting from ``type`` are included (see :ref:`Object.is_class`). -If ``recursive`` is ``true``, all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If ``recursive`` is ``false``, only this node's direct children are matched. +If ``recursive`` is ``false``, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see ``internal`` parameter in :ref:`add_child`). -If ``owned`` is ``true``, this method only finds nodes who have an assigned :ref:`owner`. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. +If ``owned`` is ``true``, only descendants with a valid :ref:`owner` node are checked. -Returns an empty array if no matching nodes are found. +\ **Note:** This method can be very slow. Consider storing references to the found nodes in a variable. -\ **Note:** As this method walks through all the descendants of the node, it is the slowest way to get references to other nodes. Whenever possible, consider caching the node references into variables. - -\ **Note:** If you only want to find the first descendant node that matches a pattern, see :ref:`find_child`. +\ **Note:** To find a single descendant node matching a pattern, see :ref:`find_child`. .. rst-class:: classref-item-separator @@ -1627,11 +1671,9 @@ Returns an empty array if no matching nodes are found. :ref:`Node` **find_parent** **(** :ref:`String` pattern **)** |const| -Finds the first parent of the current node whose name matches ``pattern`` as in :ref:`String.match`. - -\ ``pattern`` does not match against the full path, just against individual node names. It is case-sensitive, with ``"*"`` matching zero or more characters and ``"?"`` matching any single character except ``"."``). +Finds the first ancestor of this node whose :ref:`name` matches ``pattern``, returning ``null`` if no match is found. The matching is done through :ref:`String.match`. As such, it is case-sensitive, ``"*"`` matches zero or more characters, and ``"?"`` matches any single character. See also :ref:`find_child` and :ref:`find_children`. -\ **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` with unique names instead (see :ref:`unique_name_in_owner`), or caching the node references into variable. +\ **Note:** As this method walks upwards in the scene tree, it can be slow in large, deeply nested nodes. Consider storing a reference to the found node in a variable. Alternatively, use :ref:`get_node` with unique names (see :ref:`unique_name_in_owner`). .. rst-class:: classref-item-separator @@ -1643,13 +1685,21 @@ Finds the first parent of the current node whose name matches ``pattern`` as in :ref:`Node` **get_child** **(** :ref:`int` idx, :ref:`bool` include_internal=false **)** |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. +Fetches a child node by its index. Each child node has an index relative its siblings (see :ref:`get_index`). The first child is at index 0. Negative values can also be used to start from the end of the list. This method can be used in combination with :ref:`get_child_count` to iterate over this node's children. If no child exists at the given index, this method returns ``null`` and an error is generated. -Negative indices access the children from the last one. +If ``include_internal`` is ``false``, internal children are ignored (see :ref:`add_child`'s ``internal`` parameter). -If ``include_internal`` is ``false``, internal children are skipped (see ``internal`` parameter in :ref:`add_child`). +:: + + # Assuming the following are children of this node, in order: + # First, Middle, Last. + + var a = get_child(0).name # a is "First" + var b = get_child(1).name # b is "Middle" + var b = get_child(2).name # b is "Last" + var c = get_child(-1).name # c is "Last" -To access a child node via its name, use :ref:`get_node`. +\ **Note:** To fetch a node by :ref:`NodePath`, use :ref:`get_node`. .. rst-class:: classref-item-separator @@ -1661,9 +1711,9 @@ To access a child node via its name, use :ref:`get_node` **get_child_count** **(** :ref:`bool` include_internal=false **)** |const| -Returns the number of child nodes. +Returns the number of children of this node. -If ``include_internal`` is ``false``, internal children aren't counted (see ``internal`` parameter in :ref:`add_child`). +If ``include_internal`` is ``false``, internal children are not counted (see :ref:`add_child`'s ``internal`` parameter). .. rst-class:: classref-item-separator @@ -1675,9 +1725,9 @@ If ``include_internal`` is ``false``, internal children aren't counted (see ``in :ref:`Node[]` **get_children** **(** :ref:`bool` include_internal=false **)** |const| -Returns an array of references to node's children. +Returns all children of this node inside an :ref:`Array`. -If ``include_internal`` is ``false``, the returned array won't include internal children (see ``internal`` parameter in :ref:`add_child`). +If ``include_internal`` is ``false``, excludes internal children from the returned array (see :ref:`add_child`'s ``internal`` parameter). .. rst-class:: classref-item-separator @@ -1689,26 +1739,26 @@ If ``include_internal`` is ``false``, the returned array won't include internal :ref:`StringName[]` **get_groups** **(** **)** |const| -Returns an array listing the groups that the node is a member of. +Returns an :ref:`Array` of group names that the node has been added to. -\ **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:** To improve performance, the order of group names is *not* guaranteed and may vary between project runs. Therefore, do not rely on the group order. -\ **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: +\ **Note:** This method may also return some group names starting with an underscore (``_``). These are internally used by the engine. To avoid conflicts, do not use custom groups starting with underscores. To exclude internal groups, see the following code snippet: .. tabs:: .. code-tab:: gdscript - # Stores the node's non-internal groups only (as an array of Strings). + # Stores the node's non-internal groups only (as an array of StringNames). var non_internal_groups = [] for group in get_groups(): - if not group.begins_with("_"): + if not str(group).begins_with("_"): non_internal_groups.push_back(group) .. code-tab:: csharp - // Stores the node's non-internal groups only (as a List of strings). + // Stores the node's non-internal groups only (as a List of StringNames). List nonInternalGroups = new List(); foreach (string group in GetGroups()) { @@ -1728,9 +1778,9 @@ Returns an array listing the groups that the node is a member of. :ref:`int` **get_index** **(** :ref:`bool` include_internal=false **)** |const| -Returns the node's order in the scene tree branch. For example, if called on the first child node the position is ``0``. +Returns this node's order among its siblings. The first node's index is ``0``. See also :ref:`get_child`. -If ``include_internal`` is ``false``, the index won't take internal children into account, i.e. first non-internal child will have index of 0 (see ``internal`` parameter in :ref:`add_child`). +If ``include_internal`` is ``false``, returns the index ignoring internal children. The first, non-internal child will have an index of ``0`` (see :ref:`add_child`'s ``internal`` parameter). .. rst-class:: classref-item-separator @@ -1766,24 +1816,26 @@ Returns the peer ID of the multiplayer authority for this node. See :ref:`set_mu :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, ``null`` 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. +Fetches a node. The :ref:`NodePath` can either be a relative path (from this node), or an absolute path (from the :ref:`SceneTree.root`) to a node. If ``path`` does not point to a valid node, generates an error and returns ``null``. 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`). +\ **Note:** Fetching by absolute path 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: +\ **Example:** Assume this method is called from the Character node, inside the following tree: :: - /root - /root/Character - /root/Character/Sword - /root/Character/Backpack/Dagger - /root/MyGame - /root/Swamp/Alligator - /root/Swamp/Mosquito - /root/Swamp/Goblin + ┖╴root + ┠╴Character (you are here!) + ┃ ┠╴Sword + ┃ ┖╴Backpack + ┃ ┖╴Dagger + ┠╴MyGame + ┖╴Swamp + ┠╴Alligator + ┠╴Mosquito + ┖╴Goblin -Possible paths are: +The following calls will return a valid node: .. tabs:: @@ -1814,26 +1866,52 @@ Possible paths are: :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. +Fetches a node and its most nested resource as specified by the :ref:`NodePath`'s subname. Returns an :ref:`Array` of size ``3`` where: + +- Element ``0`` is the **Node**, or ``null`` if not found; -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. +- Element ``1`` is the subname's last nested :ref:`Resource`, or ``null`` if not found; -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: +- Element ``2`` is the remaining :ref:`NodePath`, referring to an existing, non-:ref:`Resource` property (see :ref:`Object.get_indexed`). + +\ **Example:** Assume that the child's :ref:`Sprite2D.texture` has been assigned a :ref:`AtlasTexture`: .. tabs:: .. code-tab:: gdscript - 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] + var a = get_node_and_resource("Area2D/Sprite2D") + print(a[0].name) # Prints Sprite2D + print(a[1]) # Prints + print(a[2]) # Prints ^"" + + var b = get_node_and_resource("Area2D/Sprite2D:texture:atlas") + print(b[0].name) # Prints Sprite2D + print(b[1].get_class()) # Prints AtlasTexture + print(b[2]) # Prints ^"" + + var c = get_node_and_resource("Area2D/Sprite2D:texture:atlas:region") + print(c[0].name) # Prints Sprite2D + print(c[1].get_class()) # Prints AtlasTexture + print(c[2]) # Prints ^":region" .. code-tab:: csharp - GD.Print(GetNodeAndResource("Area2D/CollisionShape2D")); // [[CollisionShape2D:1161], Null, ] - GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], ] - GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape:extents")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents] + var a = GetNodeAndResource(NodePath("Area2D/Sprite2D")); + GD.Print(a[0].Name); // Prints Sprite2D + GD.Print(a[1]); // Prints + GD.Print(a[2]); // Prints ^" + + var b = GetNodeAndResource(NodePath("Area2D/Sprite2D:texture:atlas")); + GD.Print(b[0].name); // Prints Sprite2D + GD.Print(b[1].get_class()); // Prints AtlasTexture + GD.Print(b[2]); // Prints ^"" + + var c = GetNodeAndResource(NodePath("Area2D/Sprite2D:texture:atlas:region")); + GD.Print(c[0].name); // Prints Sprite2D + GD.Print(c[1].get_class()); // Prints AtlasTexture + GD.Print(c[2]); // Prints ^":region" @@ -1847,7 +1925,7 @@ For example, assuming that ``Area2D/CollisionShape2D`` is a valid node and that :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**. +Fetches a node by :ref:`NodePath`. Similar to :ref:`get_node`, but does not generate an error if ``path`` does not point to a valid node. .. rst-class:: classref-item-separator @@ -1859,7 +1937,7 @@ Similar to :ref:`get_node`, but does not log an erro :ref:`Node` **get_parent** **(** **)** |const| -Returns the parent node of the current node, or ``null`` if the node lacks a parent. +Returns this node's parent node, or ``null`` if the node doesn't have a parent. .. rst-class:: classref-item-separator @@ -1871,7 +1949,7 @@ Returns the parent node of the current node, or ``null`` if the node lacks a par :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`). +Returns the node's absolute path, relative to the :ref:`SceneTree.root`. If the node is not inside the scene tree, this method fails and returns an empty :ref:`NodePath`. .. rst-class:: classref-item-separator @@ -1883,11 +1961,11 @@ Returns the absolute path of the current node. This only works if the current no :ref:`NodePath` **get_path_to** **(** :ref:`Node` node, :ref:`bool` use_unique_path=false **)** |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. +Returns the relative :ref:`NodePath` from this node to the specified ``node``. Both nodes must be in the same :ref:`SceneTree`, otherwise this method fails and returns an empty :ref:`NodePath`. -If ``use_unique_path`` is ``true``, returns the shortest path considering unique node. +If ``use_unique_path`` is ``true``, returns the shortest path accounting for this node's unique name (see :ref:`unique_name_in_owner`). -\ **Note:** If you get a relative path which starts from a unique node, the path may be longer than a normal relative path due to the addition of the unique node's name. +\ **Note:** If you get a relative path which starts from a unique node, the path may be longer than a normal relative path, due to the addition of the unique node's name. .. rst-class:: classref-item-separator @@ -1899,7 +1977,7 @@ If ``use_unique_path`` is ``true``, returns the shortest path considering unique :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.physics_ticks_per_second`. +Returns the time elapsed (in seconds) since the last physics callback. This value is identical to :ref:`_physics_process`'s ``delta`` parameter, and is often consistent at run-time, unless :ref:`Engine.physics_ticks_per_second` is changed. See also :ref:`NOTIFICATION_PHYSICS_PROCESS`. .. rst-class:: classref-item-separator @@ -1911,7 +1989,7 @@ Returns the time elapsed (in seconds) since the last physics-bound frame (see :r :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. +Returns the time elapsed (in seconds) since the last process callback. This value is identical to :ref:`_process`'s ``delta`` parameter, and may vary from frame to frame. See also :ref:`NOTIFICATION_PROCESS`. .. rst-class:: classref-item-separator @@ -1923,7 +2001,7 @@ Returns the time elapsed (in seconds) since the last process callback. This valu :ref:`bool` **get_scene_instance_load_placeholder** **(** **)** |const| -Returns ``true`` if this is an instance load placeholder. See :ref:`InstancePlaceholder`. +Returns ``true`` if this node is an instance load placeholder. See :ref:`InstancePlaceholder` and :ref:`set_scene_instance_load_placeholder`. .. rst-class:: classref-item-separator @@ -1935,7 +2013,7 @@ Returns ``true`` if this is an instance load placeholder. See :ref:`InstancePlac :ref:`SceneTree` **get_tree** **(** **)** |const| -Returns the :ref:`SceneTree` that contains this node. Returns ``null`` and prints an error if this node is not inside the scene tree. See also :ref:`is_inside_tree`. +Returns the :ref:`SceneTree` that contains this node. If this node is not inside the tree, generates an error and returns ``null``. See also :ref:`is_inside_tree`. .. rst-class:: classref-item-separator @@ -1993,7 +2071,7 @@ Similar to :ref:`get_tree_string`, this retur :ref:`Viewport` **get_viewport** **(** **)** |const| -Returns the node's :ref:`Viewport`. +Returns the node's closest :ref:`Viewport` ancestor, if the node is inside the tree. Otherwise, returns ``null``. .. rst-class:: classref-item-separator @@ -2017,7 +2095,7 @@ Returns the :ref:`Window` that contains this node. If the node is :ref:`bool` **has_node** **(** :ref:`NodePath` path **)** |const| -Returns ``true`` if the node that the :ref:`NodePath` points to exists. +Returns ``true`` if the ``path`` points to a valid node. See also :ref:`get_node`. .. rst-class:: classref-item-separator @@ -2029,7 +2107,7 @@ Returns ``true`` if the node that the :ref:`NodePath` points to :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. +Returns ``true`` if ``path`` points to a valid node and its subnames point to a valid :ref:`Resource`, e.g. ``Area2D/CollisionShape2D:shape``. Properties that are not :ref:`Resource` types (such as nodes or other :ref:`Variant` types) are not considered. See also :ref:`get_node_and_resource`. .. rst-class:: classref-item-separator @@ -2041,7 +2119,7 @@ Returns ``true`` if the :ref:`NodePath` points to a valid node a :ref:`bool` **is_ancestor_of** **(** :ref:`Node` node **)** |const| -Returns ``true`` if the given node is a direct or indirect child of the current node. +Returns ``true`` if the given ``node`` is a direct or indirect child of this node. .. rst-class:: classref-item-separator @@ -2053,7 +2131,7 @@ Returns ``true`` if the given node is a direct or indirect child of the current :ref:`bool` **is_displayed_folded** **(** **)** |const| -Returns ``true`` if the node is folded (collapsed) in the Scene dock. This method is only intended for use with editor tooling. +Returns ``true`` if the node is folded (collapsed) in the Scene dock. This method is intended to be used in editor plugins and tools. See also :ref:`set_display_folded`. .. rst-class:: classref-item-separator @@ -2065,7 +2143,7 @@ Returns ``true`` if the node is folded (collapsed) in the Scene dock. This metho :ref:`bool` **is_editable_instance** **(** :ref:`Node` node **)** |const| -Returns ``true`` if ``node`` has editable children enabled relative to this node. This method is only intended for use with editor tooling. +Returns ``true`` if ``node`` has editable children enabled relative to this node. This method is intended to be used in editor plugins and tools. See also :ref:`set_editable_instance`. .. rst-class:: classref-item-separator @@ -2077,7 +2155,7 @@ Returns ``true`` if ``node`` has editable children enabled relative to this node :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. +Returns ``true`` if the given ``node`` occurs later in the scene hierarchy than this node. A node occurring later is usually processed last. .. rst-class:: classref-item-separator @@ -2089,7 +2167,7 @@ Returns ``true`` if the given node occurs later in the scene hierarchy than the :ref:`bool` **is_in_group** **(** :ref:`StringName` group **)** |const| -Returns ``true`` if this node is in the specified group. See notes in the description, and the group methods in :ref:`SceneTree`. +Returns ``true`` if this node has been added to the given ``group``. See :ref:`add_to_group` and :ref:`remove_from_group`. See also notes in the description, and the :ref:`SceneTree`'s group methods. .. rst-class:: classref-item-separator @@ -2101,7 +2179,7 @@ Returns ``true`` if this node is in the specified group. See notes in the descri :ref:`bool` **is_inside_tree** **(** **)** |const| -Returns ``true`` if this node is currently inside a :ref:`SceneTree`. +Returns ``true`` if this node is currently inside a :ref:`SceneTree`. See also :ref:`get_tree`. .. rst-class:: classref-item-separator @@ -2235,9 +2313,9 @@ Returns ``true`` if the node is processing unhandled key input (see :ref:`set_pr void **move_child** **(** :ref:`Node` child_node, :ref:`int` to_index **)** -Moves a child node to a different index (order) among the other children. Since calls, signals, etc. are performed by tree order, changing the order of children nodes may be useful. If ``to_index`` is negative, the index will be counted from the end. +Moves ``child_node`` to the given index. A node's index is the order among its siblings. If ``to_index`` is negative, the index is counted from the end of the list. See also :ref:`get_child` and :ref:`get_index`. -\ **Note:** Internal children can only be moved within their expected "internal range" (see ``internal`` parameter in :ref:`add_child`). +\ **Note:** The processing order of several engine callbacks (:ref:`_ready`, :ref:`_process`, etc.) and notifications sent through :ref:`propagate_notification` is affected by tree order. :ref:`CanvasItem` nodes are also rendered in tree order. See also :ref:`process_priority`. .. rst-class:: classref-item-separator @@ -2273,9 +2351,9 @@ Similar to :ref:`call_thread_safe`, but for void **print_orphan_nodes** **(** **)** |static| -Prints all orphan nodes (nodes outside the :ref:`SceneTree`). Used for debugging. +Prints all orphan nodes (nodes outside the :ref:`SceneTree`). Useful for debugging. -\ **Note:** :ref:`print_orphan_nodes` only works in debug builds. When called in a project exported in release mode, :ref:`print_orphan_nodes` will not print anything. +\ **Note:** This method only works in debug builds. Does nothing in a project exported in release mode. .. rst-class:: classref-item-separator @@ -2287,18 +2365,18 @@ Prints all orphan nodes (nodes outside the :ref:`SceneTree`). U 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. +Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs :ref:`NodePath`\ s relative to this node, and is good for copy/pasting into :ref:`get_node`. See also :ref:`print_tree_pretty`. \ **Example output:**\ :: - TheGame - TheGame/Menu - TheGame/Menu/Label - TheGame/Menu/Camera2D - TheGame/SplashScreen - TheGame/SplashScreen/Camera2D + . + Menu + Menu/Label + Menu/Camera2D + SplashScreen + SplashScreen/Camera2D .. rst-class:: classref-item-separator @@ -2310,7 +2388,7 @@ Prints the tree to stdout. Used mainly for debugging purposes. This version disp 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 Dock. It is useful for inspecting larger trees. +Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to :ref:`print_tree`, but the graphical representation looks like what is displayed in the editor's Scene dock. It is useful for inspecting larger trees. \ **Example output:**\ @@ -2333,7 +2411,9 @@ Similar to :ref:`print_tree`, this prints the tree void **propagate_call** **(** :ref:`StringName` 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. +Calls the given ``method`` name, passing ``args`` as arguments, on this node and all of its children, recursively. + +If ``parent_first`` is ``true``, the method is called on this node first, then on all of its children. If ``false``, the children's methods are called first. .. rst-class:: classref-item-separator @@ -2345,7 +2425,7 @@ Calls the given method (if present) with the arguments given in ``args`` on this void **propagate_notification** **(** :ref:`int` what **)** -Notifies the current node and all its children recursively by calling :ref:`Object.notification` on all of them. +Calls :ref:`Object.notification` with ``what`` on this node and all of its children, recursively. .. rst-class:: classref-item-separator @@ -2357,11 +2437,11 @@ Notifies the current node and all its children recursively by calling :ref:`Obje 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, and all references to the node and its children will become invalid, see :ref:`Object.free`. +Queues this node to be deleted at the end of the current frame. When deleted, all of its children are deleted as well, and all references to the node and its children become invalid. -It is safe to call :ref:`queue_free` multiple times per frame on a node, and to :ref:`Object.free` a node that is currently queued for deletion. Use :ref:`Object.is_queued_for_deletion` to check whether a node will be deleted at the end of the frame. +Unlike with :ref:`Object.free`, the node is not deleted instantly, and it can still be accessed before deletion. It is also safe to call :ref:`queue_free` multiple times. Use :ref:`Object.is_queued_for_deletion` to check if the node will be deleted at the end of the frame. -The node will only be freed after all other deferred calls are finished, so using :ref:`queue_free` is not always the same as calling :ref:`Object.free` through :ref:`Object.call_deferred`. +\ **Note:** The node will only be freed after all other deferred calls are finished. Using this method is not always the same as calling :ref:`Object.free` through :ref:`Object.call_deferred`. .. rst-class:: classref-item-separator @@ -2373,9 +2453,9 @@ The node will only be freed after all other deferred calls are finished, so usin void **remove_child** **(** :ref:`Node` node **)** -Removes a child node. The node is NOT deleted and must be deleted manually. +Removes a child ``node``. The ``node``, along with its children, are **not** deleted. To delete a node, see :ref:`queue_free`. -\ **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. +\ **Note:** When this node is inside the tree, this method sets the :ref:`owner` of the removed ``node`` (or its descendants) to ``null``, if their :ref:`owner` is no longer an ancestor (see :ref:`is_ancestor_of`). .. rst-class:: classref-item-separator @@ -2387,7 +2467,7 @@ Removes a child node. The node is NOT deleted and must be deleted manually. void **remove_from_group** **(** :ref:`StringName` group **)** -Removes a node from the ``group``. Does nothing if the node is not in the ``group``. See notes in the description, and the group methods in :ref:`SceneTree`. +Removes the node from the given ``group``. Does nothing if the node is not in the ``group``. See also notes in the description, and the :ref:`SceneTree`'s group methods. .. rst-class:: classref-item-separator @@ -2399,7 +2479,7 @@ Removes a node from the ``group``. Does nothing if the node is not in the ``grou void **reparent** **(** :ref:`Node` new_parent, :ref:`bool` keep_global_transform=true **)** -Changes the parent of this **Node** to the ``new_parent``. The node needs to already have a parent. +Changes the parent of this **Node** to the ``new_parent``. The node needs to already have a parent. The node's :ref:`owner` is preserved if its owner is still reachable from the new location (i.e., the node is still a descendant of the new parent after the operation). If ``keep_global_transform`` is ``true``, the node's global transform will be preserved if supported. :ref:`Node2D`, :ref:`Node3D` and :ref:`Control` support this argument (but :ref:`Control` keeps only position). @@ -2413,13 +2493,11 @@ If ``keep_global_transform`` is ``true``, the node's global transform will be pr void **replace_by** **(** :ref:`Node` node, :ref:`bool` keep_groups=false **)** -Replaces a node in a scene by the given one. Subscriptions that pass through this node will be lost. +Replaces this node by the given ``node``. All children of this node are moved to ``node``. -If ``keep_groups`` is ``true``, the ``node`` is added to the same groups that the replaced node is in. +If ``keep_groups`` is ``true``, the ``node`` is added to the same groups that the replaced node is in (see :ref:`add_to_group`). -\ **Note:** The given node will become the new parent of any child nodes that the replaced node had. - -\ **Note:** 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`. +\ **Warning:** The replaced node is removed from the tree, but it is **not** deleted. To prevent memory leaks, store a reference to the node in a variable, or use :ref:`Object.free`. .. rst-class:: classref-item-separator @@ -2431,7 +2509,9 @@ If ``keep_groups`` is ``true``, the ``node`` is added to the same groups that th void **request_ready** **(** **)** -Requests that :ref:`_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. :ref:`_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 :ref:`_ready` too (in which case, :ref:`_ready` will be called in the same order as it would normally). +Requests :ref:`_ready` to be called again the next time the node enters the tree. Does **not** immediately call :ref:`_ready`. + +\ **Note:** This method only affects the current node. If the node's children also need to request ready, this method needs to be called for each one of them. When the node and its children enter the tree again, the order of :ref:`_ready` callbacks will be the same as normal. .. rst-class:: classref-item-separator @@ -2443,9 +2523,11 @@ Requests that :ref:`_ready` be called again. N :ref:`Error` **rpc** **(** :ref:`StringName` 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. Behavior depends on the RPC configuration for the given method, see :ref:`rpc_config` and :ref:`@GDScript.@rpc`. Methods are not exposed to RPCs by default. Returns ``null``. +Sends a remote procedure call request for the given ``method`` to peers on the network (and locally), sending additional 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 :ref:`name`. Behavior depends on the RPC configuration for the given ``method`` (see :ref:`rpc_config` and :ref:`@GDScript.@rpc`). By default, methods are not exposed to RPCs. -\ **Note:** You can only safely use RPCs on clients after you received the ``connected_to_server`` signal from the :ref:`MultiplayerAPI`. You also need to keep track of the connection state, either by the :ref:`MultiplayerAPI` signals like ``server_disconnected`` or by checking ``get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED``. +May return :ref:`@GlobalScope.OK` if the call is successful, :ref:`@GlobalScope.ERR_INVALID_PARAMETER` if the arguments passed in the ``method`` do not match, :ref:`@GlobalScope.ERR_UNCONFIGURED` if the node's :ref:`multiplayer` cannot be fetched (such as when the node is not inside the tree), :ref:`@GlobalScope.ERR_CONNECTION_ERROR` if :ref:`multiplayer`'s connection is not available. + +\ **Note:** You can only safely use RPCs on clients after you received the :ref:`MultiplayerAPI.connected_to_server` signal from the :ref:`MultiplayerAPI`. You also need to keep track of the connection state, either by the :ref:`MultiplayerAPI` signals like :ref:`MultiplayerAPI.server_disconnected` or by checking (``get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED``). .. rst-class:: classref-item-separator @@ -2457,18 +2539,17 @@ Sends a remote procedure call request for the given ``method`` to peers on the n void **rpc_config** **(** :ref:`StringName` method, :ref:`Variant` config **)** -Changes the RPC mode for the given ``method`` with the given ``config`` which should be ``null`` (to disable) or a :ref:`Dictionary` in the form: +Changes the RPC configuration for the given ``method``. ``config`` should either be ``null`` to disable the feature (as by default), or a :ref:`Dictionary` containing the following entries: -:: +- ``rpc_mode``: see :ref:`RPCMode`; - { - rpc_mode = MultiplayerAPI.RPCMode, - transfer_mode = MultiplayerPeer.TransferMode, - call_local = false, - channel = 0, - } +- ``transfer_mode``: see :ref:`TransferMode`; + +- ``call_local``: if ``true``, the method will also be called locally; + +- ``channel``: an :ref:`int` representing the channel to send the RPC on. -See :ref:`RPCMode` and :ref:`TransferMode`. An alternative is annotating methods and properties with the corresponding :ref:`@GDScript.@rpc` annotation (``@rpc("any_peer")``, ``@rpc("authority")``). By default, methods are not exposed to networking (and RPCs). +\ **Note:** In GDScript, this method corresponds to the :ref:`@GDScript.@rpc` annotation, with various parameters passed (``@rpc(any)``, ``@rpc(authority)``...). See also the :doc:`high-level multiplayer <../tutorials/networking/high_level_multiplayer>` tutorial. .. rst-class:: classref-item-separator @@ -2480,7 +2561,9 @@ See :ref:`RPCMode` and :ref:`TransferMode` **rpc_id** **(** :ref:`int` peer_id, :ref:`StringName` method, ... **)** |vararg| -Sends a :ref:`rpc` to a specific peer identified by ``peer_id`` (see :ref:`MultiplayerPeer.set_target_peer`). Returns ``null``. +Sends a :ref:`rpc` to a specific peer identified by ``peer_id`` (see :ref:`MultiplayerPeer.set_target_peer`). + +May return :ref:`@GlobalScope.OK` if the call is successful, :ref:`@GlobalScope.ERR_INVALID_PARAMETER` if the arguments passed in the ``method`` do not match, :ref:`@GlobalScope.ERR_UNCONFIGURED` if the node's :ref:`multiplayer` cannot be fetched (such as when the node is not inside the tree), :ref:`@GlobalScope.ERR_CONNECTION_ERROR` if :ref:`multiplayer`'s connection is not available. .. rst-class:: classref-item-separator @@ -2504,7 +2587,7 @@ Similar to :ref:`call_deferred_thread_group` fold **)** -Sets the folded state of the node in the Scene dock. This method is only intended for use with editor tooling. +If set to ``true``, the node appears folded in the Scene dock. As a result, all of its children are hidden. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also :ref:`is_displayed_folded`. .. rst-class:: classref-item-separator @@ -2516,7 +2599,7 @@ Sets the folded state of the node in the Scene dock. This method is only intende void **set_editable_instance** **(** :ref:`Node` node, :ref:`bool` is_editable **)** -Sets the editable children state of ``node`` relative to this node. This method is only intended for use with editor tooling. +Set to ``true`` to allow all nodes owned by ``node`` to be available, and editable, in the Scene dock, even if their :ref:`owner` is not the scene root. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also :ref:`is_editable_instance`. .. rst-class:: classref-item-separator @@ -2528,9 +2611,11 @@ Sets the editable children state of ``node`` relative to this node. This method void **set_multiplayer_authority** **(** :ref:`int` id, :ref:`bool` recursive=true **)** -Sets the node's multiplayer authority to the peer with the given peer ID. The multiplayer authority is the peer that has authority over the node on the network. Useful in conjunction with :ref:`rpc_config` and the :ref:`MultiplayerAPI`. Defaults to peer ID 1 (the server). If ``recursive``, the given peer is recursively set as the authority for all children of this node. +Sets the node's multiplayer authority to the peer with the given peer ``id``. The multiplayer authority is the peer that has authority over the node on the network. Defaults to peer ID 1 (the server). Useful in conjunction with :ref:`rpc_config` and the :ref:`MultiplayerAPI`. + +If ``recursive`` is ``true``, the given peer is recursively set as the authority for all children of this node. -\ **Warning:** This does **not** automatically replicate the new authority to other peers. It is developer's responsibility to do so. You can propagate the information about the new authority using :ref:`MultiplayerSpawner.spawn_function`, an RPC, or using a :ref:`MultiplayerSynchronizer`. Also, the parent's authority does **not** propagate to newly added children. +\ **Warning:** This does **not** automatically replicate the new authority to other peers. It is the developer's responsibility to do so. You may replicate the new authority's information using :ref:`MultiplayerSpawner.spawn_function`, an RPC, or a :ref:`MultiplayerSynchronizer`. Furthermore, the parent's authority does **not** propagate to newly added children. .. rst-class:: classref-item-separator @@ -2542,7 +2627,7 @@ Sets the node's multiplayer authority to the peer with the given peer ID. The mu 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.physics_ticks_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. +If set to ``true``, enables physics (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.physics_ticks_per_second` to change) interval (and the :ref:`_physics_process` callback will be called if it exists). Enabled automatically if :ref:`_physics_process` is overridden. .. rst-class:: classref-item-separator @@ -2554,9 +2639,9 @@ Enables or disables physics (i.e. fixed framerate) processing. When a node is be 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. +If set to ``true``, enables 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`). -\ **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. +\ **Warning:** Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing. .. rst-class:: classref-item-separator @@ -2568,7 +2653,9 @@ Enables or disables internal physics for this node. Internal physics processing 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. +If set to ``true``, enables 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 it exists). Enabled automatically if :ref:`_process` is overridden. + +\ **Note:** This method only affects the :ref:`_process` callback, i.e. it has no effect on other callbacks like :ref:`_physics_process`. If you want to disable all processing for the node, set :ref:`process_mode` to :ref:`PROCESS_MODE_DISABLED`. .. rst-class:: classref-item-separator @@ -2580,7 +2667,7 @@ Enables or disables processing. When a node is being processed, it will receive 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. +If set to ``true``, enables input processing. This is not required for GUI controls! Enabled automatically if :ref:`_input` is overridden. .. rst-class:: classref-item-separator @@ -2592,9 +2679,9 @@ Enables or disables input processing. This is not required for GUI controls! Ena 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. +If set to ``true``, enables 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`). -\ **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. +\ **Warning:** Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing. .. rst-class:: classref-item-separator @@ -2606,7 +2693,7 @@ Enables or disabled internal processing for this node. Internal processing happe void **set_process_shortcut_input** **(** :ref:`bool` enable **)** -Enables shortcut processing. Enabled automatically if :ref:`_shortcut_input` is overridden. Any calls to this before :ref:`_ready` will be ignored. +If set to ``true``, enables shortcut processing for this node. Enabled automatically if :ref:`_shortcut_input` is overridden. .. rst-class:: classref-item-separator @@ -2618,7 +2705,7 @@ Enables shortcut processing. Enabled automatically if :ref:`_shortcut_input` 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. +If set to ``true``, 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. .. rst-class:: classref-item-separator @@ -2630,7 +2717,7 @@ Enables unhandled input processing. This is not required for GUI controls! It en 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. +If set to ``true``, enables unhandled key input processing. Enabled automatically if :ref:`_unhandled_key_input` is overridden. .. rst-class:: classref-item-separator @@ -2642,7 +2729,7 @@ Enables unhandled key input processing. Enabled automatically if :ref:`_unhandle void **set_scene_instance_load_placeholder** **(** :ref:`bool` load_placeholder **)** -Sets whether this is an instance load placeholder. See :ref:`InstancePlaceholder`. +If set to ``true``, the node becomes a :ref:`InstancePlaceholder` when packed and instantiated from a :ref:`PackedScene`. See also :ref:`get_scene_instance_load_placeholder`. .. rst-class:: classref-item-separator @@ -2666,9 +2753,7 @@ Similar to :ref:`call_thread_safe`, but for void **update_configuration_warnings** **(** **)** -Updates the warning displayed for this node in the Scene Dock. - -Use :ref:`_get_configuration_warnings` to setup the warning message to display. +Refreshes the warnings displayed for this node in the Scene dock. Use :ref:`_get_configuration_warnings` to customize the warning messages 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.)` diff --git a/classes/class_nodepath.rst b/classes/class_nodepath.rst index af615acf25e..c336e3a76b8 100644 --- a/classes/class_nodepath.rst +++ b/classes/class_nodepath.rst @@ -269,14 +269,14 @@ Gets the node name indicated by ``idx`` (0 to :ref:`get_name_count` and :ref:`_get_prope :ref:`Dictionary[]` **_get_property_list** **(** **)** |virtual| -Override this method to customize how script properties should be handled by the engine. +Override this method to provide a custom list of additional properties to handle by the engine. Should return a property list, as an :ref:`Array` of dictionaries. The result is added to the array of :ref:`get_property_list`, and should be formatted in the same way. Each :ref:`Dictionary` must at least contain the ``name`` and ``type`` entries. -The example below displays ``hammer_type`` in the Inspector dock, only if ``holding_hammer`` is ``true``: +You can use :ref:`_property_can_revert` and :ref:`_property_get_revert` to customize the default values of the properties added by this method. + +The example below displays a list of numbers shown as words going from ``ZERO`` to ``FIVE``, with ``number_count`` controlling the size of the list: .. tabs:: @@ -363,79 +373,107 @@ The example below displays ``hammer_type`` in the Inspector dock, only if ``hold .. code-tab:: gdscript @tool - extends Node2D + extends Node - @export var holding_hammer = false: - set(value): - holding_hammer = value + @export var number_count = 3: + set(nc): + number_count = nc + numbers.resize(number_count) notify_property_list_changed() - var hammer_type = 0 - func _get_property_list(): - # By default, `hammer_type` is not visible in the editor. - var property_usage = PROPERTY_USAGE_NO_EDITOR - - if holding_hammer: - property_usage = PROPERTY_USAGE_DEFAULT + var numbers = PackedInt32Array([0, 0, 0]) + func _get_property_list(): var properties = [] - properties.append({ - "name": "hammer_type", - "type": TYPE_INT, - "usage": property_usage, # See above assignment. - "hint": PROPERTY_HINT_ENUM, - "hint_string": "Wooden,Iron,Golden,Enchanted" - }) + + for i in range(number_count): + properties.append({ + "name": "number_%d" % i, + "type": TYPE_INT, + "hint": PROPERTY_HINT_ENUM, + "hint_string": "ZERO,ONE,TWO,THREE,FOUR,FIVE", + }) return properties + + func _get(property): + if property.begins_with("number_"): + var index = property.get_slice("_", 1).to_int() + return numbers[index] + + func _set(property, value): + if property.begins_with("number_"): + var index = property.get_slice("_", 1).to_int() + numbers[index] = value + return true + return false .. code-tab:: csharp [Tool] - public partial class MyNode2D : Node2D + public partial class MyNode : Node { - private bool _holdingHammer; + private int _numberCount; [Export] - public bool HoldingHammer + public int NumberCount { - get => _holdingHammer; + get => _numberCount; set { - _holdingHammer = value; + _numberCount = value; + _numbers.Resize(_numberCount); NotifyPropertyListChanged(); } } - public int HammerType { get; set; } + private List _numbers = new(); public override Godot.Collections.Array _GetPropertyList() { - // By default, `HammerType` is not visible in the editor. - var propertyUsage = PropertyUsageFlags.NoEditor; + var properties = new Godot.Collections.Array(); - if (HoldingHammer) + for (int i = 0; i < _numberCount; i++) { - propertyUsage = PropertyUsageFlags.Default; + properties.Add(new Godot.Collections.Dictionary() + { + { "name", $"number_{i}" }, + { "type", (int)Variant.Type.Int }, + { "hint", (int)PropertyHint.Enum }, + { "hint_string", "Zero,One,Two,Three,Four,Five" }, + }); } - var properties = new Godot.Collections.Array(); - properties.Add(new Godot.Collections.Dictionary() + return properties; + } + + public override Variant _Get(StringName property) + { + string propertyName = property.ToString(); + if (propertyName.StartsWith("number_")) { - { "name", "HammerType" }, - { "type", (int)Variant.Type.Int }, - { "usage", (int)propertyUsage }, // See above assignment. - { "hint", (int)PropertyHint.Enum }, - { "hint_string", "Wooden,Iron,Golden,Enchanted" } - }); + int index = int.Parse(propertyName.Substring("number_".Length)); + return _numbers[index]; + } + return default; + } - return properties; + public override bool _Set(StringName property, Variant value) + { + string propertyName = property.ToString(); + if (propertyName.StartsWith("number_")) + { + int index = int.Parse(propertyName.Substring("number_".Length)); + numbers[index] = value.As(); + return true; + } + return false; } } -\ **Note:** This method is intended for advanced purposes. For most common use cases, the scripting languages offer easier ways to handle properties. See :ref:`@GDScript.@export`, :ref:`@GDScript.@export_enum`, :ref:`@GDScript.@export_group`, etc. +\ **Note:** This method is intended for advanced purposes. For most common use cases, the scripting languages offer easier ways to handle properties. See :ref:`@GDScript.@export`, :ref:`@GDScript.@export_enum`, :ref:`@GDScript.@export_group`, etc. If you want to customize exported properties, use :ref:`_validate_property`. \ **Note:** If the object's script is not :ref:`@GDScript.@tool`, this method will not be called in the editor. @@ -610,7 +648,7 @@ Override this method to customize the return value of :ref:`to_string` property **)** |virtual| -Override this method to customize existing properties. Every property info goes through this method. The dictionary contents is the same as in :ref:`_get_property_list`. +Override this method to customize existing properties. Every property info goes through this method, except properties added with :ref:`_get_property_list`. The dictionary contents is the same as in :ref:`_get_property_list`. .. tabs:: @@ -655,7 +693,7 @@ Override this method to customize existing properties. Every property info goes { if (property["name"].AsStringName() == PropertyName.Number && IsNumberEditable) { - var usage = property["usage"].As>PropertyUsageFlags<() | PropertyUsageFlags.ReadOnly; + var usage = property["usage"].As() | PropertyUsageFlags.ReadOnly; property["usage"] = (int)usage; } } diff --git a/classes/class_omnilight3d.rst b/classes/class_omnilight3d.rst index 9b970528865..0881362407e 100644 --- a/classes/class_omnilight3d.rst +++ b/classes/class_omnilight3d.rst @@ -103,9 +103,13 @@ Property Descriptions - void **set_param** **(** :ref:`float` value **)** - :ref:`float` **get_param** **(** **)** -The light's attenuation (drop-off) curve. A number of presets are available in the **Inspector** by right-clicking the curve. Zero and negative values are allowed but can produce unusual effects. +Controls the distance attenuation function for omnilights. -\ **Note:** Very high :ref:`omni_attenuation` values (typically above 10) can impact performance negatively if the light is made to use a larger :ref:`omni_range` to compensate. This is because culling opportunities will become less common and shading costs will be increased (as the light will cover more pixels on screen while resulting in the same amount of brightness). To improve performance, use the lowest :ref:`omni_attenuation` value possible for the visuals you're trying to achieve. +A value of ``0.0`` smoothly attenuates light at the edge of the range. A value of ``1.0`` approaches a physical lighting model. A value of ``0.5`` approximates linear attenuation. + +\ **Note:** Setting it to ``1.0`` may result in distant objects receiving minimal light, even within range. For example, with a range of ``4096``, an object at ``100`` units receives less than ``0.1`` energy. + +\ **Note:** Using negative or values higher than ``10.0`` may lead to unexpected results. .. rst-class:: classref-item-separator diff --git a/classes/class_openxraction.rst b/classes/class_openxraction.rst index 13ca5faf08d..4f4d6add2b2 100644 --- a/classes/class_openxraction.rst +++ b/classes/class_openxraction.rst @@ -88,6 +88,10 @@ This action provides a :ref:`Vector2` value and can be bound to e :ref:`ActionType` **OPENXR_ACTION_POSE** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator diff --git a/classes/class_openxrapiextension.rst b/classes/class_openxrapiextension.rst index c64796c9677..4cc40a9e87d 100644 --- a/classes/class_openxrapiextension.rst +++ b/classes/class_openxrapiextension.rst @@ -50,35 +50,82 @@ Methods .. table:: :widths: auto - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`can_render` **(** **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_error_string` **(** :ref:`int` result **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_instance` **(** **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_instance_proc_addr` **(** :ref:`String` name **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_next_frame_time` **(** **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_play_space` **(** **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_session` **(** **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`String` | :ref:`get_swapchain_format_name` **(** :ref:`int` swapchain_format **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_system_id` **(** **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_initialized` **(** **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_running` **(** **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`openxr_is_enabled` **(** :ref:`bool` check_run_in_editor **)** |static| | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Transform3D` | :ref:`transform_from_pose` **(** const void* pose **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`xr_result` **(** :ref:`int` result, :ref:`String` format, :ref:`Array` args **)** | - +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`can_render` **(** **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_error_string` **(** :ref:`int` result **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_instance` **(** **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_instance_proc_addr` **(** :ref:`String` name **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_next_frame_time` **(** **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_play_space` **(** **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_session` **(** **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_swapchain_format_name` **(** :ref:`int` swapchain_format **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_system_id` **(** **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`OpenXRAlphaBlendModeSupport` | :ref:`is_environment_blend_mode_alpha_supported` **(** **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_initialized` **(** **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_running` **(** **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`openxr_is_enabled` **(** :ref:`bool` check_run_in_editor **)** |static| | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`register_composition_layer_provider` **(** :ref:`OpenXRExtensionWrapperExtension` extension **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_emulate_environment_blend_mode_alpha_blend` **(** :ref:`bool` enabled **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform3D` | :ref:`transform_from_pose` **(** const void* pose **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`unregister_composition_layer_provider` **(** :ref:`OpenXRExtensionWrapperExtension` extension **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`xr_result` **(** :ref:`int` result, :ref:`String` format, :ref:`Array` args **)** | + +-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Enumerations +------------ + +.. _enum_OpenXRAPIExtension_OpenXRAlphaBlendModeSupport: + +.. rst-class:: classref-enumeration + +enum **OpenXRAlphaBlendModeSupport**: + +.. _class_OpenXRAPIExtension_constant_OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE: + +.. rst-class:: classref-enumeration-constant + +:ref:`OpenXRAlphaBlendModeSupport` **OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE** = ``0`` + +Means that :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND` isn't supported at all. + +.. _class_OpenXRAPIExtension_constant_OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL: + +.. rst-class:: classref-enumeration-constant + +:ref:`OpenXRAlphaBlendModeSupport` **OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL** = ``1`` + +Means that :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND` is really supported. + +.. _class_OpenXRAPIExtension_constant_OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING: + +.. rst-class:: classref-enumeration-constant + +:ref:`OpenXRAlphaBlendModeSupport` **OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING** = ``2`` + +Means that :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND` is emulated. .. rst-class:: classref-section-separator @@ -199,6 +246,18 @@ Returns the id of the system, which is a `XrSystemId ` **is_environment_blend_mode_alpha_supported** **(** **)** + +Returns :ref:`OpenXRAlphaBlendModeSupport` denoting if :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND` is really support, emulated or not supported at all. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRAPIExtension_method_is_initialized: .. rst-class:: classref-method @@ -235,6 +294,30 @@ Returns ``true`` if OpenXR is enabled. ---- +.. _class_OpenXRAPIExtension_method_register_composition_layer_provider: + +.. rst-class:: classref-method + +void **register_composition_layer_provider** **(** :ref:`OpenXRExtensionWrapperExtension` extension **)** + +Registers the given extension as a composition layer provider. + +.. rst-class:: classref-item-separator + +---- + +.. _class_OpenXRAPIExtension_method_set_emulate_environment_blend_mode_alpha_blend: + +.. rst-class:: classref-method + +void **set_emulate_environment_blend_mode_alpha_blend** **(** :ref:`bool` enabled **)** + +If set to ``true``, an OpenXR extension is loaded which is capable of emulating the :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND` blend mode. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRAPIExtension_method_transform_from_pose: .. rst-class:: classref-method @@ -247,6 +330,18 @@ Creates a :ref:`Transform3D` from an `XrPosef ` extension **)** + +Unregisters the given extension as a composition layer provider. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRAPIExtension_method_xr_result: .. rst-class:: classref-method diff --git a/classes/class_openxrextensionwrapperextension.rst b/classes/class_openxrextensionwrapperextension.rst index 4fea0976f64..bf2a14f8a71 100644 --- a/classes/class_openxrextensionwrapperextension.rst +++ b/classes/class_openxrextensionwrapperextension.rst @@ -29,55 +29,59 @@ Methods .. table:: :widths: auto - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Dictionary` | :ref:`_get_requested_extensions` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_before_instance_created` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`_on_event_polled` **(** const void* event **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_instance_created` **(** :ref:`int` instance **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_instance_destroyed` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_pre_render` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_process` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_register_metadata` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_session_created` **(** :ref:`int` session **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_session_destroyed` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_state_exiting` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_state_focused` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_state_idle` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_state_loss_pending` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_state_ready` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_state_stopping` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_state_synchronized` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_on_state_visible` **(** **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`_set_instance_create_info_and_get_next_pointer` **(** void* next_pointer **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`_set_session_create_and_get_next_pointer` **(** void* next_pointer **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`_set_swapchain_create_info_and_get_next_pointer` **(** void* next_pointer **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`_set_system_properties_and_get_next_pointer` **(** void* next_pointer **)** |virtual| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`OpenXRAPIExtension` | :ref:`get_openxr_api` **(** **)** | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`register_extension_wrapper` **(** **)** | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`_get_composition_layer` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Dictionary` | :ref:`_get_requested_extensions` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_before_instance_created` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`_on_event_polled` **(** const void* event **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_instance_created` **(** :ref:`int` instance **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_instance_destroyed` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_pre_render` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_process` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_register_metadata` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_session_created` **(** :ref:`int` session **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_session_destroyed` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_state_exiting` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_state_focused` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_state_idle` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_state_loss_pending` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_state_ready` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_state_stopping` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_state_synchronized` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_on_state_visible` **(** **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`_set_hand_joint_locations_and_get_next_pointer` **(** :ref:`int` hand_index, void* next_pointer **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`_set_instance_create_info_and_get_next_pointer` **(** void* next_pointer **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`_set_session_create_and_get_next_pointer` **(** void* next_pointer **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`_set_swapchain_create_info_and_get_next_pointer` **(** void* next_pointer **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`_set_system_properties_and_get_next_pointer` **(** void* next_pointer **)** |virtual| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`OpenXRAPIExtension` | :ref:`get_openxr_api` **(** **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`register_extension_wrapper` **(** **)** | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -88,6 +92,18 @@ Methods Method Descriptions ------------------- +.. _class_OpenXRExtensionWrapperExtension_private_method__get_composition_layer: + +.. rst-class:: classref-method + +:ref:`int` **_get_composition_layer** **(** **)** |virtual| + +Returns a pointer to a ``XrCompositionLayerBaseHeader`` struct to provide a composition layer. This will only be called if the extension previously registered itself with :ref:`OpenXRAPIExtension.register_composition_layer_provider`. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRExtensionWrapperExtension_private_method__get_requested_extensions: .. rst-class:: classref-method @@ -310,6 +326,18 @@ Called when the OpenXR session state is changed to visible. This means OpenXR is ---- +.. _class_OpenXRExtensionWrapperExtension_private_method__set_hand_joint_locations_and_get_next_pointer: + +.. rst-class:: classref-method + +:ref:`int` **_set_hand_joint_locations_and_get_next_pointer** **(** :ref:`int` hand_index, void* next_pointer **)** |virtual| + +Adds additional data structures when each hand tracker is created. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRExtensionWrapperExtension_private_method__set_instance_create_info_and_get_next_pointer: .. rst-class:: classref-method diff --git a/classes/class_openxrhand.rst b/classes/class_openxrhand.rst index 3c06b4f0911..bc517de1e75 100644 --- a/classes/class_openxrhand.rst +++ b/classes/class_openxrhand.rst @@ -12,14 +12,20 @@ OpenXRHand **Inherits:** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` -Node supporting finger tracking in OpenXR. +Node supporting hand and finger tracking in OpenXR. .. rst-class:: classref-introduction-group Description ----------- -This node enables OpenXR's hand tracking functionality. The node should be a child node of an :ref:`XROrigin3D` node, tracking will update its position to where the player's actual hand is positioned. This node also updates the skeleton of a properly skinned hand model. The hand mesh should be a child node of this node. +This node enables OpenXR's hand tracking functionality. The node should be a child node of an :ref:`XROrigin3D` node, tracking will update its position to the player's tracked hand Palm joint location (the center of the middle finger's metacarpal bone). This node also updates the skeleton of a properly skinned hand or avatar model. + +If the skeleton is a hand (one of the hand bones is the root node of the skeleton), then the skeleton will be placed relative to the hand palm location and the hand mesh and skeleton should be children of the OpenXRHand node. + +If the hand bones are part of a full skeleton, then the root of the hand will keep its location with the assumption that IK is used to position the hand and arm. + +By default the skeleton hand bones are repositioned to match the size of the tracked hand. To preserve the modeled bone sizes change :ref:`bone_update` to apply rotation only. .. rst-class:: classref-reftable-group @@ -29,6 +35,8 @@ Properties .. table:: :widths: auto + +-------------------------------------------------+---------------------------------------------------------------+------------------+ + | :ref:`BoneUpdate` | :ref:`bone_update` | ``0`` | +-------------------------------------------------+---------------------------------------------------------------+------------------+ | :ref:`Hands` | :ref:`hand` | ``0`` | +-------------------------------------------------+---------------------------------------------------------------+------------------+ @@ -36,6 +44,8 @@ Properties +-------------------------------------------------+---------------------------------------------------------------+------------------+ | :ref:`MotionRange` | :ref:`motion_range` | ``0`` | +-------------------------------------------------+---------------------------------------------------------------+------------------+ + | :ref:`SkeletonRig` | :ref:`skeleton_rig` | ``0`` | + +-------------------------------------------------+---------------------------------------------------------------+------------------+ .. rst-class:: classref-section-separator @@ -110,6 +120,74 @@ When player grips, hand skeleton conforms to the controller the player is holdin Maximum supported motion ranges. +.. rst-class:: classref-item-separator + +---- + +.. _enum_OpenXRHand_SkeletonRig: + +.. rst-class:: classref-enumeration + +enum **SkeletonRig**: + +.. _class_OpenXRHand_constant_SKELETON_RIG_OPENXR: + +.. rst-class:: classref-enumeration-constant + +:ref:`SkeletonRig` **SKELETON_RIG_OPENXR** = ``0`` + +An OpenXR compliant skeleton. + +.. _class_OpenXRHand_constant_SKELETON_RIG_HUMANOID: + +.. rst-class:: classref-enumeration-constant + +:ref:`SkeletonRig` **SKELETON_RIG_HUMANOID** = ``1`` + +A :ref:`SkeletonProfileHumanoid` compliant skeleton. + +.. _class_OpenXRHand_constant_SKELETON_RIG_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`SkeletonRig` **SKELETON_RIG_MAX** = ``2`` + +Maximum supported hands. + +.. rst-class:: classref-item-separator + +---- + +.. _enum_OpenXRHand_BoneUpdate: + +.. rst-class:: classref-enumeration + +enum **BoneUpdate**: + +.. _class_OpenXRHand_constant_BONE_UPDATE_FULL: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneUpdate` **BONE_UPDATE_FULL** = ``0`` + +The skeletons bones are fully updated (both position and rotation) to match the tracked bones. + +.. _class_OpenXRHand_constant_BONE_UPDATE_ROTATION_ONLY: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneUpdate` **BONE_UPDATE_ROTATION_ONLY** = ``1`` + +The skeletons bones are only rotated to align with the tracked bones, preserving bone length. + +.. _class_OpenXRHand_constant_BONE_UPDATE_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`BoneUpdate` **BONE_UPDATE_MAX** = ``2`` + +Maximum supported bone update mode. + .. rst-class:: classref-section-separator ---- @@ -119,6 +197,23 @@ Maximum supported motion ranges. Property Descriptions --------------------- +.. _class_OpenXRHand_property_bone_update: + +.. rst-class:: classref-property + +:ref:`BoneUpdate` **bone_update** = ``0`` + +.. rst-class:: classref-property-setget + +- void **set_bone_update** **(** :ref:`BoneUpdate` value **)** +- :ref:`BoneUpdate` **get_bone_update** **(** **)** + +Specify the type of updates to perform on the bone. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRHand_property_hand: .. rst-class:: classref-property @@ -166,6 +261,23 @@ Set a :ref:`Skeleton3D` node for which the pose positions will Set the motion range (if supported) limiting the hand motion. +.. rst-class:: classref-item-separator + +---- + +.. _class_OpenXRHand_property_skeleton_rig: + +.. rst-class:: classref-property + +:ref:`SkeletonRig` **skeleton_rig** = ``0`` + +.. rst-class:: classref-property-setget + +- void **set_skeleton_rig** **(** :ref:`SkeletonRig` value **)** +- :ref:`SkeletonRig` **get_skeleton_rig** **(** **)** + +Set the type of skeleton rig the :ref:`hand_skeleton` is compliant 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_openxrinterface.rst b/classes/class_openxrinterface.rst index d9284235c41..4bce1b673d1 100644 --- a/classes/class_openxrinterface.rst +++ b/classes/class_openxrinterface.rst @@ -73,6 +73,8 @@ Methods +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quaternion` | :ref:`get_hand_joint_rotation` **(** :ref:`Hand` hand, :ref:`HandJoints` joint **)** |const| | +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`HandTrackedSource` | :ref:`get_hand_tracking_source` **(** :ref:`Hand` hand **)** |const| | + +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`HandMotionRange` | :ref:`get_motion_range` **(** :ref:`Hand` hand **)** |const| | +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_action_set_active` **(** :ref:`String` name **)** |const| | @@ -208,7 +210,7 @@ enum **HandMotionRange**: :ref:`HandMotionRange` **HAND_MOTION_RANGE_UNOBSTRUCTED** = ``0`` - +Full hand range, if user closes their hands, we make a full fist. .. _class_OpenXRInterface_constant_HAND_MOTION_RANGE_CONFORM_TO_CONTROLLER: @@ -216,7 +218,7 @@ enum **HandMotionRange**: :ref:`HandMotionRange` **HAND_MOTION_RANGE_CONFORM_TO_CONTROLLER** = ``1`` - +Conform to controller, if user closes their hands, the tracked data conforms to the shape of the controller. .. _class_OpenXRInterface_constant_HAND_MOTION_RANGE_MAX: @@ -224,7 +226,49 @@ enum **HandMotionRange**: :ref:`HandMotionRange` **HAND_MOTION_RANGE_MAX** = ``2`` +Maximum value for the motion range enum. + +.. rst-class:: classref-item-separator + +---- + +.. _enum_OpenXRInterface_HandTrackedSource: + +.. rst-class:: classref-enumeration + +enum **HandTrackedSource**: + +.. _class_OpenXRInterface_constant_HAND_TRACKED_SOURCE_UNKNOWN: + +.. rst-class:: classref-enumeration-constant + +:ref:`HandTrackedSource` **HAND_TRACKED_SOURCE_UNKNOWN** = ``0`` + +The source of hand tracking data is unknown (the extension is likely unsupported). + +.. _class_OpenXRInterface_constant_HAND_TRACKED_SOURCE_UNOBSTRUCTED: + +.. rst-class:: classref-enumeration-constant + +:ref:`HandTrackedSource` **HAND_TRACKED_SOURCE_UNOBSTRUCTED** = ``1`` + +The source of hand tracking is unobstructed, this means that an accurate method of hand tracking is used, e.g. optical hand tracking, data gloves, etc. +.. _class_OpenXRInterface_constant_HAND_TRACKED_SOURCE_CONTROLLER: + +.. rst-class:: classref-enumeration-constant + +:ref:`HandTrackedSource` **HAND_TRACKED_SOURCE_CONTROLLER** = ``2`` + +The source of hand tracking is a controller, bone positions are inferred from controller inputs. + +.. _class_OpenXRInterface_constant_HAND_TRACKED_SOURCE_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`HandTrackedSource` **HAND_TRACKED_SOURCE_MAX** = ``3`` + +Maximum value for the hand tracked source enum. .. rst-class:: classref-item-separator @@ -557,6 +601,8 @@ The display refresh rate for the current HMD. Only functional if this feature is Enable dynamic foveation adjustment, the interface must be initialized before this is accessible. If enabled foveation will automatically adjusted between low and :ref:`foveation_level`. +\ **Note:** Only works on compatibility renderer. + .. rst-class:: classref-item-separator ---- @@ -574,6 +620,8 @@ Enable dynamic foveation adjustment, the interface must be initialized before th Set foveation level from 0 (off) to 3 (high), the interface must be initialized before this is accessible. +\ **Note:** Only works on compatibility renderer. + .. rst-class:: classref-item-separator ---- @@ -696,6 +744,18 @@ If handtracking is enabled, returns the rotation of a joint (``joint``) of a han ---- +.. _class_OpenXRInterface_method_get_hand_tracking_source: + +.. rst-class:: classref-method + +:ref:`HandTrackedSource` **get_hand_tracking_source** **(** :ref:`Hand` hand **)** |const| + +If handtracking is enabled and hand tracking source is supported, gets the source of the hand tracking data for ``hand``. + +.. rst-class:: classref-item-separator + +---- + .. _class_OpenXRInterface_method_get_motion_range: .. rst-class:: classref-method diff --git a/classes/class_os.rst b/classes/class_os.rst index dd1a56e7484..cacf9e95a75 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -19,9 +19,9 @@ Provides access to common operating system functionalities. Description ----------- -This class wraps the most common functionalities for communicating with the host operating system, such as the video driver, delays, environment variables, execution of binaries, command line, etc. +The **OS** class wraps the most common functionalities for communicating with the host operating system, such as the video driver, delays, environment variables, execution of binaries, command line, etc. -\ **Note:** In Godot 4, **OS** functions related to window management were moved to the :ref:`DisplayServer` singleton. +\ **Note:** In Godot 4, **OS** functions related to window management, clipboard, and TTS were moved to the :ref:`DisplayServer` singleton (and the :ref:`Window` class). Functions related to time were removed and are only available in the :ref:`Time` class. .. rst-class:: classref-introduction-group @@ -215,6 +215,14 @@ The Vulkan rendering driver. It requires Vulkan 1.0 support and automatically us The OpenGL 3 rendering driver. It uses OpenGL 3.3 Core Profile on desktop platforms, OpenGL ES 3.0 on mobile devices, and WebGL 2.0 on Web. +.. _class_OS_constant_RENDERING_DRIVER_D3D12: + +.. rst-class:: classref-enumeration-constant + +:ref:`RenderingDriver` **RENDERING_DRIVER_D3D12** = ``2`` + +The Direct3D 12 rendering driver. + .. rst-class:: classref-item-separator ---- @@ -231,7 +239,7 @@ enum **SystemDir**: :ref:`SystemDir` **SYSTEM_DIR_DESKTOP** = ``0`` -Desktop directory path. +Refers to the Desktop directory path. .. _class_OS_constant_SYSTEM_DIR_DCIM: @@ -239,7 +247,7 @@ Desktop directory path. :ref:`SystemDir` **SYSTEM_DIR_DCIM** = ``1`` -DCIM (Digital Camera Images) directory path. +Refers to the DCIM (Digital Camera Images) directory path. .. _class_OS_constant_SYSTEM_DIR_DOCUMENTS: @@ -247,7 +255,7 @@ DCIM (Digital Camera Images) directory path. :ref:`SystemDir` **SYSTEM_DIR_DOCUMENTS** = ``2`` -Documents directory path. +Refers to the Documents directory path. .. _class_OS_constant_SYSTEM_DIR_DOWNLOADS: @@ -255,7 +263,7 @@ Documents directory path. :ref:`SystemDir` **SYSTEM_DIR_DOWNLOADS** = ``3`` -Downloads directory path. +Refers to the Downloads directory path. .. _class_OS_constant_SYSTEM_DIR_MOVIES: @@ -263,7 +271,7 @@ Downloads directory path. :ref:`SystemDir` **SYSTEM_DIR_MOVIES** = ``4`` -Movies directory path. +Refers to the Movies (or Videos) directory path. .. _class_OS_constant_SYSTEM_DIR_MUSIC: @@ -271,7 +279,7 @@ Movies directory path. :ref:`SystemDir` **SYSTEM_DIR_MUSIC** = ``5`` -Music directory path. +Refers to the Music directory path. .. _class_OS_constant_SYSTEM_DIR_PICTURES: @@ -279,7 +287,7 @@ Music directory path. :ref:`SystemDir` **SYSTEM_DIR_PICTURES** = ``6`` -Pictures directory path. +Refers to the Pictures directory path. .. _class_OS_constant_SYSTEM_DIR_RINGTONES: @@ -287,7 +295,7 @@ Pictures directory path. :ref:`SystemDir` **SYSTEM_DIR_RINGTONES** = ``7`` -Ringtones directory path. +Refers to the Ringtones directory path. .. rst-class:: classref-section-separator @@ -309,7 +317,9 @@ Property Descriptions - void **set_delta_smoothing** **(** :ref:`bool` value **)** - :ref:`bool` **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. +If ``true``, the engine filters the time delta measured between each frame, and attempts to compensate for random variation. This only works on systems where V-Sync is active. + +\ **Note:** On start-up, this is the same as :ref:`ProjectSettings.application/run/delta_smoothing`. .. rst-class:: classref-item-separator @@ -328,6 +338,8 @@ If ``true``, the engine filters the time delta measured between each frame, and If ``true``, the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile. +\ **Note:** On start-up, this is the same as :ref:`ProjectSettings.application/run/low_processor_mode`. + .. rst-class:: classref-item-separator ---- @@ -343,7 +355,9 @@ If ``true``, the engine optimizes for low processor usage by only refreshing the - void **set_low_processor_usage_mode_sleep_usec** **(** :ref:`int` value **)** - :ref:`int` **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. +The amount of sleeping between frames when the low-processor usage mode is enabled, in microseconds. Higher values will result in lower CPU usage. See also :ref:`low_processor_usage_mode`. + +\ **Note:** On start-up, this is the same as :ref:`ProjectSettings.application/run/low_processor_mode_sleep_usec`. .. rst-class:: classref-section-separator @@ -360,7 +374,7 @@ Method Descriptions 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. +Displays a modal dialog box using the host platform's implementation. The engine execution is blocked until the dialog is closed. .. rst-class:: classref-item-separator @@ -372,7 +386,7 @@ Displays a modal dialog box using the host OS' facilities. Execution is blocked void **close_midi_inputs** **(** **)** -Shuts down system MIDI driver. +Shuts down the system MIDI driver. Godot will no longer receive :ref:`InputEventMIDI`. See also :ref:`open_midi_inputs` and :ref:`get_connected_midi_inputs`. \ **Note:** This method is implemented on Linux, macOS and Windows. @@ -386,7 +400,9 @@ Shuts down system MIDI driver. void **crash** **(** :ref:`String` message **)** -Crashes the engine (or the editor if called within a ``@tool`` script). This should *only* be used for testing the system's crash handler, not for any other purpose. For general error reporting, use (in order of preference) :ref:`@GDScript.assert`, :ref:`@GlobalScope.push_error` or :ref:`alert`. See also :ref:`kill`. +Crashes the engine (or the editor if called within a ``@tool`` script). See also :ref:`kill`. + +\ **Note:** This method should *only* be used for testing the system's crash handler, not for any other purpose. For general error reporting, use (in order of preference) :ref:`@GDScript.assert`, :ref:`@GlobalScope.push_error`, or :ref:`alert`. .. rst-class:: classref-item-separator @@ -400,9 +416,11 @@ Crashes the engine (or the editor if called within a ``@tool`` script). This sho Creates a new instance of Godot that runs independently. The ``arguments`` are used in the given order and separated by a space. -If the process creation succeeds, the method will return the new process ID, which you can use to monitor the process (and potentially terminate it with :ref:`kill`). If the process creation fails, the method will return ``-1``. +If the process is successfully created, the method will return the new process ID, which you can use to monitor the process (and potentially terminate it with :ref:`kill`). If the process cannot be created, the method will return ``-1``. -\ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. +See :ref:`create_process` if you wish to run a different process. + +\ **Note:** This method is implemented on Android, Linux, macOS and Windows. .. rst-class:: classref-item-separator @@ -414,11 +432,11 @@ If the process creation succeeds, the method will return the new process ID, whi :ref:`int` **create_process** **(** :ref:`String` path, :ref:`PackedStringArray` arguments, :ref:`bool` open_console=false **)** -Creates a new process that runs independently of Godot. It will not terminate if Godot terminates. The path specified in ``path`` must exist and be executable file or macOS .app bundle. Platform path resolution will be used. The ``arguments`` are used in the given order and separated by a space. +Creates a new process that runs independently of Godot. It will not terminate when Godot terminates. The path specified in ``path`` must exist and be executable file or macOS .app bundle. Platform path resolution will be used. The ``arguments`` are used in the given order and separated by a space. -On Windows, if ``open_console`` is ``true`` and the process is a console app, a new terminal window will be opened. This is ignored on other platforms. +On Windows, if ``open_console`` is ``true`` and the process is a console app, a new terminal window will be opened. -If the process creation succeeds, the method will return the new process ID, which you can use to monitor the process (and potentially terminate it with :ref:`kill`). If the process creation fails, the method will return ``-1``. +If the process is successfully created, this method returns its process ID, which you can use to monitor the process (and potentially terminate it with :ref:`kill`). Otherwise this method returns ``-1``. For example, running another instance of the project: @@ -451,9 +469,9 @@ See :ref:`execute` if you wish to run an external comma 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. +Delays execution of the current thread by ``msec`` milliseconds. ``msec`` must be greater than or equal to ``0``. Otherwise, :ref:`delay_msec` does nothing and prints 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`. Awaiting with :ref:`SceneTree.create_timer` will delay the execution of code placed below the ``await`` without affecting the rest of the project (or editor, for :ref:`EditorPlugin`\ s and :ref:`EditorScript`\ s). +\ **Note:** :ref:`delay_msec` is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, you may use :ref:`SceneTree.create_timer`. Awaiting with :ref:`SceneTreeTimer` delays the execution of code placed below the ``await`` 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). @@ -467,9 +485,9 @@ Delays execution of the current thread by ``msec`` milliseconds. ``msec`` must b 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. +Delays execution of the current thread by ``usec`` microseconds. ``usec`` must be greater than or equal to ``0``. Otherwise, :ref:`delay_usec` does nothing and prints 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`. Awaiting with :ref:`SceneTree.create_timer` will delay the execution of code placed below the ``await`` without affecting the rest of the project (or editor, for :ref:`EditorPlugin`\ s and :ref:`EditorScript`\ s). +\ **Note:** :ref:`delay_usec` is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, you may use :ref:`SceneTree.create_timer`. Awaiting with a :ref:`SceneTreeTimer` delays the execution of code placed below the ``await`` 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). @@ -483,13 +501,15 @@ Delays execution of the current thread by ``usec`` microseconds. ``usec`` must b :ref:`int` **execute** **(** :ref:`String` path, :ref:`PackedStringArray` arguments, :ref:`Array` output=[], :ref:`bool` read_stderr=false, :ref:`bool` open_console=false **)** -Executes a command. The file specified in ``path`` must exist and be executable. Platform path resolution will be used. The ``arguments`` are used in the given order, separated by spaces, and wrapped in quotes. If an ``output`` :ref:`Array` is provided, the complete shell output of the process will be appended as a single :ref:`String` element in ``output``. If ``read_stderr`` is ``true``, the output to the standard error stream will be included too. +Executes the given process in a *blocking* way. The file specified in ``path`` must exist and be executable. The system path resolution will be used. The ``arguments`` are used in the given order, separated by spaces, and wrapped in quotes. + +If an ``output`` array is provided, the complete shell output of the process is appended to ``output`` as a single :ref:`String` element. If ``read_stderr`` is ``true``, the output to the standard error stream is also appended to the array. -On Windows, if ``open_console`` is ``true`` and the process is a console app, a new terminal window will be opened. This is ignored on other platforms. +On Windows, if ``open_console`` is ``true`` and the process is a console app, a new terminal window is opened. -If the command is successfully executed, the method will return the exit code of the command, or ``-1`` if it fails. +This method returns the exit code of the command, or ``-1`` if the process fails to execute. -\ **Note:** The Godot thread will pause its execution until the executed command terminates. Use :ref:`Thread` to create a separate thread that will not pause the Godot thread, or use :ref:`create_process` to create a completely independent process. +\ **Note:** The main thread will be blocked until the executed command terminates. Use :ref:`Thread` to create a separate thread that will not block the main thread, or use :ref:`create_process` to create a completely independent process. For example, to retrieve a list of the working directory's contents: @@ -535,6 +555,8 @@ If you wish to access a shell built-in or execute a composite command, a platfor \ **Note:** On macOS, sandboxed applications are limited to run only embedded helper executables, specified during export. +\ **Note:** On Android, system commands such as ``dumpsys`` can only be run on a rooted device. + .. rst-class:: classref-item-separator ---- @@ -545,7 +567,28 @@ If you wish to access a shell built-in or execute a composite command, a platfor :ref:`Key` **find_keycode_from_string** **(** :ref:`String` string **)** |const| -Returns the keycode of the given string (e.g. "Escape"). +Finds the keycode for the given string. The returned values are equivalent to the :ref:`Key` constants. + + +.. tabs:: + + .. code-tab:: gdscript + + print(OS.find_keycode_from_string("C")) # Prints 67 (KEY_C) + print(OS.find_keycode_from_string("Escape")) # Prints 4194305 (KEY_ESCAPE) + print(OS.find_keycode_from_string("Shift+Tab")) # Prints 37748738 (KEY_MASK_SHIFT | KEY_TAB) + print(OS.find_keycode_from_string("Unknown")) # Prints 0 (KEY_NONE) + + .. code-tab:: csharp + + GD.Print(OS.FindKeycodeFromString("C")); // Prints C (Key.C) + GD.Print(OS.FindKeycodeFromString("Escape")); // Prints Escape (Key.Escape) + GD.Print(OS.FindKeycodeFromString("Shift+Tab")); // Prints 37748738 (KeyModifierMask.MaskShift | Key.Tab) + GD.Print(OS.FindKeycodeFromString("Unknown")); // Prints None (Key.None) + + + +See also :ref:`get_keycode_string`. .. rst-class:: classref-item-separator @@ -557,7 +600,9 @@ Returns the keycode of the given string (e.g. "Escape"). :ref:`String` **get_cache_dir** **(** **)** |const| -Returns the *global* cache data directory according to the operating system's standards. On the Linux/BSD platform, this path can be overridden by setting the ``XDG_CACHE_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_config_dir` and :ref:`get_data_dir`. +Returns the *global* cache data directory according to the operating system's standards. + +On the Linux/BSD platform, this path can be overridden by setting the ``XDG_CACHE_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` 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. @@ -579,7 +624,7 @@ You can also incorporate environment variables using the :ref:`get_environment` 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: +Here's a minimal example on how to parse command-line arguments into a :ref:`Dictionary` using the ``--key=value`` form for arguments: .. tabs:: @@ -588,7 +633,7 @@ Here's a minimal example on how to parse command-line arguments into a dictionar var arguments = {} for argument in OS.get_cmdline_args(): - if argument.find("=") > -1: + if argument.contains("="): var key_value = argument.split("=") arguments[key_value[0].lstrip("--")] = key_value[1] else: @@ -601,7 +646,7 @@ Here's a minimal example on how to parse command-line arguments into a dictionar var arguments = new Godot.Collections.Dictionary(); foreach (var argument in OS.GetCmdlineArgs()) { - if (argument.Find("=") > -1) + if (argument.Contains('=')) { string[] keyValue = argument.Split("="); arguments[keyValue[0].LStrip("--")] = keyValue[1]; @@ -616,7 +661,7 @@ Here's a minimal example on how to parse command-line arguments into a dictionar -\ **Note:** Passing custom user arguments directly is not recommended, as the engine may discard or modify them. Instead, the best way is to use the standard UNIX double dash (``--``) and then pass custom arguments, which the engine itself will ignore. These can be read via :ref:`get_cmdline_user_args`. +\ **Note:** Passing custom user arguments directly is not recommended, as the engine may discard or modify them. Instead, pass the standard UNIX double dash (``--``) and then the custom arguments, which the engine will ignore by design. These can be read via :ref:`get_cmdline_user_args`. .. rst-class:: classref-item-separator @@ -628,15 +673,17 @@ Here's a minimal example on how to parse command-line arguments into a dictionar :ref:`PackedStringArray` **get_cmdline_user_args** **(** **)** -Similar to :ref:`get_cmdline_args`, but this returns the user arguments (any argument passed after the double dash ``--`` or double plus ``++`` argument). These are left untouched by Godot for the user. ``++`` can be used in situations where ``--`` is intercepted by another program (such as ``startx``). - -For example, in the command line below, ``--fullscreen`` will not be returned in :ref:`get_cmdline_user_args` and ``--level 1`` will only be returned in :ref:`get_cmdline_user_args`: +Returns the command-line user arguments passed to the engine. User arguments are ignored by the engine and reserved for the user. They are passed after the double dash ``--`` argument. ``++`` may be used when ``--`` is intercepted by another program (such as ``startx``). :: - godot --fullscreen -- --level 1 - # Or: - godot --fullscreen ++ --level 1 + # Godot has been executed with the following command: + # godot --fullscreen -- --level=2 --hardcore + + OS.get_cmdline_args() # Returns ["--fullscreen", "--level=2", "--hardcore"] + OS.get_cmdline_user_args() # Returns ["--level=2", "--hardcore"] + +To get all passed arguments, use :ref:`get_cmdline_args`. .. rst-class:: classref-item-separator @@ -648,7 +695,9 @@ For example, in the command line below, ``--fullscreen`` will not be returned in :ref:`String` **get_config_dir** **(** **)** |const| -Returns the *global* user configuration directory according to the operating system's standards. On the Linux/BSD platform, this path can be overridden by setting the ``XDG_CONFIG_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir` and :ref:`get_data_dir`. +Returns the *global* user configuration directory according to the operating system's standards. + +On the Linux/BSD platform, this path can be overridden by setting the ``XDG_CONFIG_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` 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. @@ -662,9 +711,7 @@ Not to be confused with :ref:`get_user_data_dir` **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 initialized with :ref:`open_midi_inputs`. +Returns an array of connected MIDI device names, if they exist. Returns an empty array if the system MIDI driver has not previously been initialized with :ref:`open_midi_inputs`. See also :ref:`close_midi_inputs`. \ **Note:** This method is implemented on Linux, macOS and Windows. @@ -678,7 +725,9 @@ The returned array will be empty if the system MIDI driver has not previously be :ref:`String` **get_data_dir** **(** **)** |const| -Returns the *global* user data directory according to the operating system's standards. On the Linux/BSD platform, this path can be overridden by setting the ``XDG_DATA_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir` and :ref:`get_config_dir`. +Returns the *global* user data directory according to the operating system's standards. + +On the Linux/BSD platform, this path can be overridden by setting the ``XDG_DATA_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` 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. @@ -692,13 +741,13 @@ Not to be confused with :ref:`get_user_data_dir` **get_distribution_name** **(** **)** |const| -Returns the name of the distribution for Linux and BSD platforms (e.g. Ubuntu, Manjaro, OpenBSD, etc.). +Returns the name of the distribution for Linux and BSD platforms (e.g. "Ubuntu", "Manjaro", "OpenBSD", etc.). -Returns the same value as :ref:`get_name` for stock Android ROMs, but attempts to return the custom ROM name for popular Android derivatives such as LineageOS. +Returns the same value as :ref:`get_name` for stock Android ROMs, but attempts to return the custom ROM name for popular Android derivatives such as "LineageOS". Returns the same value as :ref:`get_name` for other platforms. -\ **Note:** This method is not supported on the web platform. It returns an empty string. +\ **Note:** This method is not supported on the Web platform. It returns an empty string. .. rst-class:: classref-item-separator @@ -710,10 +759,12 @@ Returns the same value as :ref:`get_name` for other pl :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. +Returns the value of the given environment variable, or an empty string if ``variable`` doesn't exist. \ **Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows. +\ **Note:** On macOS, applications do not have access to shell environment variables. + .. rst-class:: classref-item-separator ---- @@ -724,7 +775,7 @@ Returns the value of an environment variable. Returns an empty string if the env :ref:`String` **get_executable_path** **(** **)** |const| -Returns the path to the current engine executable. +Returns the file path to the current engine executable. \ **Note:** On macOS, always use :ref:`create_instance` instead of relying on executable path. @@ -738,9 +789,9 @@ Returns the path to the current engine executable. :ref:`PackedStringArray` **get_granted_permissions** **(** **)** |const| -On Android devices: With this function, you can get the list of dangerous permissions that have been granted. +On Android devices: Returns the list of dangerous permissions that have been granted. -On macOS (sandboxed applications only): This function returns the list of user selected folders accessible to the application. Use native file dialog to request folder access permission. +On macOS: Returns the list of user selected folders accessible to the application (sandboxed applications only). Use the native file dialog to request folder access permission. .. rst-class:: classref-item-separator @@ -752,9 +803,26 @@ On macOS (sandboxed applications only): This function returns the list of user s :ref:`String` **get_keycode_string** **(** :ref:`Key` code **)** |const| -Returns the given keycode as a string (e.g. Return values: ``"Escape"``, ``"Shift+Escape"``). +Returns the given keycode as a :ref:`String`. -See also :ref:`InputEventKey.keycode` and :ref:`InputEventKey.get_keycode_with_modifiers`. + +.. tabs:: + + .. code-tab:: gdscript + + print(OS.get_keycode_string(KEY_C)) # Prints "C" + print(OS.get_keycode_string(KEY_ESCAPE)) # Prints "Escape" + print(OS.get_keycode_string(KEY_MASK_SHIFT | KEY_TAB)) # Prints "Shift+Tab" + + .. code-tab:: csharp + + GD.Print(OS.GetKeycodeString(Key.C)); // Prints "C" + GD.Print(OS.GetKeycodeString(Key.Escape)); // Prints "Escape" + GD.Print(OS.GetKeycodeString((Key)KeyModifierMask.MaskShift | Key.Tab)); // Prints "Shift+Tab" + + + +See also :ref:`find_keycode_from_string`, :ref:`InputEventKey.keycode`, and :ref:`InputEventKey.get_keycode_with_modifiers`. .. rst-class:: classref-item-separator @@ -766,17 +834,19 @@ See also :ref:`InputEventKey.keycode` and :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`. +Returns the host OS locale as a :ref:`String` of the form ``language_Script_COUNTRY_VARIANT@extra``. Every substring after ``language`` is optional and may not exist. + +- ``language`` - 2 or 3-letter `language code `__, in lower case. -\ ``language`` - 2 or 3-letter `language code `__, in lower case. +- ``Script`` - 4-letter `script code `__, in title case. -\ ``Script`` - optional, 4-letter `script code `__, in title case. +- ``COUNTRY`` - 2 or 3-letter `country code `__, in upper case. -\ ``COUNTRY`` - optional, 2 or 3-letter `country code `__, in upper case. +- ``VARIANT`` - language variant, region and sort order. The variant can have any number of underscored keywords. -\ ``VARIANT`` - optional, language variant, region and sort order. Variant can have any number of underscored keywords. +- ``extra`` - semicolon separated list of additional key words. This may include currency, calendar, sort order and numbering system information. -\ ``extra`` - optional, semicolon separated list of additional key words. Currency, calendar, sort order and numbering system information. +If you want only the language code and not the fully specified locale from the OS, you can use :ref:`get_locale_language`. .. rst-class:: classref-item-separator @@ -816,15 +886,17 @@ Returns the ID of the main thread. See :ref:`get_thread_caller_id` **get_memory_info** **(** **)** |const| -Returns the :ref:`Dictionary` with the following keys: +Returns a :ref:`Dictionary` containing information about the current memory with the following entries: -\ ``"physical"`` - total amount of usable physical memory, in bytes or ``-1`` if unknown. This value can be slightly less than the actual physical memory amount, since it does not include memory reserved by kernel and devices. +- ``"physical"`` - total amount of usable physical memory in bytes. This value can be slightly less than the actual physical memory amount, since it does not include memory reserved by the kernel and devices. -\ ``"free"`` - amount of physical memory, that can be immediately allocated without disk access or other costly operation, in bytes or ``-1`` if unknown. The process might be able to allocate more physical memory, but such allocation will require moving inactive pages to disk and can take some time. +- ``"free"`` - amount of physical memory, that can be immediately allocated without disk access or other costly operations, in bytes. The process might be able to allocate more physical memory, but this action will require moving inactive pages to disk, which can be expensive. -\ ``"available"`` - amount of memory, that can be allocated without extending the swap file(s), in bytes or ``-1`` if unknown. This value include both physical memory and swap. +- ``"available"`` - amount of memory that can be allocated without extending the swap file(s), in bytes. This value includes both physical memory and swap. -\ ``"stack"`` - size of the current thread stack, in bytes or ``-1`` if unknown. +- ``"stack"`` - size of the current thread stack in bytes. + +\ **Note:** Each entry's value may be ``-1`` if it is unknown. .. rst-class:: classref-item-separator @@ -850,23 +922,23 @@ Returns the model name of the current device. :ref:`String` **get_name** **(** **)** |const| -Returns the name of the host OS. +Returns the name of the host platform. -On Windows, this is ``"Windows"``. +- On Windows, this is ``"Windows"``. -On macOS, this is ``"macOS"``. +- On macOS, this is ``"macOS"``. -On Linux-based operating systems, this is ``"Linux"``. +- On Linux-based operating systems, this is ``"Linux"``. -On BSD-based operating systems, this is ``"FreeBSD"``, ``"NetBSD"``, ``"OpenBSD"``, or ``"BSD"`` as a fallback. +- On BSD-based operating systems, this is ``"FreeBSD"``, ``"NetBSD"``, ``"OpenBSD"``, or ``"BSD"`` as a fallback. -On Android, this is ``"Android"``. +- On Android, this is ``"Android"``. -On iOS, this is ``"iOS"``. +- On iOS, this is ``"iOS"``. -On the web, this is ``"Web"``. +- On the web, this is ``"Web"``. -\ **Note:** Custom builds of the engine may support additional platforms, such as consoles, yielding other return values. +\ **Note:** Custom builds of the engine may support additional platforms, such as consoles, possibly returning other names. .. tabs:: @@ -875,48 +947,50 @@ On the web, this is ``"Web"``. match OS.get_name(): "Windows": - print("Windows") + print("Welcome to Windows!") "macOS": - print("macOS") + print("Welcome to macOS!") "Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD": - print("Linux/BSD") + print("Welcome to Linux/BSD!") "Android": - print("Android") + print("Welcome to Android!") "iOS": - print("iOS") + print("Welcome to iOS!") "Web": - print("Web") + print("Welcome to the Web!") .. code-tab:: csharp switch (OS.GetName()) { case "Windows": - GD.Print("Windows"); + GD.Print("Welcome to Windows"); break; case "macOS": - GD.Print("macOS"); + GD.Print("Welcome to macOS!"); break; case "Linux": case "FreeBSD": case "NetBSD": case "OpenBSD": case "BSD": - GD.Print("Linux/BSD"); + GD.Print("Welcome to Linux/BSD!"); break; case "Android": - GD.Print("Android"); + GD.Print("Welcome to Android!"); break; case "iOS": - GD.Print("iOS"); + GD.Print("Welcome to iOS!"); break; case "Web": - GD.Print("Web"); + GD.Print("Welcome to the Web!"); break; } +\ **Note:** On Web platforms, it is still possible to determine the host platform's OS with feature tags. See :ref:`has_feature`. + .. rst-class:: classref-item-separator ---- @@ -927,7 +1001,7 @@ On the web, this is ``"Web"``. :ref:`int` **get_process_id** **(** **)** |const| -Returns the project's process ID. +Returns the number used by the host machine to uniquely identify this application. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. @@ -953,7 +1027,7 @@ Returns the number of *logical* CPU cores available on the host machine. On CPUs :ref:`String` **get_processor_name** **(** **)** |const| -Returns the name of the CPU model on the host machine (e.g. "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz"). +Returns the full name of the CPU model on the host machine (e.g. ``"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz"``). \ **Note:** This method is only implemented on Windows, macOS, Linux and iOS. On Android and Web, :ref:`get_processor_name` returns an empty string. @@ -979,7 +1053,7 @@ Returns the list of command line arguments that will be used when the project au :ref:`int` **get_static_memory_peak_usage** **(** **)** |const| -Returns the maximum amount of static memory used (only works in debug). +Returns the maximum amount of static memory used. Only works in debug builds. .. rst-class:: classref-item-separator @@ -991,7 +1065,7 @@ Returns the maximum amount of static memory used (only works in debug). :ref:`int` **get_static_memory_usage** **(** **)** |const| -Returns the amount of static memory being used by the program in bytes (only works in debug). +Returns the amount of static memory being used by the program in bytes. Only works in debug builds. .. rst-class:: classref-item-separator @@ -1003,11 +1077,11 @@ Returns the amount of static memory being used by the program in bytes (only wor :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`. +Returns the path to commonly used folders across different platforms, as defined by ``dir``. See the :ref:`SystemDir` constants for available locations. \ **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. +\ **Note:** Shared storage is implemented on Android and allows to differentiate between app specific and shared directories, if ``shared_storage`` is ``true``. Shared directories have additional restrictions on Android. .. rst-class:: classref-item-separator @@ -1019,7 +1093,7 @@ Returns the actual path to commonly used folders across different platforms. Ava :ref:`String` **get_system_font_path** **(** :ref:`String` font_name, :ref:`int` weight=400, :ref:`int` stretch=100, :ref:`bool` italic=false **)** |const| -Returns path to the system font file with ``font_name`` and style. Returns empty string if no matching fonts found. +Returns the path to the system font file with ``font_name`` and style. Returns an empty string if no matching fonts found. The following aliases can be used to request default fonts: "sans-serif", "serif", "monospace", "cursive", and "fantasy". @@ -1037,7 +1111,7 @@ The following aliases can be used to request default fonts: "sans-serif", "serif :ref:`PackedStringArray` **get_system_font_path_for_text** **(** :ref:`String` font_name, :ref:`String` text, :ref:`String` locale="", :ref:`String` script="", :ref:`int` weight=400, :ref:`int` stretch=100, :ref:`bool` italic=false **)** |const| -Returns an array of the system substitute font file paths, which are similar to the font with ``font_name`` and style for the specified text, locale and script. Returns empty array if no matching fonts found. +Returns an array of the system substitute font file paths, which are similar to the font with ``font_name`` and style for the specified text, locale, and script. Returns an empty array if no matching fonts found. The following aliases can be used to request default fonts: "sans-serif", "serif", "monospace", "cursive", and "fantasy". @@ -1057,7 +1131,7 @@ The following aliases can be used to request default fonts: "sans-serif", "serif :ref:`PackedStringArray` **get_system_fonts** **(** **)** |const| -Returns list of font family names available. +Returns the list of font family names available. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. @@ -1087,9 +1161,9 @@ Returns the ID of the current thread. This can be used in logs to ease debugging 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:** This string may change without notice if the user reinstalls their operating system, upgrades it, or modifies 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 this method for security purposes. -\ **Note:** Returns an empty string and prints an error on Web, as this method cannot be implemented on this platform. +\ **Note:** On Web, returns an empty string and generates an error, as this method cannot be implemented for security concerns. .. rst-class:: classref-item-separator @@ -1101,17 +1175,17 @@ Returns a string that is unique to the device. :ref:`String` **get_user_data_dir** **(** **)** |const| -Returns the absolute directory path where user data is written (``user://``). +Returns the absolute directory path where user data is written (the ``user://`` directory in Godot). The path depends on the project name and :ref:`ProjectSettings.application/config/use_custom_user_dir`. -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``. +- 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``. -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 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 Linux and BSD, this is ``~/.local/share/godot/app_userdata/[project_name]``, or ``~/.local/share/[custom_name]`` if ``use_custom_user_dir`` is set. +- On Linux and BSD, this is ``~/.local/share/godot/app_userdata/[project_name]``, or ``~/.local/share/[custom_name]`` if ``use_custom_user_dir`` is set. -On Android and iOS, this is a sandboxed directory in either internal or external storage, depending on the user's configuration. +- On Android and iOS, this is a sandboxed directory in either internal or external storage, depending on the user's configuration. -On the web, this is a virtual directory managed by the browser. +- On Web, this is a virtual directory managed by the browser. If the project name is empty, ``[project_name]`` falls back to ``[unnamed project]``. @@ -1129,15 +1203,15 @@ Not to be confused with :ref:`get_data_dir`, which Returns the exact production and build version of the operating system. This is different from the branded version used in marketing. This helps to distinguish between different releases of operating systems, including minor versions, and insider and custom builds. -For Windows, the major and minor version are returned, as well as the build number. For example, the returned string can look like ``10.0.9926`` for a build of Windows 10, and it can look like ``6.1.7601`` for a build of Windows 7 SP1. +- For Windows, the major and minor version are returned, as well as the build number. For example, the returned string may look like ``10.0.9926`` for a build of Windows 10, and it may look like ``6.1.7601`` for a build of Windows 7 SP1. -For rolling distributions, such as Arch Linux, an empty string is returned. +- For rolling distributions, such as Arch Linux, an empty string is returned. -For macOS and iOS, the major and minor version are returned, as well as the patch number. +- For macOS and iOS, the major and minor version are returned, as well as the patch number. -For Android, the SDK version and the incremental build number are returned. If it's a custom ROM, it attempts to return its version instead. +- For Android, the SDK version and the incremental build number are returned. If it's a custom ROM, it attempts to return its version instead. -\ **Note:** This method is not supported on the web platform. It returns an empty string. +\ **Note:** This method is not supported on the Web platform. It returns an empty string. .. rst-class:: classref-item-separator @@ -1149,13 +1223,13 @@ For Android, the SDK version and the incremental build number are returned. If i :ref:`PackedStringArray` **get_video_adapter_driver_info** **(** **)** |const| -Returns the video adapter driver name and version for the user's currently active graphics card. See also :ref:`RenderingServer.get_video_adapter_api_version`. +Returns the video adapter driver name and version for the user's currently active graphics card, as a :ref:`PackedStringArray`. See also :ref:`RenderingServer.get_video_adapter_api_version`. The first element holds the driver name, such as ``nvidia``, ``amdgpu``, etc. -The second element holds the driver version. For e.g. the ``nvidia`` driver on a Linux/BSD platform, the version is in the format ``510.85.02``. For Windows, the driver's format is ``31.0.15.1659``. +The second element holds the driver version. For example, on the ``nvidia`` driver on a Linux/BSD platform, the version is in the format ``510.85.02``. For Windows, the driver's format is ``31.0.15.1659``. -\ **Note:** This method is only supported on the platforms Linux/BSD and Windows when not running in headless mode. It returns an empty array on other platforms. +\ **Note:** This method is only supported on Linux/BSD and Windows when not running in headless mode. On other platforms, it returns an empty array. .. rst-class:: classref-item-separator @@ -1185,9 +1259,7 @@ Returns ``true`` if the feature for the given feature tag is supported in the cu \ **Note:** Tag names are case-sensitive. -\ **Note:** On the web platform, one of the following additional tags is defined to indicate host platform: ``web_android``, ``web_ios``, ``web_linuxbsd``, ``web_macos``, or ``web_windows``. - -\ **Note:** On the iOS simulator, the additional ``simulator`` tag is defined. +\ **Note:** On the Web platform, one of the following additional tags is defined to indicate host platform: ``web_android``, ``web_ios``, ``web_linuxbsd``, ``web_macos``, or ``web_windows``. .. rst-class:: classref-item-separator @@ -1203,7 +1275,7 @@ Returns ``true`` if the Godot binary used to run the project is a *debug* export 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("template")`` instead. +\ **Note:** To check whether the Godot binary used to run the project is an export template (debug or release), use ``OS.has_feature("template")`` instead. .. rst-class:: classref-item-separator @@ -1215,7 +1287,26 @@ To check whether the Godot binary used to run the project is an export template :ref:`bool` **is_keycode_unicode** **(** :ref:`int` code **)** |const| -Returns ``true`` if the input keycode corresponds to a Unicode character. +Returns ``true`` if the input keycode corresponds to a Unicode character. For a list of codes, see the :ref:`Key` constants. + + +.. tabs:: + + .. code-tab:: gdscript + + print(OS.is_keycode_unicode(KEY_G)) # Prints true + print(OS.is_keycode_unicode(KEY_KP_4)) # Prints true + print(OS.is_keycode_unicode(KEY_TAB)) # Prints false + print(OS.is_keycode_unicode(KEY_ESCAPE)) # Prints false + + .. code-tab:: csharp + + GD.Print(OS.IsKeycodeUnicode((long)Key.G)); // Prints true + GD.Print(OS.IsKeycodeUnicode((long)Key.Kp4)); // Prints true + GD.Print(OS.IsKeycodeUnicode((long)Key.Tab)); // Prints false + GD.Print(OS.IsKeycodeUnicode((long)Key.Escape)); // Prints false + + .. rst-class:: classref-item-separator @@ -1227,9 +1318,7 @@ Returns ``true`` if the input keycode corresponds to a Unicode character. :ref:`bool` **is_process_running** **(** :ref:`int` pid **)** |const| -Returns ``true`` if the child process ID (``pid``) is still running or ``false`` if it has terminated. - -Must be a valid ID generated from :ref:`create_process`. +Returns ``true`` if the child process ID (``pid``) is still running or ``false`` if it has terminated. ``pid`` must be a valid ID generated from :ref:`create_process`. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. @@ -1255,9 +1344,9 @@ Returns ``true`` if the project will automatically restart when it exits for any :ref:`bool` **is_sandboxed** **(** **)** |const| -Returns ``true`` if application is running in the sandbox. +Returns ``true`` if the application is running in the sandbox. -\ **Note:** This method is implemented on macOS and Linux. +\ **Note:** This method is only implemented on macOS and Linux. .. rst-class:: classref-item-separator @@ -1281,7 +1370,7 @@ Returns ``true`` if the engine was executed with the ``--verbose`` or ``-v`` com :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 Web platform, where this persistence may be unavailable. +Returns ``true`` if the ``user://`` file system is persistent, that is, its state is the same after a player quits and starts the game again. Relevant to the Web platform, where this persistence may be unavailable. .. rst-class:: classref-item-separator @@ -1293,9 +1382,9 @@ If ``true``, the ``user://`` file system is persistent, so that its state is the :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. See also :ref:`crash`. +Kill (terminate) the process identified by the given process ID (``pid``), such as the ID returned by :ref:`execute` in non-blocking mode. See also :ref:`crash`. -\ **Note:** This method can also be used to kill processes that were not spawned by the game. +\ **Note:** This method can also be used to kill processes that were not spawned by the engine. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. @@ -1309,11 +1398,11 @@ Kill (terminate) the process identified by the given process ID (``pid``), e.g. :ref:`Error` **move_to_trash** **(** :ref:`String` path **)** |const| -Moves the file or directory to the system's recycle bin. See also :ref:`DirAccess.remove`. +Moves the file or directory at the given ``path`` to the system's recycle bin. See also :ref:`DirAccess.remove`. The method takes only global paths, so you may need to use :ref:`ProjectSettings.globalize_path`. Do not use it for files in ``res://`` as it will not work in exported projects. -\ **Note:** If the user has disabled the recycle bin on their system, the file will be permanently deleted instead. +Returns :ref:`@GlobalScope.FAILED` if the file or directory cannot be found, or the system does not support this method. .. tabs:: @@ -1330,6 +1419,10 @@ The method takes only global paths, so you may need to use :ref:`ProjectSettings +\ **Note:** This method is implemented on Android, Linux, macOS and Windows. + +\ **Note:** If the user has disabled the recycle bin on their system, the file will be permanently deleted instead. + .. rst-class:: classref-item-separator ---- @@ -1340,7 +1433,7 @@ The method takes only global paths, so you may need to use :ref:`ProjectSettings void **open_midi_inputs** **(** **)** -Initializes the singleton for the system MIDI driver. +Initializes the singleton for the system MIDI driver, allowing Godot to receive :ref:`InputEventMIDI`. See also :ref:`get_connected_midi_inputs` and :ref:`close_midi_inputs`. \ **Note:** This method is implemented on Linux, macOS and Windows. @@ -1368,7 +1461,9 @@ Reads a user input string from the standard input (usually the terminal). This o :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. +Requests permission from the OS for the given ``name``. Returns ``true`` if the permission has been successfully granted. + +\ **Note:** This method is currently only implemented on Android, to specifically request permission for ``"RECORD_AUDIO"`` by ``AudioDriverOpenSL``. .. rst-class:: classref-item-separator @@ -1380,9 +1475,9 @@ At the moment this function is only used by ``AudioDriverOpenSL`` to request per :ref:`bool` **request_permissions** **(** **)** -With this function, you can request dangerous permissions since normal permissions are automatically granted at install time in Android applications. +Requests *dangerous* permissions from the OS. Returns ``true`` if permissions have been successfully granted. -\ **Note:** This method is implemented only on Android. +\ **Note:** This method is only implemented on Android. Normal permissions are automatically granted at install time in Android applications. .. rst-class:: classref-item-separator @@ -1420,9 +1515,9 @@ Sets the value of the environment variable ``variable`` to ``value``. The enviro void **set_restart_on_exit** **(** :ref:`bool` restart, :ref:`PackedStringArray` arguments=PackedStringArray() **)** -If ``restart`` is ``true``, restarts the project automatically when it is exited with :ref:`SceneTree.quit` or :ref:`Node.NOTIFICATION_WM_CLOSE_REQUEST`. Command line ``arguments`` can be supplied. To restart the project with the same command line arguments as originally used to run the project, pass :ref:`get_cmdline_args` as the value for ``arguments``. +If ``restart`` is ``true``, restarts the project automatically when it is exited with :ref:`SceneTree.quit` or :ref:`Node.NOTIFICATION_WM_CLOSE_REQUEST`. Command-line ``arguments`` can be supplied. To restart the project with the same command line arguments as originally used to run the project, pass :ref:`get_cmdline_args` as the value for ``arguments``. -\ :ref:`set_restart_on_exit` can be used to apply setting changes that require a restart. See also :ref:`is_restart_on_exit_set` and :ref:`get_restart_on_exit_arguments`. +This method can be used to apply setting changes that require a restart. See also :ref:`is_restart_on_exit_set` and :ref:`get_restart_on_exit_arguments`. \ **Note:** This method is only effective on desktop platforms, and only when the project isn't started from the editor. It will have no effect on mobile and Web platforms, or when the project is started from the editor. @@ -1438,7 +1533,7 @@ If ``restart`` is ``true``, restarts the project automatically when it is exited :ref:`Error` **set_thread_name** **(** :ref:`String` name **)** -Sets the name of the current thread. +Assigns the given name to the current thread. Returns :ref:`@GlobalScope.ERR_UNAVAILABLE` if unavailable on the current platform. .. rst-class:: classref-item-separator @@ -1450,7 +1545,9 @@ Sets the name of the current thread. void **set_use_file_access_save_and_swap** **(** :ref:`bool` enabled **)** -Enables backup saves if ``enabled`` is ``true``. +If ``enabled`` is ``true``, when opening a file for writing, a temporary file is used in its place. When closed, it is automatically applied to the target file. + +This can useful when files may be opened by other applications, such as antiviruses, text editors, or even the Godot editor itself. .. rst-class:: classref-item-separator @@ -1462,7 +1559,7 @@ Enables backup saves if ``enabled`` is ``true``. :ref:`Error` **shell_open** **(** :ref:`String` uri **)** -Requests the OS to open a resource with the most appropriate program. For example: +Requests the OS to open a resource identified by ``uri`` 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. @@ -1470,7 +1567,7 @@ Requests the OS to open a resource with the most appropriate program. For exampl - ``OS.shell_open("mailto:example@example.com")`` opens the default email client with the "To" field set to ``example@example.com``. See `RFC 2368 - The [code]mailto[/code] URL scheme `__ 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. +Use :ref:`ProjectSettings.globalize_path` to convert a ``res://`` or ``user://`` project path into a system path for use with this method. \ **Note:** Use :ref:`String.uri_encode` to encode characters within URLs in a URL-safe, portable way. This is especially required for line breaks. Otherwise, :ref:`shell_open` may not work correctly in a project exported to the Web platform. @@ -1486,13 +1583,13 @@ Use :ref:`ProjectSettings.globalize_path` **shell_show_in_file_manager** **(** :ref:`String` file_or_dir_path, :ref:`bool` open_folder=true **)** -Requests the OS to open the file manager, then navigate to the given ``file_or_dir_path`` and select the target file or folder. +Requests the OS to open the file manager, navigate to the given ``file_or_dir_path`` and select the target file or folder. -If ``file_or_dir_path`` is a valid directory path, and ``open_folder`` is ``true``, the method will open the file manager and enter the target folder without selecting anything. +If ``open_folder`` is ``true`` and ``file_or_dir_path`` is a valid directory path, the OS will open the file manager and navigate to the target folder without selecting anything. -Use :ref:`ProjectSettings.globalize_path` to convert a ``res://`` or ``user://`` path into a system path for use with this method. +Use :ref:`ProjectSettings.globalize_path` to convert a ``res://`` or ``user://`` project path into a system path to use with this method. -\ **Note:** Currently this method is only implemented on Windows and macOS. On other platforms, it will fallback to :ref:`shell_open` with a directory path of ``file_or_dir_path`` with prefix ``file://``. +\ **Note:** This method is currently only implemented on Windows and macOS. On other platforms, it will fallback to :ref:`shell_open` with a directory path of ``file_or_dir_path`` prefixed with ``file://``. .. rst-class:: classref-item-separator @@ -1504,9 +1601,9 @@ Use :ref:`ProjectSettings.globalize_path` variable **)** |const| -Removes the environment ``variable`` from the current environment, if it exists. The environment variable will be removed for the Godot process and any process executed with :ref:`execute` after running :ref:`unset_environment`. The removal of the environment variable will *not* persist to processes run after the Godot process was terminated. +Removes the given environment variable from the current environment, if it exists. The ``variable`` name cannot be empty or include the ``=`` character. The environment variable will be removed for the Godot process and any process executed with :ref:`execute` after running :ref:`unset_environment`. The removal of the environment variable will *not* persist to processes run after the Godot process was terminated. -\ **Note:** Environment variable names are case-sensitive on all platforms except Windows. The ``variable`` name cannot be empty or include the ``=`` character. +\ **Note:** Environment variable names are case-sensitive on all platforms except Windows. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_packedbytearray.rst b/classes/class_packedbytearray.rst index ef3301ba4f4..a88faac2bba 100644 --- a/classes/class_packedbytearray.rst +++ b/classes/class_packedbytearray.rst @@ -471,6 +471,8 @@ Decodes a size of a :ref:`Variant` from the bytes starting at ``b Returns a new **PackedByteArray** 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. +\ **Note:** Decompression is not guaranteed to work with data not compressed by Godot, for example if data compressed with the deflate compression mode lacks a checksum or header. + .. rst-class:: classref-item-separator ---- @@ -487,6 +489,8 @@ This method is potentially slower than :ref:`decompress` **resize** **(** :ref:`int` new_size **)** -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. +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. Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. .. rst-class:: classref-item-separator diff --git a/classes/class_packedcolorarray.rst b/classes/class_packedcolorarray.rst index 4f44ff7721d..93ff37a789c 100644 --- a/classes/class_packedcolorarray.rst +++ b/classes/class_packedcolorarray.rst @@ -325,7 +325,7 @@ Removes an element from the array by index. :ref:`int` **resize** **(** :ref:`int` new_size **)** -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. +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. Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. .. rst-class:: classref-item-separator diff --git a/classes/class_packedfloat32array.rst b/classes/class_packedfloat32array.rst index 6244485388e..631ec722a7b 100644 --- a/classes/class_packedfloat32array.rst +++ b/classes/class_packedfloat32array.rst @@ -329,7 +329,7 @@ Removes an element from the array by index. :ref:`int` **resize** **(** :ref:`int` new_size **)** -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. +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. Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. .. rst-class:: classref-item-separator diff --git a/classes/class_packedfloat64array.rst b/classes/class_packedfloat64array.rst index 4020f7a7b14..7a2ba0512a7 100644 --- a/classes/class_packedfloat64array.rst +++ b/classes/class_packedfloat64array.rst @@ -329,7 +329,7 @@ Removes an element from the array by index. :ref:`int` **resize** **(** :ref:`int` new_size **)** -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. +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. Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. .. rst-class:: classref-item-separator diff --git a/classes/class_packedint32array.rst b/classes/class_packedint32array.rst index e5e4dfa230e..24144df2108 100644 --- a/classes/class_packedint32array.rst +++ b/classes/class_packedint32array.rst @@ -321,7 +321,7 @@ Removes an element from the array by index. :ref:`int` **resize** **(** :ref:`int` new_size **)** -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. +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. Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. .. rst-class:: classref-item-separator diff --git a/classes/class_packedint64array.rst b/classes/class_packedint64array.rst index 8b710ef908d..419993dafa0 100644 --- a/classes/class_packedint64array.rst +++ b/classes/class_packedint64array.rst @@ -321,7 +321,7 @@ Removes an element from the array by index. :ref:`int` **resize** **(** :ref:`int` new_size **)** -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. +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. Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. .. rst-class:: classref-item-separator diff --git a/classes/class_packedstringarray.rst b/classes/class_packedstringarray.rst index b623f3e9ec0..aa6b65605f7 100644 --- a/classes/class_packedstringarray.rst +++ b/classes/class_packedstringarray.rst @@ -334,7 +334,7 @@ Removes an element from the array by index. :ref:`int` **resize** **(** :ref:`int` new_size **)** -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. +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. Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. .. rst-class:: classref-item-separator diff --git a/classes/class_packedvector2array.rst b/classes/class_packedvector2array.rst index d41288c9db4..1f961c694eb 100644 --- a/classes/class_packedvector2array.rst +++ b/classes/class_packedvector2array.rst @@ -342,7 +342,7 @@ Removes an element from the array by index. :ref:`int` **resize** **(** :ref:`int` new_size **)** -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. +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. Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. .. rst-class:: classref-item-separator diff --git a/classes/class_packedvector3array.rst b/classes/class_packedvector3array.rst index 98bc0ead1d4..d2e7b0e3fb1 100644 --- a/classes/class_packedvector3array.rst +++ b/classes/class_packedvector3array.rst @@ -335,7 +335,7 @@ Removes an element from the array by index. :ref:`int` **resize** **(** :ref:`int` new_size **)** -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. +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. Calling :ref:`resize` once and assigning the new values is faster than adding new elements one by one. .. rst-class:: classref-item-separator diff --git a/classes/class_panoramaskymaterial.rst b/classes/class_panoramaskymaterial.rst index d1208073531..865d2dfa9cd 100644 --- a/classes/class_panoramaskymaterial.rst +++ b/classes/class_panoramaskymaterial.rst @@ -33,11 +33,13 @@ Properties .. table:: :widths: auto - +-----------------------------------+--------------------------------------------------------------+----------+ - | :ref:`bool` | :ref:`filter` | ``true`` | - +-----------------------------------+--------------------------------------------------------------+----------+ - | :ref:`Texture2D` | :ref:`panorama` | | - +-----------------------------------+--------------------------------------------------------------+----------+ + +-----------------------------------+--------------------------------------------------------------------------------+----------+ + | :ref:`float` | :ref:`energy_multiplier` | ``1.0`` | + +-----------------------------------+--------------------------------------------------------------------------------+----------+ + | :ref:`bool` | :ref:`filter` | ``true`` | + +-----------------------------------+--------------------------------------------------------------------------------+----------+ + | :ref:`Texture2D` | :ref:`panorama` | | + +-----------------------------------+--------------------------------------------------------------------------------+----------+ .. rst-class:: classref-section-separator @@ -48,6 +50,23 @@ Properties Property Descriptions --------------------- +.. _class_PanoramaSkyMaterial_property_energy_multiplier: + +.. rst-class:: classref-property + +:ref:`float` **energy_multiplier** = ``1.0`` + +.. rst-class:: classref-property-setget + +- void **set_energy_multiplier** **(** :ref:`float` value **)** +- :ref:`float` **get_energy_multiplier** **(** **)** + +The sky's overall brightness multiplier. Higher values result in a brighter sky. + +.. rst-class:: classref-item-separator + +---- + .. _class_PanoramaSkyMaterial_property_filter: .. rst-class:: classref-property diff --git a/classes/class_particleprocessmaterial.rst b/classes/class_particleprocessmaterial.rst index 388999bff1c..ae102348b81 100644 --- a/classes/class_particleprocessmaterial.rst +++ b/classes/class_particleprocessmaterial.rst @@ -227,6 +227,8 @@ Methods .. table:: :widths: auto + +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`get_param` **(** :ref:`Parameter` param **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_param_max` **(** :ref:`Parameter` param **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -236,6 +238,8 @@ Methods +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_particle_flag` **(** :ref:`ParticleFlags` particle_flag **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_param` **(** :ref:`Parameter` param, :ref:`Vector2` value **)** | + +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_param_max` **(** :ref:`Parameter` param, :ref:`float` value **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_param_min` **(** :ref:`Parameter` param, :ref:`float` value **)** | @@ -452,6 +456,10 @@ Use with :ref:`set_particle_flag` **PARTICLE_FLAG_DAMPING_AS_FRICTION** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ParticleProcessMaterial_constant_PARTICLE_FLAG_MAX: @@ -552,6 +560,10 @@ enum **SubEmitterMode**: :ref:`SubEmitterMode` **SUB_EMITTER_DISABLED** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ParticleProcessMaterial_constant_SUB_EMITTER_CONSTANT: @@ -560,6 +572,10 @@ enum **SubEmitterMode**: :ref:`SubEmitterMode` **SUB_EMITTER_CONSTANT** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ParticleProcessMaterial_constant_SUB_EMITTER_AT_END: @@ -568,6 +584,10 @@ enum **SubEmitterMode**: :ref:`SubEmitterMode` **SUB_EMITTER_AT_END** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ParticleProcessMaterial_constant_SUB_EMITTER_AT_COLLISION: @@ -576,6 +596,10 @@ enum **SubEmitterMode**: :ref:`SubEmitterMode` **SUB_EMITTER_AT_COLLISION** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ParticleProcessMaterial_constant_SUB_EMITTER_MAX: @@ -2306,6 +2330,20 @@ A pivot point used to calculate radial and orbital velocity of particles. Method Descriptions ------------------- +.. _class_ParticleProcessMaterial_method_get_param: + +.. rst-class:: classref-method + +:ref:`Vector2` **get_param** **(** :ref:`Parameter` param **)** |const| + +Returns the minimum and maximum values of the given ``param`` as a vector. + +The ``x`` component of the returned vector corresponds to minimum and the ``y`` component corresponds to maximum. + +.. rst-class:: classref-item-separator + +---- + .. _class_ParticleProcessMaterial_method_get_param_max: .. rst-class:: classref-method @@ -2354,6 +2392,20 @@ Returns ``true`` if the specified particle flag is enabled. See :ref:`ParticleFl ---- +.. _class_ParticleProcessMaterial_method_set_param: + +.. rst-class:: classref-method + +void **set_param** **(** :ref:`Parameter` param, :ref:`Vector2` value **)** + +Sets the minimum and maximum values of the given ``param``. + +The ``x`` component of the argument vector corresponds to minimum and the ``y`` component corresponds to maximum. + +.. rst-class:: classref-item-separator + +---- + .. _class_ParticleProcessMaterial_method_set_param_max: .. rst-class:: classref-method diff --git a/classes/class_physicalbone3d.rst b/classes/class_physicalbone3d.rst index e7508b9c438..3286c30f833 100644 --- a/classes/class_physicalbone3d.rst +++ b/classes/class_physicalbone3d.rst @@ -132,6 +132,10 @@ enum **JointType**: :ref:`JointType` **JOINT_TYPE_NONE** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicalBone3D_constant_JOINT_TYPE_PIN: @@ -140,6 +144,10 @@ enum **JointType**: :ref:`JointType` **JOINT_TYPE_PIN** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicalBone3D_constant_JOINT_TYPE_CONE: @@ -148,6 +156,10 @@ enum **JointType**: :ref:`JointType` **JOINT_TYPE_CONE** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicalBone3D_constant_JOINT_TYPE_HINGE: @@ -156,6 +168,10 @@ enum **JointType**: :ref:`JointType` **JOINT_TYPE_HINGE** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicalBone3D_constant_JOINT_TYPE_SLIDER: @@ -164,6 +180,10 @@ enum **JointType**: :ref:`JointType` **JOINT_TYPE_SLIDER** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicalBone3D_constant_JOINT_TYPE_6DOF: @@ -172,6 +192,10 @@ enum **JointType**: :ref:`JointType` **JOINT_TYPE_6DOF** = ``5`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator diff --git a/classes/class_physicsbody2d.rst b/classes/class_physicsbody2d.rst index f174fdb08b2..70c1a6dc711 100644 --- a/classes/class_physicsbody2d.rst +++ b/classes/class_physicsbody2d.rst @@ -55,6 +55,8 @@ Methods +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PhysicsBody2D[]` | :ref:`get_collision_exceptions` **(** **)** | +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`get_gravity` **(** **)** |const| | + +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`KinematicCollision2D` | :ref:`move_and_collide` **(** :ref:`Vector2` motion, :ref:`bool` test_only=false, :ref:`float` safe_margin=0.08, :ref:`bool` recovery_as_collision=false **)** | +---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_collision_exception_with` **(** :ref:`Node` body **)** | @@ -95,6 +97,18 @@ Returns an array of nodes that were added as collision exceptions for this body. ---- +.. _class_PhysicsBody2D_method_get_gravity: + +.. rst-class:: classref-method + +:ref:`Vector2` **get_gravity** **(** **)** |const| + +Returns the gravity vector computed from all sources that can affect the body, including all gravity overrides from :ref:`Area2D` nodes and the global world gravity. + +.. rst-class:: classref-item-separator + +---- + .. _class_PhysicsBody2D_method_move_and_collide: .. rst-class:: classref-method diff --git a/classes/class_physicsbody3d.rst b/classes/class_physicsbody3d.rst index fcba201d7ab..cfa6fca355d 100644 --- a/classes/class_physicsbody3d.rst +++ b/classes/class_physicsbody3d.rst @@ -69,6 +69,8 @@ Methods +---------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PhysicsBody3D[]` | :ref:`get_collision_exceptions` **(** **)** | +---------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`get_gravity` **(** **)** |const| | + +---------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`KinematicCollision3D` | :ref:`move_and_collide` **(** :ref:`Vector3` motion, :ref:`bool` test_only=false, :ref:`float` safe_margin=0.001, :ref:`bool` recovery_as_collision=false, :ref:`int` max_collisions=1 **)** | +---------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_collision_exception_with` **(** :ref:`Node` body **)** | @@ -230,6 +232,18 @@ Returns an array of nodes that were added as collision exceptions for this body. ---- +.. _class_PhysicsBody3D_method_get_gravity: + +.. rst-class:: classref-method + +:ref:`Vector3` **get_gravity** **(** **)** |const| + +Returns the gravity vector computed from all sources that can affect the body, including all gravity overrides from :ref:`Area3D` nodes and the global world gravity. + +.. rst-class:: classref-item-separator + +---- + .. _class_PhysicsBody3D_method_move_and_collide: .. rst-class:: classref-method diff --git a/classes/class_physicsserver3d.rst b/classes/class_physicsserver3d.rst index b1f658bd069..ed0f2850cb5 100644 --- a/classes/class_physicsserver3d.rst +++ b/classes/class_physicsserver3d.rst @@ -296,8 +296,72 @@ Methods +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`slider_joint_set_param` **(** :ref:`RID` joint, :ref:`SliderJointParam` param, :ref:`float` value **)** | +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_add_collision_exception` **(** :ref:`RID` body, :ref:`RID` body_b **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`soft_body_create` **(** **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`soft_body_get_bounds` **(** :ref:`RID` body **)** |const| | +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`soft_body_get_collision_layer` **(** :ref:`RID` body **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`soft_body_get_collision_mask` **(** :ref:`RID` body **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`soft_body_get_damping_coefficient` **(** :ref:`RID` body **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`soft_body_get_drag_coefficient` **(** :ref:`RID` body **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`soft_body_get_linear_stiffness` **(** :ref:`RID` body **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector3` | :ref:`soft_body_get_point_global_position` **(** :ref:`RID` body, :ref:`int` point_index **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`soft_body_get_pressure_coefficient` **(** :ref:`RID` body **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`soft_body_get_simulation_precision` **(** :ref:`RID` body **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`soft_body_get_space` **(** :ref:`RID` body **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`soft_body_get_state` **(** :ref:`RID` body, :ref:`BodyState` state **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`soft_body_get_total_mass` **(** :ref:`RID` body **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`soft_body_is_point_pinned` **(** :ref:`RID` body, :ref:`int` point_index **)** |const| | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_move_point` **(** :ref:`RID` body, :ref:`int` point_index, :ref:`Vector3` global_position **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_pin_point` **(** :ref:`RID` body, :ref:`int` point_index, :ref:`bool` pin **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_remove_all_pinned_points` **(** :ref:`RID` body **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_remove_collision_exception` **(** :ref:`RID` body, :ref:`RID` body_b **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_collision_layer` **(** :ref:`RID` body, :ref:`int` layer **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_collision_mask` **(** :ref:`RID` body, :ref:`int` mask **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_damping_coefficient` **(** :ref:`RID` body, :ref:`float` damping_coefficient **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_drag_coefficient` **(** :ref:`RID` body, :ref:`float` drag_coefficient **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_linear_stiffness` **(** :ref:`RID` body, :ref:`float` stiffness **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_mesh` **(** :ref:`RID` body, :ref:`RID` mesh **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_pressure_coefficient` **(** :ref:`RID` body, :ref:`float` pressure_coefficient **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_ray_pickable` **(** :ref:`RID` body, :ref:`bool` enable **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_simulation_precision` **(** :ref:`RID` body, :ref:`int` simulation_precision **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_space` **(** :ref:`RID` body, :ref:`RID` space **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_state` **(** :ref:`RID` body, :ref:`BodyState` state, :ref:`Variant` variant **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_total_mass` **(** :ref:`RID` body, :ref:`float` total_mass **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_set_transform` **(** :ref:`RID` body, :ref:`Transform3D` transform **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`soft_body_update_rendering_server` **(** :ref:`RID` body, :ref:`PhysicsServer3DRenderingServerHandler` rendering_server_handler **)** | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`space_create` **(** **)** | +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PhysicsDirectSpaceState3D` | :ref:`space_get_direct_state` **(** :ref:`RID` space **)** | @@ -464,6 +528,10 @@ The speed with which the rotation across the axis perpendicular to the hinge get :ref:`HingeJointParam` **HINGE_JOINT_LIMIT_SOFTNESS** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicsServer3D_constant_HINGE_JOINT_LIMIT_RELAXATION: @@ -1588,6 +1656,10 @@ enum **BodyAxis**: :ref:`BodyAxis` **BODY_AXIS_LINEAR_X** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicsServer3D_constant_BODY_AXIS_LINEAR_Y: @@ -1596,6 +1668,10 @@ enum **BodyAxis**: :ref:`BodyAxis` **BODY_AXIS_LINEAR_Y** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicsServer3D_constant_BODY_AXIS_LINEAR_Z: @@ -1604,6 +1680,10 @@ enum **BodyAxis**: :ref:`BodyAxis` **BODY_AXIS_LINEAR_Z** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicsServer3D_constant_BODY_AXIS_ANGULAR_X: @@ -1612,6 +1692,10 @@ enum **BodyAxis**: :ref:`BodyAxis` **BODY_AXIS_ANGULAR_X** = ``8`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicsServer3D_constant_BODY_AXIS_ANGULAR_Y: @@ -1620,6 +1704,10 @@ enum **BodyAxis**: :ref:`BodyAxis` **BODY_AXIS_ANGULAR_Y** = ``16`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PhysicsServer3D_constant_BODY_AXIS_ANGULAR_Z: @@ -1628,6 +1716,10 @@ enum **BodyAxis**: :ref:`BodyAxis` **BODY_AXIS_ANGULAR_Z** = ``32`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator @@ -3239,15 +3331,405 @@ Gets a slider_joint parameter (see :ref:`SliderJointParam` body, :ref:`RID` body_b **)** + +Adds the given body to the list of bodies exempt from collisions. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_create: + +.. rst-class:: classref-method + +:ref:`RID` **soft_body_create** **(** **)** + +Creates a new soft body and returns its internal :ref:`RID`. + +.. rst-class:: classref-item-separator + +---- + .. _class_PhysicsServer3D_method_soft_body_get_bounds: .. rst-class:: classref-method :ref:`AABB` **soft_body_get_bounds** **(** :ref:`RID` body **)** |const| -.. container:: contribute +Returns the bounds of the given soft body in global coordinates. - There is currently no description for this method. Please help us by :ref:`contributing one `! +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_collision_layer: + +.. rst-class:: classref-method + +:ref:`int` **soft_body_get_collision_layer** **(** :ref:`RID` body **)** |const| + +Returns the physics layer or layers that the given soft body belongs to. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_collision_mask: + +.. rst-class:: classref-method + +:ref:`int` **soft_body_get_collision_mask** **(** :ref:`RID` body **)** |const| + +Returns the physics layer or layers that the given soft body can collide with. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_damping_coefficient: + +.. rst-class:: classref-method + +:ref:`float` **soft_body_get_damping_coefficient** **(** :ref:`RID` body **)** |const| + +Returns the damping coefficient of the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_drag_coefficient: + +.. rst-class:: classref-method + +:ref:`float` **soft_body_get_drag_coefficient** **(** :ref:`RID` body **)** |const| + +Returns the drag coefficient of the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_linear_stiffness: + +.. rst-class:: classref-method + +:ref:`float` **soft_body_get_linear_stiffness** **(** :ref:`RID` body **)** |const| + +Returns the linear stiffness of the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_point_global_position: + +.. rst-class:: classref-method + +:ref:`Vector3` **soft_body_get_point_global_position** **(** :ref:`RID` body, :ref:`int` point_index **)** |const| + +Returns the current position of the given soft body point in global coordinates. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_pressure_coefficient: + +.. rst-class:: classref-method + +:ref:`float` **soft_body_get_pressure_coefficient** **(** :ref:`RID` body **)** |const| + +Returns the pressure coefficient of the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_simulation_precision: + +.. rst-class:: classref-method + +:ref:`int` **soft_body_get_simulation_precision** **(** :ref:`RID` body **)** |const| + +Returns the simulation precision of the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_space: + +.. rst-class:: classref-method + +:ref:`RID` **soft_body_get_space** **(** :ref:`RID` body **)** |const| + +Returns the :ref:`RID` of the space assigned to the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_state: + +.. rst-class:: classref-method + +:ref:`Variant` **soft_body_get_state** **(** :ref:`RID` body, :ref:`BodyState` state **)** |const| + +Returns the given soft body state (see :ref:`BodyState` constants). + +\ **Note:** Godot's default physics implementation does not support :ref:`BODY_STATE_LINEAR_VELOCITY`, :ref:`BODY_STATE_ANGULAR_VELOCITY`, :ref:`BODY_STATE_SLEEPING`, or :ref:`BODY_STATE_CAN_SLEEP`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_get_total_mass: + +.. rst-class:: classref-method + +:ref:`float` **soft_body_get_total_mass** **(** :ref:`RID` body **)** |const| + +Returns the total mass assigned to the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_is_point_pinned: + +.. rst-class:: classref-method + +:ref:`bool` **soft_body_is_point_pinned** **(** :ref:`RID` body, :ref:`int` point_index **)** |const| + +Returns whether the given soft body point is pinned. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_move_point: + +.. rst-class:: classref-method + +void **soft_body_move_point** **(** :ref:`RID` body, :ref:`int` point_index, :ref:`Vector3` global_position **)** + +Moves the given soft body point to a position in global coordinates. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_pin_point: + +.. rst-class:: classref-method + +void **soft_body_pin_point** **(** :ref:`RID` body, :ref:`int` point_index, :ref:`bool` pin **)** + +Pins or unpins the given soft body point based on the value of ``pin``. + +\ **Note:** Pinning a point effectively makes it kinematic, preventing it from being affected by forces, but you can still move it using :ref:`soft_body_move_point`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_remove_all_pinned_points: + +.. rst-class:: classref-method + +void **soft_body_remove_all_pinned_points** **(** :ref:`RID` body **)** + +Unpins all points of the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_remove_collision_exception: + +.. rst-class:: classref-method + +void **soft_body_remove_collision_exception** **(** :ref:`RID` body, :ref:`RID` body_b **)** + +Removes the given body from the list of bodies exempt from collisions. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_collision_layer: + +.. rst-class:: classref-method + +void **soft_body_set_collision_layer** **(** :ref:`RID` body, :ref:`int` layer **)** + +Sets the physics layer or layers the given soft body belongs to. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_collision_mask: + +.. rst-class:: classref-method + +void **soft_body_set_collision_mask** **(** :ref:`RID` body, :ref:`int` mask **)** + +Sets the physics layer or layers the given soft body can collide with. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_damping_coefficient: + +.. rst-class:: classref-method + +void **soft_body_set_damping_coefficient** **(** :ref:`RID` body, :ref:`float` damping_coefficient **)** + +Sets the damping coefficient of the given soft body. Higher values will slow down the body more noticeably when forces are applied. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_drag_coefficient: + +.. rst-class:: classref-method + +void **soft_body_set_drag_coefficient** **(** :ref:`RID` body, :ref:`float` drag_coefficient **)** + +Sets the drag coefficient of the given soft body. Higher values increase this body's air resistance. + +\ **Note:** This value is currently unused by Godot's default physics implementation. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_linear_stiffness: + +.. rst-class:: classref-method + +void **soft_body_set_linear_stiffness** **(** :ref:`RID` body, :ref:`float` stiffness **)** + +Sets the linear stiffness of the given soft body. Higher values will result in a stiffer body, while lower values will increase the body's ability to bend. The value can be between ``0.0`` and ``1.0`` (inclusive). + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_mesh: + +.. rst-class:: classref-method + +void **soft_body_set_mesh** **(** :ref:`RID` body, :ref:`RID` mesh **)** + +Sets the mesh of the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_pressure_coefficient: + +.. rst-class:: classref-method + +void **soft_body_set_pressure_coefficient** **(** :ref:`RID` body, :ref:`float` pressure_coefficient **)** + +Sets the pressure coefficient of the given soft body. Simulates pressure build-up from inside this body. Higher values increase the strength of this effect. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_ray_pickable: + +.. rst-class:: classref-method + +void **soft_body_set_ray_pickable** **(** :ref:`RID` body, :ref:`bool` enable **)** + +Sets whether the given soft body will be pickable when using object picking. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_simulation_precision: + +.. rst-class:: classref-method + +void **soft_body_set_simulation_precision** **(** :ref:`RID` body, :ref:`int` simulation_precision **)** + +Sets the simulation precision of the given soft body. Increasing this value will improve the resulting simulation, but can affect performance. Use with care. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_space: + +.. rst-class:: classref-method + +void **soft_body_set_space** **(** :ref:`RID` body, :ref:`RID` space **)** + +Assigns a space to the given soft body (see :ref:`space_create`). + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_state: + +.. rst-class:: classref-method + +void **soft_body_set_state** **(** :ref:`RID` body, :ref:`BodyState` state, :ref:`Variant` variant **)** + +Sets the given body state for the given body (see :ref:`BodyState` constants). + +\ **Note:** Godot's default physics implementation does not support :ref:`BODY_STATE_LINEAR_VELOCITY`, :ref:`BODY_STATE_ANGULAR_VELOCITY`, :ref:`BODY_STATE_SLEEPING`, or :ref:`BODY_STATE_CAN_SLEEP`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_total_mass: + +.. rst-class:: classref-method + +void **soft_body_set_total_mass** **(** :ref:`RID` body, :ref:`float` total_mass **)** + +Sets the total mass for the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_set_transform: + +.. rst-class:: classref-method + +void **soft_body_set_transform** **(** :ref:`RID` body, :ref:`Transform3D` transform **)** + +Sets the global transform of the given soft body. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PhysicsServer3D_method_soft_body_update_rendering_server: + +.. rst-class:: classref-method + +void **soft_body_update_rendering_server** **(** :ref:`RID` body, :ref:`PhysicsServer3DRenderingServerHandler` rendering_server_handler **)** + +Requests that the physics server updates the rendering server with the latest positions of the given soft body's points through the ``rendering_server_handler`` interface. .. rst-class:: classref-item-separator diff --git a/classes/class_popupmenu.rst b/classes/class_popupmenu.rst index ae8b6dfcd23..9bfa003b795 100644 --- a/classes/class_popupmenu.rst +++ b/classes/class_popupmenu.rst @@ -37,19 +37,21 @@ Properties .. table:: :widths: auto - +---------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`allow_search` | ``true`` | - +---------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :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:`int` | :ref:`item_count` | ``0`` | - +---------------------------+----------------------------------------------------------------------------------------------------+-----------+ - | :ref:`float` | :ref:`submenu_popup_delay` | ``0.3`` | - +---------------------------+----------------------------------------------------------------------------------------------------+-----------+ + +-----------------------------+----------------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`allow_search` | ``true`` | + +-----------------------------+----------------------------------------------------------------------------------------------------+-----------+ + | :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:`int` | :ref:`item_count` | ``0`` | + +-----------------------------+----------------------------------------------------------------------------------------------------+-----------+ + | :ref:`float` | :ref:`submenu_popup_delay` | ``0.3`` | + +-----------------------------+----------------------------------------------------------------------------------------------------+-----------+ + | :ref:`String` | :ref:`system_menu_root` | ``""`` | + +-----------------------------+----------------------------------------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group @@ -114,6 +116,10 @@ Methods +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_item_metadata` **(** :ref:`int` index **)** |const| | +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_item_multistate` **(** :ref:`int` index **)** |const| | + +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_item_multistate_max` **(** :ref:`int` index **)** |const| | + +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Shortcut` | :ref:`get_item_shortcut` **(** :ref:`int` index **)** |const| | +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_item_submenu` **(** :ref:`int` index **)** |const| | @@ -136,6 +142,8 @@ Methods +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_item_shortcut_disabled` **(** :ref:`int` index **)** |const| | +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_system_menu` **(** **)** |const| | + +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_item` **(** :ref:`int` index **)** | +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`scroll_to_item` **(** :ref:`int` index **)** | @@ -170,6 +178,8 @@ Methods +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_multistate` **(** :ref:`int` index, :ref:`int` state **)** | +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_item_multistate_max` **(** :ref:`int` index, :ref:`int` max_states **)** | + +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_shortcut` **(** :ref:`int` index, :ref:`Shortcut` shortcut, :ref:`bool` global=false **)** | +--------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_shortcut_disabled` **(** :ref:`int` index, :ref:`bool` disabled **)** | @@ -425,6 +435,23 @@ The number of items currently in the list. 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. +.. rst-class:: classref-item-separator + +---- + +.. _class_PopupMenu_property_system_menu_root: + +.. rst-class:: classref-property + +:ref:`String` **system_menu_root** = ``""`` + +.. rst-class:: classref-property-setget + +- void **set_system_menu_root** **(** :ref:`String` value **)** +- :ref:`String` **get_system_menu_root** **(** **)** + +If set to one of the values returned by :ref:`DisplayServer.global_menu_get_system_menu_roots`, this **PopupMenu** is bound to the special system menu. Only one **PopupMenu** can be bound to each special menu at a time. + .. rst-class:: classref-section-separator ---- @@ -592,10 +619,30 @@ void **add_multistate_item** **(** :ref:`String` label, :ref:`int< 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``. +Contrarily to normal binary items, multistate items can have more than two states, as defined by ``max_states``. 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 value of 0 (corresponding to :ref:`@GlobalScope.KEY_NONE`) will be assigned to the item (which means it won't have any accelerator). See :ref:`get_item_accelerator` for more info on accelerators. +\ **Note:** Multistate items don't update their state automatically and must be done manually. See :ref:`toggle_item_multistate`, :ref:`set_item_multistate` and :ref:`get_item_multistate` for more info on how to control it. + +Example usage: + +:: + + func _ready(): + add_multistate_item("Item", 3, 0) + + index_pressed.connect(func(index: int): + toggle_item_multistate(index) + match get_item_multistate(index): + 0: + print("First state") + 1: + print("Second state") + 2: + print("Third state") + ) + .. rst-class:: classref-item-separator ---- @@ -808,6 +855,30 @@ Returns the metadata of the specified item, which might be of any type. You can ---- +.. _class_PopupMenu_method_get_item_multistate: + +.. rst-class:: classref-method + +:ref:`int` **get_item_multistate** **(** :ref:`int` index **)** |const| + +Returns the state of the item at the given ``index``. + +.. rst-class:: classref-item-separator + +---- + +.. _class_PopupMenu_method_get_item_multistate_max: + +.. rst-class:: classref-method + +:ref:`int` **get_item_multistate_max** **(** :ref:`int` index **)** |const| + +Returns the max states of the item at the given ``index``. + +.. rst-class:: classref-item-separator + +---- + .. _class_PopupMenu_method_get_item_shortcut: .. rst-class:: classref-method @@ -946,6 +1017,18 @@ Returns ``true`` if the specified item's shortcut is disabled. ---- +.. _class_PopupMenu_method_is_system_menu: + +.. rst-class:: classref-method + +:ref:`bool` **is_system_menu** **(** **)** |const| + +Returns ``true`` if the menu is bound to the special system menu. + +.. rst-class:: classref-item-separator + +---- + .. _class_PopupMenu_method_remove_item: .. rst-class:: classref-method @@ -1158,6 +1241,18 @@ Sets the state of a multistate item. See :ref:`add_multistate_item` index, :ref:`int` max_states **)** + +Sets the max states of a multistate item. See :ref:`add_multistate_item` for details. + +.. rst-class:: classref-item-separator + +---- + .. _class_PopupMenu_method_set_item_shortcut: .. rst-class:: classref-method diff --git a/classes/class_portablecompressedtexture2d.rst b/classes/class_portablecompressedtexture2d.rst index 95c9b903c23..56ebb6837c9 100644 --- a/classes/class_portablecompressedtexture2d.rst +++ b/classes/class_portablecompressedtexture2d.rst @@ -88,6 +88,10 @@ enum **CompressionMode**: :ref:`CompressionMode` **COMPRESSION_MODE_LOSSLESS** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PortableCompressedTexture2D_constant_COMPRESSION_MODE_LOSSY: @@ -96,6 +100,10 @@ enum **CompressionMode**: :ref:`CompressionMode` **COMPRESSION_MODE_LOSSY** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PortableCompressedTexture2D_constant_COMPRESSION_MODE_BASIS_UNIVERSAL: @@ -104,6 +112,10 @@ enum **CompressionMode**: :ref:`CompressionMode` **COMPRESSION_MODE_BASIS_UNIVERSAL** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PortableCompressedTexture2D_constant_COMPRESSION_MODE_S3TC: @@ -112,6 +124,10 @@ enum **CompressionMode**: :ref:`CompressionMode` **COMPRESSION_MODE_S3TC** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PortableCompressedTexture2D_constant_COMPRESSION_MODE_ETC2: @@ -120,6 +136,10 @@ enum **CompressionMode**: :ref:`CompressionMode` **COMPRESSION_MODE_ETC2** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_PortableCompressedTexture2D_constant_COMPRESSION_MODE_BPTC: @@ -128,6 +148,10 @@ enum **CompressionMode**: :ref:`CompressionMode` **COMPRESSION_MODE_BPTC** = ``5`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator diff --git a/classes/class_primitivemesh.rst b/classes/class_primitivemesh.rst index b53ef004e93..3dca52cb76b 100644 --- a/classes/class_primitivemesh.rst +++ b/classes/class_primitivemesh.rst @@ -166,9 +166,7 @@ Method Descriptions :ref:`Array` **_create_mesh_array** **(** **)** |virtual| |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Override this method to customize how this primitive mesh should be generated. Should return an :ref:`Array` where each element is another Array of values required for the mesh (see the :ref:`ArrayType` constants). .. rst-class:: classref-item-separator diff --git a/classes/class_proceduralskymaterial.rst b/classes/class_proceduralskymaterial.rst index 33002aeb0ef..a3f8db4b9d6 100644 --- a/classes/class_proceduralskymaterial.rst +++ b/classes/class_proceduralskymaterial.rst @@ -23,7 +23,7 @@ Description \ **ProceduralSkyMaterial** supports up to 4 suns, using the color, and energy, direction, and angular distance of the first four :ref:`DirectionalLight3D` nodes in the scene. This means that the suns are defined individually by the properties of their corresponding :ref:`DirectionalLight3D`\ s and globally by :ref:`sun_angle_max` and :ref:`sun_curve`. -\ **ProceduralSkyMaterial** uses a lightweight shader to draw the sky and is therefore suited for real time updates. This makes it a great option for a sky that is simple and computationally cheap, but unrealistic. If you need a more realistic procedural option, use :ref:`PhysicalSkyMaterial`. +\ **ProceduralSkyMaterial** uses a lightweight shader to draw the sky and is therefore suited for real-time updates. This makes it a great option for a sky that is simple and computationally cheap, but unrealistic. If you need a more realistic procedural option, use :ref:`PhysicalSkyMaterial`. .. rst-class:: classref-reftable-group @@ -33,6 +33,8 @@ Properties .. table:: :widths: auto + +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+ + | :ref:`float` | :ref:`energy_multiplier` | ``1.0`` | +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+ | :ref:`Color` | :ref:`ground_bottom_color` | ``Color(0.2, 0.169, 0.133, 1)`` | +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+ @@ -70,6 +72,23 @@ Properties Property Descriptions --------------------- +.. _class_ProceduralSkyMaterial_property_energy_multiplier: + +.. rst-class:: classref-property + +:ref:`float` **energy_multiplier** = ``1.0`` + +.. rst-class:: classref-property-setget + +- void **set_energy_multiplier** **(** :ref:`float` value **)** +- :ref:`float` **get_energy_multiplier** **(** **)** + +The sky's overall brightness multiplier. Higher values result in a brighter sky. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProceduralSkyMaterial_property_ground_bottom_color: .. rst-class:: classref-property diff --git a/classes/class_progressbar.rst b/classes/class_progressbar.rst index 2af8e52114d..15569a02d6a 100644 --- a/classes/class_progressbar.rst +++ b/classes/class_progressbar.rst @@ -29,11 +29,15 @@ Properties .. table:: :widths: auto - +-------------------------+--------------------------------------------------------------------+----------+ - | :ref:`int` | :ref:`fill_mode` | ``0`` | - +-------------------------+--------------------------------------------------------------------+----------+ - | :ref:`bool` | :ref:`show_percentage` | ``true`` | - +-------------------------+--------------------------------------------------------------------+----------+ + +-------------------------+----------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`editor_preview_indeterminate` | | + +-------------------------+----------------------------------------------------------------------------------------------+-----------+ + | :ref:`int` | :ref:`fill_mode` | ``0`` | + +-------------------------+----------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`indeterminate` | ``false`` | + +-------------------------+----------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`show_percentage` | ``true`` | + +-------------------------+----------------------------------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group @@ -115,6 +119,23 @@ The progress fills from bottom to top. Property Descriptions --------------------- +.. _class_ProgressBar_property_editor_preview_indeterminate: + +.. rst-class:: classref-property + +:ref:`bool` **editor_preview_indeterminate** + +.. rst-class:: classref-property-setget + +- void **set_editor_preview_indeterminate** **(** :ref:`bool` value **)** +- :ref:`bool` **is_editor_preview_indeterminate_enabled** **(** **)** + +If ``false``, the :ref:`indeterminate` animation will be paused in the editor. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProgressBar_property_fill_mode: .. rst-class:: classref-property @@ -132,6 +153,23 @@ The fill direction. See :ref:`FillMode` for possible ---- +.. _class_ProgressBar_property_indeterminate: + +.. rst-class:: classref-property + +:ref:`bool` **indeterminate** = ``false`` + +.. rst-class:: classref-property-setget + +- void **set_indeterminate** **(** :ref:`bool` value **)** +- :ref:`bool` **is_indeterminate** **(** **)** + +When set to ``true``, the progress bar indicates that something is happening with an animation, but does not show the fill percentage or value. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProgressBar_property_show_percentage: .. rst-class:: classref-property diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index dbc9c865af1..f49b4dbe410 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -357,6 +357,18 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`debug/shapes/paths/geometry_width` | ``2.0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`display/display_server/driver` | | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`display/display_server/driver.android` | | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`display/display_server/driver.ios` | | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`display/display_server/driver.linuxbsd` | | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`display/display_server/driver.macos` | | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`display/display_server/driver.windows` | | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`display/mouse_cursor/custom_image` | ``""`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`display/mouse_cursor/custom_image_hotspot` | ``Vector2(0, 0)`` | @@ -1113,8 +1125,6 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`memory/limits/message_queue/max_size_mb` | ``32`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`memory/limits/multithreaded_server/rid_pool_prealloc` | ``60`` | - +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`navigation/2d/default_cell_size` | ``1.0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`navigation/2d/default_edge_connection_margin` | ``1.0`` | @@ -1401,12 +1411,12 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/lights_and_shadows/positional_shadow/soft_shadow_filter_quality.mobile` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`rendering/lights_and_shadows/tighter_shadow_caster_culling` | ``true`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/lights_and_shadows/use_physical_light_units` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/limits/cluster_builder/max_clustered_elements` | ``512`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`rendering/limits/forward_renderer/threaded_render_minimum_instances` | ``500`` | - +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/limits/global_shader_variables/buffer_size` | ``65536`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/limits/opengl/max_lights_per_object` | ``8`` | @@ -1453,6 +1463,14 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`rendering/renderer/rendering_method.web` | ``"gl_compatibility"`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`rendering/rendering_device/d3d12/agility_sdk_version` | ``610`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`rendering/rendering_device/d3d12/max_misc_descriptors_per_frame` | ``512`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`rendering/rendering_device/d3d12/max_resource_descriptors_per_frame` | ``16384`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame` | ``1024`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`rendering/rendering_device/driver` | | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`rendering/rendering_device/driver.android` | | @@ -1535,8 +1553,6 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`threading/worker_pool/max_threads` | ``-1`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`threading/worker_pool/use_system_threads_for_low_priority_tasks` | ``true`` | - +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`xr/openxr/default_action_map` | ``"res://openxr_action_map.tres"`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`xr/openxr/enabled` | ``false`` | @@ -1964,7 +1980,9 @@ Changes to this setting will only be applied upon restarting the application. :ref:`int` **application/run/frame_delay_msec** = ``0`` -Forces a delay between frames in the main loop (in milliseconds). This may be useful if you plan to disable vertical synchronization. +Forces a *constant* delay between frames in the main loop (in milliseconds). In most situations, :ref:`application/run/max_fps` should be preferred as an FPS limiter as it's more precise. + +This setting can be overridden using the ``--frame-delay `` command line argument. .. rst-class:: classref-item-separator @@ -2238,7 +2256,7 @@ If ``true``, text-to-speech support is enabled, see :ref:`DisplayServer.tts_get_ :ref:`int` **audio/video/video_delay_compensation_ms** = ``0`` -Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing. +Setting to hardcode audio delay when playing video. Best to leave this unchanged unless you know what you are doing. .. rst-class:: classref-item-separator @@ -2346,7 +2364,7 @@ If canvas item redraw debugging is active, this will be the time the flash will :ref:`bool` **debug/file_logging/enable_file_logging** = ``false`` -If ``true``, logs all output to files. +If ``true``, logs all output and error messages to files. See also :ref:`debug/file_logging/log_path`, :ref:`debug/file_logging/max_log_files`, and :ref:`application/run/flush_stdout_on_print`. .. rst-class:: classref-item-separator @@ -2372,6 +2390,8 @@ Desktop override for :ref:`debug/file_logging/enable_file_logging`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`. If this command line argument is specified, log rotation is automatically disabled (see :ref:`debug/file_logging/max_log_files`). + .. rst-class:: classref-item-separator ---- @@ -2382,7 +2402,9 @@ Path at which to store log files for the project. Using a path under ``user://`` :ref:`int` **debug/file_logging/max_log_files** = ``5`` -Specifies the maximum number of log files allowed (used for rotation). +Specifies the maximum number of log files allowed (used for rotation). Set to ``1`` to disable log file rotation. + +If the ``--log-file `` :doc:`command line argument <../tutorials/editor/command_line_tutorial>` is used, log rotation is always disabled. .. rst-class:: classref-item-separator @@ -3568,6 +3590,78 @@ Line width of the curve path geometry, visible when "Visible Paths" is enabled i ---- +.. _class_ProjectSettings_property_display/display_server/driver: + +.. rst-class:: classref-property + +:ref:`String` **display/display_server/driver** + +Sets the driver to be used by the display server. This property can not be edited directly, instead, set the driver using the platform-specific overrides. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_display/display_server/driver.android: + +.. rst-class:: classref-property + +:ref:`String` **display/display_server/driver.android** + +Android override for :ref:`display/display_server/driver`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_display/display_server/driver.ios: + +.. rst-class:: classref-property + +:ref:`String` **display/display_server/driver.ios** + +iOS override for :ref:`display/display_server/driver`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_display/display_server/driver.linuxbsd: + +.. rst-class:: classref-property + +:ref:`String` **display/display_server/driver.linuxbsd** + +LinuxBSD override for :ref:`display/display_server/driver`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_display/display_server/driver.macos: + +.. rst-class:: classref-property + +:ref:`String` **display/display_server/driver.macos** + +MacOS override for :ref:`display/display_server/driver`. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_display/display_server/driver.windows: + +.. rst-class:: classref-property + +:ref:`String` **display/display_server/driver.windows** + +Windows override for :ref:`display/display_server/driver`. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_display/mouse_cursor/custom_image: .. rst-class:: classref-property @@ -3768,6 +3862,8 @@ Main window content is expanded to the full size of the window. Unlike a borderl Main window initial position (in virtual desktop coordinates), this setting is used only if :ref:`display/window/size/initial_position_type` is set to "Absolute" (``0``). +\ **Note:** This setting only affects the exported project, or when the project is run from the command line. In the editor, the value of :ref:`EditorSettings.run/window_placement/rect_custom_position` is used instead. + .. rst-class:: classref-item-separator ---- @@ -3786,6 +3882,8 @@ Main window initial position. \ ``2`` - "Other Screen Center", :ref:`display/window/size/initial_screen` is used to set the screen. +\ **Note:** This setting only affects the exported project, or when the project is run from the command line. In the editor, the value of :ref:`EditorSettings.run/window_placement/rect` is used instead. + .. rst-class:: classref-item-separator ---- @@ -3798,6 +3896,8 @@ Main window initial position. Main window initial screen, this setting is used only if :ref:`display/window/size/initial_position_type` is set to "Other Screen Center" (``2``). +\ **Note:** This setting only affects the exported project, or when the project is run from the command line. In the editor, the value of :ref:`EditorSettings.run/window_placement/screen` is used instead. + .. rst-class:: classref-item-separator ---- @@ -3832,7 +3932,11 @@ Main window can't be focused. No-focus window will ignore all input, except mous :ref:`bool` **display/window/size/resizable** = ``true`` -Allows the window to be resizable by default. +If ``true``, allows the window to be resizable by default. + +\ **Note:** This property is only read when the project starts. To change whether the window is resizable at runtime, set :ref:`Window.unresizable` instead on the root Window, which can be retrieved using ``get_viewport().get_window()``. :ref:`Window.unresizable` takes the opposite value of this setting. + +\ **Note:** Certain window managers can be configured to ignore the non-resizable status of a window. Do not rely on this setting as a guarantee that the window will *never* be resizable. \ **Note:** This setting is ignored on iOS. @@ -3988,7 +4092,7 @@ If ``true`` subwindows are embedded in the main window. :ref:`int` **display/window/vsync/vsync_mode** = ``1`` -Sets the V-Sync mode for the main game window. +Sets the V-Sync mode for the main game window. The editor's own V-Sync mode can be set using :ref:`EditorSettings.interface/editor/vsync_mode`. See :ref:`VSyncMode` for possible values and how they affect the behavior of your application. @@ -4308,7 +4412,7 @@ Search path for project-specific script templates. Godot will search for script If ``true``, Blender 3D scene files with the ``.blend`` extension will be imported by converting them to glTF 2.0. -This requires configuring a path to a Blender executable in the editor settings at ``filesystem/import/blender/blender3_path``. Blender 3.0 or later is required. +This requires configuring a path to a Blender executable in the editor settings at ``filesystem/import/blender/blender_path``. Blender 3.0 or later is required. .. rst-class:: classref-item-separator @@ -4926,7 +5030,7 @@ Default :ref:`InputEventAction` to select an item in a : :ref:`Dictionary` **input/ui_swap_input_direction** -Default :ref:`InputEventAction` to swap input direction, i.e. change between left-to-right to right-to-left modes. Affects text-editting controls (:ref:`LineEdit`, :ref:`TextEdit`). +Default :ref:`InputEventAction` to swap input direction, i.e. change between left-to-right to right-to-left modes. Affects text-editing controls (:ref:`LineEdit`, :ref:`TextEdit`). .. rst-class:: classref-item-separator @@ -5328,7 +5432,7 @@ In case there's more than one caret active, removes the secondary carets and cle :ref:`Dictionary` **input/ui_text_completion_accept** -Default :ref:`InputEventAction` to accept an autocompetion hint. +Default :ref:`InputEventAction` to accept an autocompletion hint. \ **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. @@ -5342,7 +5446,7 @@ Default :ref:`InputEventAction` to accept an autocompeti :ref:`Dictionary` **input/ui_text_completion_query** -Default :ref:`InputEventAction` to request autocompetion. +Default :ref:`InputEventAction` to request autocompletion. \ **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. @@ -5356,7 +5460,7 @@ Default :ref:`InputEventAction` to request autocompetion :ref:`Dictionary` **input/ui_text_completion_replace** -Default :ref:`InputEventAction` to accept an autocompetion hint, replacing existing text. +Default :ref:`InputEventAction` to accept an autocompletion hint, replacing existing text. \ **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. @@ -8360,18 +8464,6 @@ Godot uses a message queue to defer some function calls. If you run out of space ---- -.. _class_ProjectSettings_property_memory/limits/multithreaded_server/rid_pool_prealloc: - -.. rst-class:: classref-property - -:ref:`int` **memory/limits/multithreaded_server/rid_pool_prealloc** = ``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. - -.. rst-class:: classref-item-separator - ----- - .. _class_ProjectSettings_property_navigation/2d/default_cell_size: .. rst-class:: classref-property @@ -8644,9 +8736,15 @@ If in doubt, leave this setting empty. :ref:`float` **physics/2d/default_angular_damp** = ``1.0`` -The default angular damp in 2D. +The default rotational motion damping in 2D. Damping is used to gradually slow down physical objects over time. RigidBodies will fall back to this value when combining their own damping values and no area damping value is present. + +Suggested values are in the range ``0`` to ``30``. At value ``0`` objects will keep moving with the same velocity. Greater values will stop the object faster. A value equal to or greater than the physics tick rate (:ref:`physics/common/physics_ticks_per_second`) will bring the object to a stop in one iteration. + +\ **Note:** Godot damping calculations are velocity-dependent, meaning bodies moving faster will take a longer time to come to rest. They do not simulate inertia, friction, or air resistance. Therefore heavier or larger bodies will lose speed at the same proportional rate as lighter or smaller bodies. -\ **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_ticks_per_second`, ``60`` by default) will bring the object to a stop in one iteration. +During each physics tick, Godot will multiply the linear velocity of RigidBodies by ``1.0 - combined_damp / physics_ticks_per_second``. By default, bodies combine damp factors: ``combined_damp`` is the sum of the damp value of the body and this value or the area's value the body is in. See :ref:`DampMode`. + +\ **Warning:** Godot's damping calculations are simulation tick rate dependent. Changing :ref:`physics/common/physics_ticks_per_second` may significantly change the outcomes and feel of your simulation. This is true for the entire range of damping values greater than 0. To get back to a similar feel, you also need to change your damp values. This needed change is not proportional and differs from case to case. .. rst-class:: classref-item-separator @@ -8716,9 +8814,15 @@ The default gravity direction in 2D. :ref:`float` **physics/2d/default_linear_damp** = ``0.1`` -The default linear damp in 2D. +The default linear motion damping in 2D. Damping is used to gradually slow down physical objects over time. RigidBodies will fall back to this value when combining their own damping values and no area damping value is present. + +Suggested values are in the range ``0`` to ``30``. At value ``0`` objects will keep moving with the same velocity. Greater values will stop the object faster. A value equal to or greater than the physics tick rate (:ref:`physics/common/physics_ticks_per_second`) will bring the object to a stop in one iteration. -\ **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_ticks_per_second`, ``60`` by default) will bring the object to a stop in one iteration. +\ **Note:** Godot damping calculations are velocity-dependent, meaning bodies moving faster will take a longer time to come to rest. They do not simulate inertia, friction, or air resistance. Therefore heavier or larger bodies will lose speed at the same proportional rate as lighter or smaller bodies. + +During each physics tick, Godot will multiply the linear velocity of RigidBodies by ``1.0 - combined_damp / physics_ticks_per_second``, where ``combined_damp`` is the sum of the linear damp of the body and this value, or the area's value the body is in, assuming the body defaults to combine damp values. See :ref:`DampMode`. + +\ **Warning:** Godot's damping calculations are simulation tick rate dependent. Changing :ref:`physics/common/physics_ticks_per_second` may significantly change the outcomes and feel of your simulation. This is true for the entire range of damping values greater than 0. To get back to a similar feel, you also need to change your damp values. This needed change is not proportional and differs from case to case. .. rst-class:: classref-item-separator @@ -8868,9 +8972,15 @@ Time (in seconds) of inactivity before which a 2D physics body will put to sleep :ref:`float` **physics/3d/default_angular_damp** = ``0.1`` -The default angular damp in 3D. +The default rotational motion damping in 3D. Damping is used to gradually slow down physical objects over time. RigidBodies will fall back to this value when combining their own damping values and no area damping value is present. + +Suggested values are in the range ``0`` to ``30``. At value ``0`` objects will keep moving with the same velocity. Greater values will stop the object faster. A value equal to or greater than the physics tick rate (:ref:`physics/common/physics_ticks_per_second`) will bring the object to a stop in one iteration. -\ **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_ticks_per_second`, ``60`` by default) will bring the object to a stop in one iteration. +\ **Note:** Godot damping calculations are velocity-dependent, meaning bodies moving faster will take a longer time to come to rest. They do not simulate inertia, friction, or air resistance. Therefore heavier or larger bodies will lose speed at the same proportional rate as lighter or smaller bodies. + +During each physics tick, Godot will multiply the angular velocity of RigidBodies by ``1.0 - combined_damp / physics_ticks_per_second``. By default, bodies combine damp factors: ``combined_damp`` is the sum of the damp value of the body and this value or the area's value the body is in. See :ref:`DampMode`. + +\ **Warning:** Godot's damping calculations are simulation tick rate dependent. Changing :ref:`physics/common/physics_ticks_per_second` may significantly change the outcomes and feel of your simulation. This is true for the entire range of damping values greater than 0. To get back to a similar feel, you also need to change your damp values. This needed change is not proportional and differs from case to case. .. rst-class:: classref-item-separator @@ -8940,9 +9050,15 @@ The default gravity direction in 3D. :ref:`float` **physics/3d/default_linear_damp** = ``0.1`` -The default linear damp in 3D. +The default linear motion damping in 3D. Damping is used to gradually slow down physical objects over time. RigidBodies will fall back to this value when combining their own damping values and no area damping value is present. + +Suggested values are in the range ``0`` to ``30``. At value ``0`` objects will keep moving with the same velocity. Greater values will stop the object faster. A value equal to or greater than the physics tick rate (:ref:`physics/common/physics_ticks_per_second`) will bring the object to a stop in one iteration. -\ **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_ticks_per_second`, ``60`` by default) will bring the object to a stop in one iteration. +\ **Note:** Godot damping calculations are velocity-dependent, meaning bodies moving faster will take a longer time to come to rest. They do not simulate inertia, friction, or air resistance. Therefore heavier or larger bodies will lose speed at the same proportional rate as lighter or smaller bodies. + +During each physics tick, Godot will multiply the linear velocity of RigidBodies by ``1.0 - combined_damp / physics_ticks_per_second``. By default, bodies combine damp factors: ``combined_damp`` is the sum of the damp value of the body and this value or the area's value the body is in. See :ref:`DampMode`. + +\ **Warning:** Godot's damping calculations are simulation tick rate dependent. Changing :ref:`physics/common/physics_ticks_per_second` may significantly change the outcomes and feel of your simulation. This is true for the entire range of damping values greater than 0. To get back to a similar feel, you also need to change your damp values. This needed change is not proportional and differs from case to case. .. rst-class:: classref-item-separator @@ -9104,7 +9220,7 @@ Controls the maximum number of physics steps that can be simulated each rendered :ref:`float` **physics/common/physics_jitter_fix** = ``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. +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 good enough 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``. @@ -10276,43 +10392,43 @@ Lower-end override for :ref:`rendering/lights_and_shadows/positional_shadow/soft ---- -.. _class_ProjectSettings_property_rendering/lights_and_shadows/use_physical_light_units: +.. _class_ProjectSettings_property_rendering/lights_and_shadows/tighter_shadow_caster_culling: .. rst-class:: classref-property -:ref:`bool` **rendering/lights_and_shadows/use_physical_light_units** = ``false`` +:ref:`bool` **rendering/lights_and_shadows/tighter_shadow_caster_culling** = ``true`` -Enables the use of physically based units for light sources. Physically based units tend to be much larger than the arbitrary units used by Godot, but they can be used to match lighting within Godot to real-world lighting. Due to the large dynamic range of lighting conditions present in nature, Godot bakes exposure into the various lighting quantities before rendering. Most light sources bake exposure automatically at run time based on the active :ref:`CameraAttributes` resource, but :ref:`LightmapGI` and :ref:`VoxelGI` require a :ref:`CameraAttributes` resource to be set at bake time to reduce the dynamic range. At run time, Godot will automatically reconcile the baked exposure with the active exposure to ensure lighting remains consistent. +If ``true``, items that cannot cast shadows into the view frustum will not be rendered into shadow maps. + +This can increase performance. .. rst-class:: classref-item-separator ---- -.. _class_ProjectSettings_property_rendering/limits/cluster_builder/max_clustered_elements: +.. _class_ProjectSettings_property_rendering/lights_and_shadows/use_physical_light_units: .. rst-class:: classref-property -:ref:`float` **rendering/limits/cluster_builder/max_clustered_elements** = ``512`` - -The maximum number of clustered elements (:ref:`OmniLight3D` + :ref:`SpotLight3D` + :ref:`Decal` + :ref:`ReflectionProbe`) that can be rendered at once in the camera view. If there are more clustered elements present in the camera view, some of them will not be rendered (leading to pop-in during camera movement). Enabling distance fade on lights and decals (:ref:`Light3D.distance_fade_enabled`, :ref:`Decal.distance_fade_enabled`) can help avoid reaching this limit. - -Decreasing this value may improve GPU performance on certain setups, even if the maximum number of clustered elements is never reached in the project. +:ref:`bool` **rendering/lights_and_shadows/use_physical_light_units** = ``false`` -\ **Note:** This setting is only effective when using the Forward+ rendering method, not Mobile and Compatibility. +Enables the use of physically based units for light sources. Physically based units tend to be much larger than the arbitrary units used by Godot, but they can be used to match lighting within Godot to real-world lighting. Due to the large dynamic range of lighting conditions present in nature, Godot bakes exposure into the various lighting quantities before rendering. Most light sources bake exposure automatically at run time based on the active :ref:`CameraAttributes` resource, but :ref:`LightmapGI` and :ref:`VoxelGI` require a :ref:`CameraAttributes` resource to be set at bake time to reduce the dynamic range. At run time, Godot will automatically reconcile the baked exposure with the active exposure to ensure lighting remains consistent. .. rst-class:: classref-item-separator ---- -.. _class_ProjectSettings_property_rendering/limits/forward_renderer/threaded_render_minimum_instances: +.. _class_ProjectSettings_property_rendering/limits/cluster_builder/max_clustered_elements: .. rst-class:: classref-property -:ref:`int` **rendering/limits/forward_renderer/threaded_render_minimum_instances** = ``500`` +:ref:`float` **rendering/limits/cluster_builder/max_clustered_elements** = ``512`` -.. container:: contribute +The maximum number of clustered elements (:ref:`OmniLight3D` + :ref:`SpotLight3D` + :ref:`Decal` + :ref:`ReflectionProbe`) that can be rendered at once in the camera view. If there are more clustered elements present in the camera view, some of them will not be rendered (leading to pop-in during camera movement). Enabling distance fade on lights and decals (:ref:`Light3D.distance_fade_enabled`, :ref:`Decal.distance_fade_enabled`) can help avoid reaching this limit. - There is currently no description for this property. Please help us by :ref:`contributing one `! +Decreasing this value may improve GPU performance on certain setups, even if the maximum number of clustered elements is never reached in the project. + +\ **Note:** This setting is only effective when using the Forward+ rendering method, not Mobile and Compatibility. .. rst-class:: classref-item-separator @@ -10380,9 +10496,7 @@ Max number of positional lights renderable in a frame. If more lights than this :ref:`int` **rendering/limits/spatial_indexer/threaded_cull_minimum_instances** = ``1000`` -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The minimum number of instances that must be present in a scene to enable culling computations on multiple threads. If a scene has fewer instances than this number, culling is done on a single thread. .. rst-class:: classref-item-separator @@ -10626,6 +10740,60 @@ Override for :ref:`rendering/renderer/rendering_method` **rendering/rendering_device/d3d12/agility_sdk_version** = ``610`` + +Version code of the Direct3D 12 Agility SDK to use (``D3D12SDKVersion``). + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_rendering/rendering_device/d3d12/max_misc_descriptors_per_frame: + +.. rst-class:: classref-property + +:ref:`int` **rendering/rendering_device/d3d12/max_misc_descriptors_per_frame** = ``512`` + +The number of entries in the miscellaneous descriptors heap the Direct3D 12 rendering driver uses each frame, used for various operations like clearing a texture. + +Depending on the complexity of scenes, this value may be lowered or may need to be raised. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_rendering/rendering_device/d3d12/max_resource_descriptors_per_frame: + +.. rst-class:: classref-property + +:ref:`int` **rendering/rendering_device/d3d12/max_resource_descriptors_per_frame** = ``16384`` + +The number of entries in the resource descriptors heap the Direct3D 12 rendering driver uses each frame, used for most rendering operations. + +Depending on the complexity of scenes, this value may be lowered or may need to be raised. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame: + +.. rst-class:: classref-property + +:ref:`int` **rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame** = ``1024`` + +The number of entries in the sampler descriptors heap the Direct3D 12 rendering driver uses each frame, used for most rendering operations. + +Depending on the complexity of scenes, this value may be lowered or may need to be raised. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_rendering/rendering_device/driver: .. rst-class:: classref-property @@ -11157,9 +11325,7 @@ The texture *must* use a lossless compression format so that colors can be match :ref:`float` **threading/worker_pool/low_priority_thread_ratio** = ``0.3`` -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The ratio of :ref:`WorkerThreadPool`'s threads that will be reserved for low-priority tasks. For example, if 10 threads are available and this value is set to ``0.3``, 3 of the worker threads will be reserved for low-priority tasks. The actual value won't exceed the number of CPU cores minus one, and if possible, at least one worker thread will be dedicated to low-priority tasks. .. rst-class:: classref-item-separator @@ -11177,20 +11343,6 @@ Maximum number of threads to be used by :ref:`WorkerThreadPool` **threading/worker_pool/use_system_threads_for_low_priority_tasks** = ``true`` - -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! - -.. rst-class:: classref-item-separator - ----- - .. _class_ProjectSettings_property_xr/openxr/default_action_map: .. rst-class:: classref-property @@ -11209,7 +11361,7 @@ Action map configuration to load by default. :ref:`bool` **xr/openxr/enabled** = ``false`` -If ``true`` Godot will setup and initialize OpenXR on startup. +If ``true``, Godot will setup and initialize OpenXR on startup. .. rst-class:: classref-item-separator @@ -11271,6 +11423,8 @@ Specify whether OpenXR should be configured for an HMD or a hand held device. If true and foveation is supported, will automatically adjust foveation level based on framerate up to the level set on :ref:`xr/openxr/foveation_level`. +\ **Note:** Only works on compatibility renderer. + .. rst-class:: classref-item-separator ---- @@ -11283,6 +11437,8 @@ If true and foveation is supported, will automatically adjust foveation level ba Applied foveation level if supported: 0 = off, 1 = low, 2 = medium, 3 = high. +\ **Note:** Only works on compatibility renderer. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_quaternion.rst b/classes/class_quaternion.rst index 6991799216d..edbc3c40647 100644 --- a/classes/class_quaternion.rst +++ b/classes/class_quaternion.rst @@ -346,9 +346,7 @@ Returns the dot product of two quaternions. :ref:`Quaternion` **exp** **(** **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the exponential of this quaternion. The rotation axis of the result is the normalized rotation axis of this quaternion, the angle of the result is the length of the vector part of this quaternion. .. rst-class:: classref-item-separator @@ -372,9 +370,9 @@ Constructs a Quaternion from Euler angles in YXZ rotation order. :ref:`float` **get_angle** **(** **)** |const| -.. container:: contribute +Returns the angle of the rotation represented by this quaternion. - There is currently no description for this method. Please help us by :ref:`contributing one `! +\ **Note:** The quaternion must be normalized. .. rst-class:: classref-item-separator @@ -386,9 +384,7 @@ Constructs a Quaternion from Euler angles in YXZ rotation order. :ref:`Vector3` **get_axis** **(** **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the rotation axis of the rotation represented by this quaternion. .. rst-class:: classref-item-separator @@ -484,9 +480,7 @@ Returns the length of the quaternion, squared. :ref:`Quaternion` **log** **(** **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the logarithm of this quaternion. The vector part of the result is the rotation axis of this quaternion multiplied by its rotation angle, the real part of the result is zero. .. rst-class:: classref-item-separator diff --git a/classes/class_randomnumbergenerator.rst b/classes/class_randomnumbergenerator.rst index ee5a5c9be94..b55418429e5 100644 --- a/classes/class_randomnumbergenerator.rst +++ b/classes/class_randomnumbergenerator.rst @@ -23,7 +23,7 @@ RandomNumberGenerator is a class for generating pseudo-random numbers. It curren \ **Note:** The underlying algorithm is an implementation detail and should not be depended upon. -To generate a random float number (within a given range) based on a time-dependant seed: +To generate a random float number (within a given range) based on a time-dependent seed: :: diff --git a/classes/class_raycast2d.rst b/classes/class_raycast2d.rst index 0a4d7b38bce..2f63fbcd354 100644 --- a/classes/class_raycast2d.rst +++ b/classes/class_raycast2d.rst @@ -19,7 +19,7 @@ A ray in 2D space, used to find the first :ref:`CollisionObject2D` that finds the closest :ref:`CollisionObject2D` along its path, if it intersects any. This is useful for a lot of things, such as +A raycast represents a ray from its origin to its :ref:`target_position` that finds the closest :ref:`CollisionObject2D` along its path, if it intersects any. \ **RayCast2D** can ignore some objects by adding them to an exception list, by making its detection reporting ignore :ref:`Area2D`\ s (:ref:`collide_with_areas`) or :ref:`PhysicsBody2D`\ s (:ref:`collide_with_bodies`), or by configuring physics layers. @@ -345,7 +345,7 @@ Returns the normal of the intersecting object's shape at the collision point, or :ref:`Vector2` **get_collision_point** **(** **)** |const| -Returns the collision point at which the ray intersects the closest object. +Returns the collision point at which the ray intersects the closest object. If :ref:`hit_from_inside` is ``true`` and the ray starts inside of a collision shape, this function will return the origin point of the ray. \ **Note:** This point is in the **global** coordinate system. diff --git a/classes/class_raycast3d.rst b/classes/class_raycast3d.rst index 664d381a801..9ec0c5ced01 100644 --- a/classes/class_raycast3d.rst +++ b/classes/class_raycast3d.rst @@ -19,7 +19,7 @@ A ray in 3D space, used to find the first :ref:`CollisionObject3D` that finds the closest :ref:`CollisionObject3D` along its path, if it intersects any. This is useful for a lot of things, such as +A raycast represents a ray from its origin to its :ref:`target_position` that finds the closest :ref:`CollisionObject3D` along its path, if it intersects any. \ **RayCast3D** can ignore some objects by adding them to an exception list, by making its detection reporting ignore :ref:`Area3D`\ s (:ref:`collide_with_areas`) or :ref:`PhysicsBody3D`\ s (:ref:`collide_with_bodies`), or by configuring physics layers. @@ -420,7 +420,7 @@ Returns the normal of the intersecting object's shape at the collision point, or :ref:`Vector3` **get_collision_point** **(** **)** |const| -Returns the collision point at which the ray intersects the closest object. +Returns the collision point at which the ray intersects the closest object. If :ref:`hit_from_inside` is ``true`` and the ray starts inside of a collision shape, this function will return the origin point of the ray. \ **Note:** This point is in the **global** coordinate system. diff --git a/classes/class_rdpipelinedepthstencilstate.rst b/classes/class_rdpipelinedepthstencilstate.rst index 1a4aa01071f..325ff3d0a64 100644 --- a/classes/class_rdpipelinedepthstencilstate.rst +++ b/classes/class_rdpipelinedepthstencilstate.rst @@ -93,9 +93,7 @@ Property Descriptions - void **set_back_op_compare** **(** :ref:`CompareOperator` value **)** - :ref:`CompareOperator` **get_back_op_compare** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The method used for comparing the previous back stencil value and :ref:`back_op_reference`. .. rst-class:: classref-item-separator @@ -112,9 +110,7 @@ Property Descriptions - void **set_back_op_compare_mask** **(** :ref:`int` value **)** - :ref:`int` **get_back_op_compare_mask** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +Selects which bits from the back stencil value will be compared. .. rst-class:: classref-item-separator @@ -131,9 +127,7 @@ Property Descriptions - void **set_back_op_depth_fail** **(** :ref:`StencilOperation` value **)** - :ref:`StencilOperation` **get_back_op_depth_fail** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The operation to perform on the stencil buffer for back pixels that pass the stencil test but fail the depth test. .. rst-class:: classref-item-separator @@ -150,9 +144,7 @@ Property Descriptions - void **set_back_op_fail** **(** :ref:`StencilOperation` value **)** - :ref:`StencilOperation` **get_back_op_fail** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The operation to perform on the stencil buffer for back pixels that fail the stencil test .. rst-class:: classref-item-separator @@ -169,9 +161,7 @@ Property Descriptions - void **set_back_op_pass** **(** :ref:`StencilOperation` value **)** - :ref:`StencilOperation` **get_back_op_pass** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The operation to perform on the stencil buffer for back pixels that pass the stencil test. .. rst-class:: classref-item-separator @@ -188,9 +178,7 @@ Property Descriptions - void **set_back_op_reference** **(** :ref:`int` value **)** - :ref:`int` **get_back_op_reference** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The value the previous back stencil value will be compared to. .. rst-class:: classref-item-separator @@ -207,9 +195,7 @@ Property Descriptions - void **set_back_op_write_mask** **(** :ref:`int` value **)** - :ref:`int` **get_back_op_write_mask** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +Selects which bits from the back stencil value will be changed. .. rst-class:: classref-item-separator @@ -226,9 +212,7 @@ Property Descriptions - void **set_depth_compare_operator** **(** :ref:`CompareOperator` value **)** - :ref:`CompareOperator` **get_depth_compare_operator** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The method used for comparing the previous and current depth values. .. rst-class:: classref-item-separator @@ -245,9 +229,7 @@ Property Descriptions - void **set_depth_range_max** **(** :ref:`float` value **)** - :ref:`float` **get_depth_range_max** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The maximum depth that returns true for :ref:`enable_depth_range`. .. rst-class:: classref-item-separator @@ -264,9 +246,7 @@ Property Descriptions - void **set_depth_range_min** **(** :ref:`float` value **)** - :ref:`float` **get_depth_range_min** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The minimum depth that returns true for :ref:`enable_depth_range`. .. rst-class:: classref-item-separator @@ -283,9 +263,7 @@ Property Descriptions - void **set_enable_depth_range** **(** :ref:`bool` value **)** - :ref:`bool` **get_enable_depth_range** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If ``true``, each depth value will be tested to see if it is between :ref:`depth_range_min` and :ref:`depth_range_max`. If it is outside of these values, it is discarded. .. rst-class:: classref-item-separator @@ -319,9 +297,7 @@ If ``true``, enables depth testing which allows objects to be automatically occl - void **set_enable_depth_write** **(** :ref:`bool` value **)** - :ref:`bool` **get_enable_depth_write** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If ``true``, writes to the depth buffer whenever the depth test returns true. Only works when enable_depth_test is also true. .. rst-class:: classref-item-separator @@ -338,9 +314,7 @@ If ``true``, enables depth testing which allows objects to be automatically occl - void **set_enable_stencil** **(** :ref:`bool` value **)** - :ref:`bool` **get_enable_stencil** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If ``true``, enables stencil testing. There are separate stencil buffers for front-facing triangles and back-facing triangles. See properties that begin with "front_op" and properties with "back_op" for each. .. rst-class:: classref-item-separator @@ -357,9 +331,7 @@ If ``true``, enables depth testing which allows objects to be automatically occl - void **set_front_op_compare** **(** :ref:`CompareOperator` value **)** - :ref:`CompareOperator` **get_front_op_compare** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The method used for comparing the previous front stencil value and :ref:`front_op_reference`. .. rst-class:: classref-item-separator @@ -376,9 +348,7 @@ If ``true``, enables depth testing which allows objects to be automatically occl - void **set_front_op_compare_mask** **(** :ref:`int` value **)** - :ref:`int` **get_front_op_compare_mask** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +Selects which bits from the front stencil value will be compared. .. rst-class:: classref-item-separator @@ -395,9 +365,7 @@ If ``true``, enables depth testing which allows objects to be automatically occl - void **set_front_op_depth_fail** **(** :ref:`StencilOperation` value **)** - :ref:`StencilOperation` **get_front_op_depth_fail** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The operation to perform on the stencil buffer for front pixels that pass the stencil test but fail the depth test. .. rst-class:: classref-item-separator @@ -414,9 +382,7 @@ If ``true``, enables depth testing which allows objects to be automatically occl - void **set_front_op_fail** **(** :ref:`StencilOperation` value **)** - :ref:`StencilOperation` **get_front_op_fail** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The operation to perform on the stencil buffer for front pixels that fail the stencil test. .. rst-class:: classref-item-separator @@ -433,9 +399,7 @@ If ``true``, enables depth testing which allows objects to be automatically occl - void **set_front_op_pass** **(** :ref:`StencilOperation` value **)** - :ref:`StencilOperation` **get_front_op_pass** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The operation to perform on the stencil buffer for front pixels that pass the stencil test. .. rst-class:: classref-item-separator @@ -452,9 +416,7 @@ If ``true``, enables depth testing which allows objects to be automatically occl - void **set_front_op_reference** **(** :ref:`int` value **)** - :ref:`int` **get_front_op_reference** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The value the previous front stencil value will be compared to. .. rst-class:: classref-item-separator @@ -471,9 +433,7 @@ If ``true``, enables depth testing which allows objects to be automatically occl - void **set_front_op_write_mask** **(** :ref:`int` value **)** - :ref:`int` **get_front_op_write_mask** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +Selects which bits from the front stencil value will be changed. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_rdpipelinerasterizationstate.rst b/classes/class_rdpipelinerasterizationstate.rst index 05db640ca6c..5da6c838626 100644 --- a/classes/class_rdpipelinerasterizationstate.rst +++ b/classes/class_rdpipelinerasterizationstate.rst @@ -90,9 +90,7 @@ The cull mode to use when drawing polygons, which determines whether front faces - void **set_depth_bias_clamp** **(** :ref:`float` value **)** - :ref:`float` **get_depth_bias_clamp** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +A limit for how much each depth value can be offset. If negative, it serves as a minimum value, but if positive, it serves as a maximum value. .. rst-class:: classref-item-separator @@ -109,9 +107,7 @@ The cull mode to use when drawing polygons, which determines whether front faces - void **set_depth_bias_constant_factor** **(** :ref:`float` value **)** - :ref:`float` **get_depth_bias_constant_factor** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +A constant offset added to each depth value. Applied after :ref:`depth_bias_slope_factor`. .. rst-class:: classref-item-separator @@ -128,9 +124,7 @@ The cull mode to use when drawing polygons, which determines whether front faces - void **set_depth_bias_enabled** **(** :ref:`bool` value **)** - :ref:`bool` **get_depth_bias_enabled** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If ``true``, each generated depth value will by offset by some amount. The specific amount is generated per polygon based on the values of :ref:`depth_bias_slope_factor` and :ref:`depth_bias_constant_factor`. .. rst-class:: classref-item-separator @@ -147,9 +141,7 @@ The cull mode to use when drawing polygons, which determines whether front faces - void **set_depth_bias_slope_factor** **(** :ref:`float` value **)** - :ref:`float` **get_depth_bias_slope_factor** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +A constant scale applied to the slope of each polygons' depth. Applied before :ref:`depth_bias_constant_factor`. .. rst-class:: classref-item-separator @@ -183,9 +175,7 @@ If ``true``, primitives are discarded immediately before the rasterization stage - void **set_enable_depth_clamp** **(** :ref:`bool` value **)** - :ref:`bool` **get_enable_depth_clamp** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If ``true``, clamps depth values according to the minimum and maximum depth of the associated viewport. .. rst-class:: classref-item-separator diff --git a/classes/class_rdsamplerstate.rst b/classes/class_rdsamplerstate.rst index 859590e02c3..eed6a9aa32c 100644 --- a/classes/class_rdsamplerstate.rst +++ b/classes/class_rdsamplerstate.rst @@ -168,7 +168,7 @@ The mipmap LOD bias to use. Positive values will make the sampler blurrier at a - void **set_mag_filter** **(** :ref:`SamplerFilter` value **)** - :ref:`SamplerFilter` **get_mag_filter** **(** **)** -The sampler's magnification filter. +The sampler's magnification filter. It is the filtering method used when sampling texels that appear bigger than on-screen pixels. .. rst-class:: classref-item-separator @@ -202,9 +202,7 @@ The maximum mipmap LOD bias to display (lowest resolution). Only effective if th - void **set_min_filter** **(** :ref:`SamplerFilter` value **)** - :ref:`SamplerFilter` **get_min_filter** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The sampler's minification filter. It is the filtering method used when sampling texels that appear smaller than on-screen pixels. .. rst-class:: classref-item-separator @@ -306,9 +304,7 @@ The repeat mode to use along the W axis of UV coordinates. This affects the retu - void **set_unnormalized_uvw** **(** :ref:`bool` value **)** - :ref:`bool` **get_unnormalized_uvw** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If ``true``, the texture will be sampled with coordinates ranging from 0 to the texture's resolution. Otherwise, the coordinates will be normalized and range from 0 to 1. .. rst-class:: classref-item-separator diff --git a/classes/class_rduniform.rst b/classes/class_rduniform.rst index 8d55f14a34e..5df37ab665a 100644 --- a/classes/class_rduniform.rst +++ b/classes/class_rduniform.rst @@ -105,9 +105,7 @@ Method Descriptions void **add_id** **(** :ref:`RID` id **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Binds the given id to the uniform. The data associated with the id is then used when the uniform is passed to a shader. .. rst-class:: classref-item-separator @@ -119,9 +117,7 @@ void **add_id** **(** :ref:`RID` id **)** void **clear_ids** **(** **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Unbinds all ids currently bound to the uniform. .. rst-class:: classref-item-separator @@ -133,9 +129,7 @@ void **clear_ids** **(** **)** :ref:`RID[]` **get_ids** **(** **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns an array of all ids currently bound to the uniform. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_refcounted.rst b/classes/class_refcounted.rst index 95ae8d6544e..ff22d1cb039 100644 --- a/classes/class_refcounted.rst +++ b/classes/class_refcounted.rst @@ -25,6 +25,8 @@ Base class for any object that keeps a reference count. :ref:`Resource` types, **RefCounted**\ s keep an internal reference counter so that they are automatically released when no longer in use, and only then. **RefCounted**\ s therefore do not need to be freed manually with :ref:`Object.free`. +\ **RefCounted** instances caught in a cyclic reference will **not** be freed automatically. For example, if a node holds a reference to instance ``A``, which directly or indirectly holds a reference back to ``A``, ``A``'s reference count will be 2. Destruction of the node will leave ``A`` dangling with a reference count of 1, and there will be a memory leak. To prevent this, one of the references in the cycle can be made weak with :ref:`@GlobalScope.weakref`. + In the vast majority of use cases, instantiating and using **RefCounted**-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#, reference-counted objects will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free reference-counted objects that are no longer in use. This means that unused ones will linger on for a while before being removed. diff --git a/classes/class_reflectionprobe.rst b/classes/class_reflectionprobe.rst index 78e9391ca9c..84d1fad7cb8 100644 --- a/classes/class_reflectionprobe.rst +++ b/classes/class_reflectionprobe.rst @@ -67,6 +67,8 @@ Properties +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+ | :ref:`Vector3` | :ref:`origin_offset` | ``Vector3(0, 0, 0)`` | +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+ + | :ref:`int` | :ref:`reflection_mask` | ``1048575`` | + +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+ | :ref:`Vector3` | :ref:`size` | ``Vector3(20, 20, 20)`` | +------------------------------------------------------+----------------------------------------------------------------------------------+-------------------------+ | :ref:`UpdateMode` | :ref:`update_mode` | ``0`` | @@ -227,7 +229,9 @@ If ``true``, enables box projection. This makes reflections look more correct in - void **set_cull_mask** **(** :ref:`int` value **)** - :ref:`int` **get_cull_mask** **(** **)** -Sets the cull mask which determines what objects are drawn by this probe. Every :ref:`VisualInstance3D` 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. +Sets the cull mask which determines what objects are drawn by this probe. Every :ref:`VisualInstance3D` with a layer included in this cull mask will be rendered by the probe. It is best to only include large objects which are likely to take up a lot of space in the reflection in order to save on rendering cost. + +This can also be used to prevent an object from reflecting upon itself (for instance, a **ReflectionProbe** centered on a vehicle). .. rst-class:: classref-item-separator @@ -339,6 +343,23 @@ Sets the origin offset to be used when this **ReflectionProbe** is in :ref:`box_ ---- +.. _class_ReflectionProbe_property_reflection_mask: + +.. rst-class:: classref-property + +:ref:`int` **reflection_mask** = ``1048575`` + +.. rst-class:: classref-property-setget + +- void **set_reflection_mask** **(** :ref:`int` value **)** +- :ref:`int` **get_reflection_mask** **(** **)** + +Sets the reflection mask which determines what objects have reflections applied from this probe. Every :ref:`VisualInstance3D` with a layer included in this reflection mask will have reflections applied from this probe. See also :ref:`cull_mask`, which can be used to exclude objects from appearing in the reflection while still making them affected by the **ReflectionProbe**. + +.. rst-class:: classref-item-separator + +---- + .. _class_ReflectionProbe_property_size: .. rst-class:: classref-property diff --git a/classes/class_renderingdevice.rst b/classes/class_renderingdevice.rst index f55afd4f8f0..0e3fae322f4 100644 --- a/classes/class_renderingdevice.rst +++ b/classes/class_renderingdevice.rst @@ -47,17 +47,19 @@ Methods +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`barrier` **(** |bitfield|\<:ref:`BarrierMask`\> from=32767, |bitfield|\<:ref:`BarrierMask`\> to=32767 **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`buffer_clear` **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** | + | :ref:`Error` | :ref:`buffer_clear` **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes **)** | + +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Error` | :ref:`buffer_copy` **(** :ref:`RID` src_buffer, :ref:`RID` dst_buffer, :ref:`int` src_offset, :ref:`int` dst_offset, :ref:`int` size **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedByteArray` | :ref:`buffer_get_data` **(** :ref:`RID` buffer, :ref:`int` offset_bytes=0, :ref:`int` size_bytes=0 **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`buffer_update` **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, :ref:`PackedByteArray` data, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** | + | :ref:`Error` | :ref:`buffer_update` **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, :ref:`PackedByteArray` data **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`capture_timestamp` **(** :ref:`String` name **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`compute_list_add_barrier` **(** :ref:`int` compute_list **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`compute_list_begin` **(** :ref:`bool` allow_draw_overlap=false **)** | + | :ref:`int` | :ref:`compute_list_begin` **(** **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`compute_list_bind_compute_pipeline` **(** :ref:`int` compute_list, :ref:`RID` compute_pipeline **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -65,7 +67,7 @@ Methods +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`compute_list_dispatch` **(** :ref:`int` compute_list, :ref:`int` x_groups, :ref:`int` y_groups, :ref:`int` z_groups **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`compute_list_end` **(** |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** | + | void | :ref:`compute_list_end` **(** **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`compute_list_set_push_constant` **(** :ref:`int` compute_list, :ref:`PackedByteArray` buffer, :ref:`int` size_bytes **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -81,7 +83,7 @@ Methods +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_command_insert_label` **(** :ref:`String` name, :ref:`Color` color **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`draw_list_begin` **(** :ref:`RID` framebuffer, :ref:`InitialAction` initial_color_action, :ref:`FinalAction` final_color_action, :ref:`InitialAction` initial_depth_action, :ref:`FinalAction` final_depth_action, :ref:`PackedColorArray` clear_color_values=PackedColorArray(), :ref:`float` clear_depth=1.0, :ref:`int` clear_stencil=0, :ref:`Rect2` region=Rect2(0, 0, 0, 0), :ref:`RID[]` storage_textures=[] **)** | + | :ref:`int` | :ref:`draw_list_begin` **(** :ref:`RID` framebuffer, :ref:`InitialAction` initial_color_action, :ref:`FinalAction` final_color_action, :ref:`InitialAction` initial_depth_action, :ref:`FinalAction` final_depth_action, :ref:`PackedColorArray` clear_color_values=PackedColorArray(), :ref:`float` clear_depth=1.0, :ref:`int` clear_stencil=0, :ref:`Rect2` region=Rect2(0, 0, 0, 0) **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`draw_list_begin_for_screen` **(** :ref:`int` screen=0, :ref:`Color` clear_color=Color(0, 0, 0, 1) **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -101,7 +103,7 @@ Methods +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_list_enable_scissor` **(** :ref:`int` draw_list, :ref:`Rect2` rect=Rect2(0, 0, 0, 0) **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`draw_list_end` **(** |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** | + | void | :ref:`draw_list_end` **(** **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_list_set_blend_constants` **(** :ref:`int` draw_list, :ref:`Color` color **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -197,9 +199,9 @@ Methods +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`texture_buffer_create` **(** :ref:`int` size_bytes, :ref:`DataFormat` format, :ref:`PackedByteArray` data=PackedByteArray() **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`texture_clear` **(** :ref:`RID` texture, :ref:`Color` color, :ref:`int` base_mipmap, :ref:`int` mipmap_count, :ref:`int` base_layer, :ref:`int` layer_count, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** | + | :ref:`Error` | :ref:`texture_clear` **(** :ref:`RID` texture, :ref:`Color` color, :ref:`int` base_mipmap, :ref:`int` mipmap_count, :ref:`int` base_layer, :ref:`int` layer_count **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`texture_copy` **(** :ref:`RID` from_texture, :ref:`RID` to_texture, :ref:`Vector3` from_pos, :ref:`Vector3` to_pos, :ref:`Vector3` size, :ref:`int` src_mipmap, :ref:`int` dst_mipmap, :ref:`int` src_layer, :ref:`int` dst_layer, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** | + | :ref:`Error` | :ref:`texture_copy` **(** :ref:`RID` from_texture, :ref:`RID` to_texture, :ref:`Vector3` from_pos, :ref:`Vector3` to_pos, :ref:`Vector3` size, :ref:`int` src_mipmap, :ref:`int` dst_mipmap, :ref:`int` src_layer, :ref:`int` dst_layer **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`texture_create` **(** :ref:`RDTextureFormat` format, :ref:`RDTextureView` view, :ref:`PackedByteArray[]` data=[] **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -221,9 +223,9 @@ Methods +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`texture_is_valid` **(** :ref:`RID` texture **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`texture_resolve_multisample` **(** :ref:`RID` from_texture, :ref:`RID` to_texture, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** | + | :ref:`Error` | :ref:`texture_resolve_multisample` **(** :ref:`RID` from_texture, :ref:`RID` to_texture **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Error` | :ref:`texture_update` **(** :ref:`RID` texture, :ref:`int` layer, :ref:`PackedByteArray` data, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** | + | :ref:`Error` | :ref:`texture_update` **(** :ref:`RID` texture, :ref:`int` layer, :ref:`PackedByteArray` data **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`uniform_buffer_create` **(** :ref:`int` size_bytes, :ref:`PackedByteArray` data=PackedByteArray() **)** | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -311,13 +313,133 @@ Represents the size of the :ref:`DeviceType` en enum **DriverResource**: +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_LOGICAL_DEVICE: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_LOGICAL_DEVICE** = ``0`` + +Specific device object based on a physical device. + +- Vulkan: Vulkan device driver resource (``VkDevice``). (``rid`` argument doesn't apply.) + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_PHYSICAL_DEVICE: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_PHYSICAL_DEVICE** = ``1`` + +Physical device the specific logical device is based on. + +- Vulkan: ``VkDevice``. (``rid`` argument doesn't apply.) + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_TOPMOST_OBJECT: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_TOPMOST_OBJECT** = ``2`` + +Top-most graphics API entry object. + +- Vulkan: ``VkInstance``. (``rid`` argument doesn't apply.) + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_COMMAND_QUEUE: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_COMMAND_QUEUE** = ``3`` + +The main graphics-compute command queue. + +- Vulkan: ``VkQueue``. (``rid`` argument doesn't apply.) + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_QUEUE_FAMILY: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_QUEUE_FAMILY** = ``4`` + +The specific family the main queue belongs to. + +- Vulkan: the queue family index, an ``uint32_t``. (``rid`` argument doesn't apply.) + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_TEXTURE: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_TEXTURE** = ``5`` + +- Vulkan: ``VkImage``. + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_TEXTURE_VIEW: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_TEXTURE_VIEW** = ``6`` + +The view of an owned or shared texture. + +- Vulkan: ``VkImageView``. + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_TEXTURE_DATA_FORMAT: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_TEXTURE_DATA_FORMAT** = ``7`` + +The native id of the data format of the texture. + +- Vulkan: ``VkFormat``. + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_SAMPLER: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_SAMPLER** = ``8`` + +- Vulkan: ``VkSampler``. + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_UNIFORM_SET: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_UNIFORM_SET** = ``9`` + +- Vulkan: ``VkDescriptorSet``. + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_BUFFER: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_BUFFER** = ``10`` + +Buffer of any kind of (storage, vertex, etc.). + +- Vulkan: ``VkBuffer``. + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_COMPUTE_PIPELINE: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_COMPUTE_PIPELINE** = ``11`` + +- Vulkan: ``VkPipeline``. + +.. _class_RenderingDevice_constant_DRIVER_RESOURCE_RENDER_PIPELINE: + +.. rst-class:: classref-enumeration-constant + +:ref:`DriverResource` **DRIVER_RESOURCE_RENDER_PIPELINE** = ``12`` + +- Vulkan: ``VkPipeline``. + .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_DEVICE: .. rst-class:: classref-enumeration-constant :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_DEVICE** = ``0`` -Vulkan device driver resource. This is a "global" resource and ignores the RID passed in +*Deprecated.* Use :ref:`DRIVER_RESOURCE_LOGICAL_DEVICE`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_PHYSICAL_DEVICE: @@ -325,7 +447,7 @@ Vulkan device driver resource. This is a "global" resource and ignores the RID p :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_PHYSICAL_DEVICE** = ``1`` -Physical device (graphics card) driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_PHYSICAL_DEVICE`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_INSTANCE: @@ -333,7 +455,7 @@ Physical device (graphics card) driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_INSTANCE** = ``2`` -Vulkan instance driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_TOPMOST_OBJECT`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_QUEUE: @@ -341,7 +463,7 @@ Vulkan instance driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_QUEUE** = ``3`` -Vulkan queue driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_COMMAND_QUEUE`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_QUEUE_FAMILY_INDEX: @@ -349,7 +471,7 @@ Vulkan queue driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_QUEUE_FAMILY_INDEX** = ``4`` -Vulkan queue family index driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_QUEUE_FAMILY`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_IMAGE: @@ -357,7 +479,7 @@ Vulkan queue family index driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_IMAGE** = ``5`` -Vulkan image driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_TEXTURE`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_IMAGE_VIEW: @@ -365,7 +487,7 @@ Vulkan image driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_IMAGE_VIEW** = ``6`` -Vulkan image view driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_TEXTURE_VIEW`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_IMAGE_NATIVE_TEXTURE_FORMAT: @@ -373,7 +495,7 @@ Vulkan image view driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_IMAGE_NATIVE_TEXTURE_FORMAT** = ``7`` -Vulkan image native texture format driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_TEXTURE_DATA_FORMAT`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_SAMPLER: @@ -381,7 +503,7 @@ Vulkan image native texture format driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_SAMPLER** = ``8`` -Vulkan sampler driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_SAMPLER`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_DESCRIPTOR_SET: @@ -389,7 +511,7 @@ Vulkan sampler driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_DESCRIPTOR_SET** = ``9`` -Vulkan `descriptor set `__ driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_UNIFORM_SET`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_BUFFER: @@ -397,7 +519,7 @@ Vulkan `descriptor set `__ driv :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_BUFFER** = ``10`` -Vulkan buffer driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_BUFFER`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_COMPUTE_PIPELINE: @@ -405,7 +527,7 @@ Vulkan buffer driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_COMPUTE_PIPELINE** = ``11`` -Vulkan compute pipeline driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_COMPUTE_PIPELINE`. .. _class_RenderingDevice_constant_DRIVER_RESOURCE_VULKAN_RENDER_PIPELINE: @@ -413,7 +535,7 @@ Vulkan compute pipeline driver resource. :ref:`DriverResource` **DRIVER_RESOURCE_VULKAN_RENDER_PIPELINE** = ``12`` -Vulkan render pipeline driver resource. +*Deprecated.* Use :ref:`DRIVER_RESOURCE_RENDER_PIPELINE`. .. rst-class:: classref-item-separator @@ -2809,6 +2931,10 @@ flags **StorageBufferUsage**: :ref:`StorageBufferUsage` **STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -3639,6 +3765,10 @@ flags **PipelineDynamicStateFlags**: :ref:`PipelineDynamicStateFlags` **DYNAMIC_STATE_LINE_WIDTH** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingDevice_constant_DYNAMIC_STATE_DEPTH_BIAS: @@ -3647,6 +3777,10 @@ flags **PipelineDynamicStateFlags**: :ref:`PipelineDynamicStateFlags` **DYNAMIC_STATE_DEPTH_BIAS** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingDevice_constant_DYNAMIC_STATE_BLEND_CONSTANTS: @@ -3655,6 +3789,10 @@ flags **PipelineDynamicStateFlags**: :ref:`PipelineDynamicStateFlags` **DYNAMIC_STATE_BLEND_CONSTANTS** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingDevice_constant_DYNAMIC_STATE_DEPTH_BOUNDS: @@ -3663,6 +3801,10 @@ flags **PipelineDynamicStateFlags**: :ref:`PipelineDynamicStateFlags` **DYNAMIC_STATE_DEPTH_BOUNDS** = ``8`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingDevice_constant_DYNAMIC_STATE_STENCIL_COMPARE_MASK: @@ -3671,6 +3813,10 @@ flags **PipelineDynamicStateFlags**: :ref:`PipelineDynamicStateFlags` **DYNAMIC_STATE_STENCIL_COMPARE_MASK** = ``16`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingDevice_constant_DYNAMIC_STATE_STENCIL_WRITE_MASK: @@ -3679,6 +3825,10 @@ flags **PipelineDynamicStateFlags**: :ref:`PipelineDynamicStateFlags` **DYNAMIC_STATE_STENCIL_WRITE_MASK** = ``32`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingDevice_constant_DYNAMIC_STATE_STENCIL_REFERENCE: @@ -3687,6 +3837,10 @@ flags **PipelineDynamicStateFlags**: :ref:`PipelineDynamicStateFlags` **DYNAMIC_STATE_STENCIL_REFERENCE** = ``64`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -3699,13 +3853,37 @@ flags **PipelineDynamicStateFlags**: enum **InitialAction**: +.. _class_RenderingDevice_constant_INITIAL_ACTION_LOAD: + +.. rst-class:: classref-enumeration-constant + +:ref:`InitialAction` **INITIAL_ACTION_LOAD** = ``0`` + +Load the previous contents of the framebuffer. + .. _class_RenderingDevice_constant_INITIAL_ACTION_CLEAR: .. rst-class:: classref-enumeration-constant -:ref:`InitialAction` **INITIAL_ACTION_CLEAR** = ``0`` +:ref:`InitialAction` **INITIAL_ACTION_CLEAR** = ``1`` + +Clear the whole framebuffer or its specified region. + +.. _class_RenderingDevice_constant_INITIAL_ACTION_DISCARD: + +.. rst-class:: classref-enumeration-constant + +:ref:`InitialAction` **INITIAL_ACTION_DISCARD** = ``2`` + +Ignore the previous contents of the framebuffer. This is the fastest option if you'll overwrite all of the pixels and don't need to read any of them. + +.. _class_RenderingDevice_constant_INITIAL_ACTION_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`InitialAction` **INITIAL_ACTION_MAX** = ``3`` -Start rendering and clear the whole framebuffer. +Represents the size of the :ref:`InitialAction` enum. .. _class_RenderingDevice_constant_INITIAL_ACTION_CLEAR_REGION: @@ -3713,47 +3891,39 @@ Start rendering and clear the whole framebuffer. :ref:`InitialAction` **INITIAL_ACTION_CLEAR_REGION** = ``1`` -Start rendering and clear the framebuffer in the specified region. +*Deprecated.* Use :ref:`INITIAL_ACTION_CLEAR` instead. .. _class_RenderingDevice_constant_INITIAL_ACTION_CLEAR_REGION_CONTINUE: .. rst-class:: classref-enumeration-constant -:ref:`InitialAction` **INITIAL_ACTION_CLEAR_REGION_CONTINUE** = ``2`` +:ref:`InitialAction` **INITIAL_ACTION_CLEAR_REGION_CONTINUE** = ``1`` -Continue rendering and clear the framebuffer in the specified region. Framebuffer must have been left in :ref:`FINAL_ACTION_CONTINUE` state as the final action previously. +*Deprecated.* Use :ref:`INITIAL_ACTION_LOAD` instead. .. _class_RenderingDevice_constant_INITIAL_ACTION_KEEP: .. rst-class:: classref-enumeration-constant -:ref:`InitialAction` **INITIAL_ACTION_KEEP** = ``3`` +:ref:`InitialAction` **INITIAL_ACTION_KEEP** = ``0`` -Start rendering, but keep attached color texture contents. If the framebuffer was previously used to read in a shader, this will automatically insert a layout transition. +*Deprecated.* Use :ref:`INITIAL_ACTION_LOAD` instead. .. _class_RenderingDevice_constant_INITIAL_ACTION_DROP: .. rst-class:: classref-enumeration-constant -:ref:`InitialAction` **INITIAL_ACTION_DROP** = ``4`` +:ref:`InitialAction` **INITIAL_ACTION_DROP** = ``2`` -Start rendering, ignore what is there; write above it. In general, this is the fastest option when you will be writing every single pixel and you don't need a clear color. +*Deprecated.* Use :ref:`INITIAL_ACTION_DISCARD` instead. .. _class_RenderingDevice_constant_INITIAL_ACTION_CONTINUE: .. rst-class:: classref-enumeration-constant -:ref:`InitialAction` **INITIAL_ACTION_CONTINUE** = ``5`` - -Continue rendering. Framebuffer must have been left in :ref:`FINAL_ACTION_CONTINUE` state as the final action previously. +:ref:`InitialAction` **INITIAL_ACTION_CONTINUE** = ``0`` -.. _class_RenderingDevice_constant_INITIAL_ACTION_MAX: - -.. rst-class:: classref-enumeration-constant - -:ref:`InitialAction` **INITIAL_ACTION_MAX** = ``6`` - -Represents the size of the :ref:`InitialAction` enum. +*Deprecated.* Use :ref:`INITIAL_ACTION_LOAD` instead. .. rst-class:: classref-item-separator @@ -3765,13 +3935,13 @@ Represents the size of the :ref:`InitialAction` **FINAL_ACTION_READ** = ``0`` +:ref:`FinalAction` **FINAL_ACTION_STORE** = ``0`` -Store the texture for reading and make it read-only if it has the :ref:`TEXTURE_USAGE_SAMPLING_BIT` bit (only applies to color, depth and stencil attachments). +Store the result of the draw list in the framebuffer. This is generally what you want to do. .. _class_RenderingDevice_constant_FINAL_ACTION_DISCARD: @@ -3779,23 +3949,31 @@ Store the texture for reading and make it read-only if it has the :ref:`TEXTURE_ :ref:`FinalAction` **FINAL_ACTION_DISCARD** = ``1`` -Discard the texture data and make it read-only if it has the :ref:`TEXTURE_USAGE_SAMPLING_BIT` bit (only applies to color, depth and stencil attachments). +Discard the contents of the framebuffer. This is the fastest option if you don't need to use the results of the draw list. -.. _class_RenderingDevice_constant_FINAL_ACTION_CONTINUE: +.. _class_RenderingDevice_constant_FINAL_ACTION_MAX: .. rst-class:: classref-enumeration-constant -:ref:`FinalAction` **FINAL_ACTION_CONTINUE** = ``2`` +:ref:`FinalAction` **FINAL_ACTION_MAX** = ``2`` -Store the texture and continue for further processing. Similar to :ref:`FINAL_ACTION_READ`, but does not make the texture read-only if it has the :ref:`TEXTURE_USAGE_SAMPLING_BIT` bit. +Represents the size of the :ref:`FinalAction` enum. -.. _class_RenderingDevice_constant_FINAL_ACTION_MAX: +.. _class_RenderingDevice_constant_FINAL_ACTION_READ: .. rst-class:: classref-enumeration-constant -:ref:`FinalAction` **FINAL_ACTION_MAX** = ``3`` +:ref:`FinalAction` **FINAL_ACTION_READ** = ``0`` -Represents the size of the :ref:`FinalAction` enum. +*Deprecated.* Use :ref:`FINAL_ACTION_STORE` instead. + +.. _class_RenderingDevice_constant_FINAL_ACTION_CONTINUE: + +.. rst-class:: classref-enumeration-constant + +:ref:`FinalAction` **FINAL_ACTION_CONTINUE** = ``0`` + +*Deprecated.* Use :ref:`FINAL_ACTION_STORE` instead. .. rst-class:: classref-item-separator @@ -4335,7 +4513,7 @@ Method Descriptions void **barrier** **(** |bitfield|\<:ref:`BarrierMask`\> from=32767, |bitfield|\<:ref:`BarrierMask`\> to=32767 **)** -Puts a memory barrier in place. This is used for synchronization to avoid data races. See also :ref:`full_barrier`, which may be useful for debugging. +*Deprecated.* Barriers are automatically inserted by RenderingDevice. .. rst-class:: classref-item-separator @@ -4345,9 +4523,9 @@ Puts a memory barrier in place. This is used for synchronization to avoid data r .. rst-class:: classref-method -:ref:`Error` **buffer_clear** **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** +:ref:`Error` **buffer_clear** **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes **)** -Clears the contents of the ``buffer``, clearing ``size_bytes`` bytes, starting at ``offset``. Always raises a memory barrier. +Clears the contents of the ``buffer``, clearing ``size_bytes`` bytes, starting at ``offset``. Prints an error if: @@ -4363,6 +4541,26 @@ Prints an error if: ---- +.. _class_RenderingDevice_method_buffer_copy: + +.. rst-class:: classref-method + +:ref:`Error` **buffer_copy** **(** :ref:`RID` src_buffer, :ref:`RID` dst_buffer, :ref:`int` src_offset, :ref:`int` dst_offset, :ref:`int` size **)** + +Copies ``size`` bytes from the ``src_buffer`` at ``src_offset`` into ``dst_buffer`` at ``dst_offset``. + +Prints an error if: + +- ``size`` exceeds the size of either ``src_buffer`` or ``dst_buffer`` at their corresponding offsets + +- a draw list is currently active (created by :ref:`draw_list_begin`) + +- a compute list is currently active (created by :ref:`compute_list_begin`) + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingDevice_method_buffer_get_data: .. rst-class:: classref-method @@ -4379,9 +4577,9 @@ Returns a copy of the data of the specified ``buffer``, optionally ``offset_byte .. rst-class:: classref-method -:ref:`Error` **buffer_update** **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, :ref:`PackedByteArray` data, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** +:ref:`Error` **buffer_update** **(** :ref:`RID` buffer, :ref:`int` offset, :ref:`int` size_bytes, :ref:`PackedByteArray` data **)** -Updates a region of ``size_bytes`` bytes, starting at ``offset``, in the buffer, with the specified ``data``. Raises a memory barrier except when ``post_barrier`` is set to :ref:`BARRIER_MASK_NO_BARRIER`. +Updates a region of ``size_bytes`` bytes, starting at ``offset``, in the buffer, with the specified ``data``. Prints an error if: @@ -4423,11 +4621,11 @@ Raises a Vulkan compute barrier in the specified ``compute_list``. .. rst-class:: classref-method -:ref:`int` **compute_list_begin** **(** :ref:`bool` allow_draw_overlap=false **)** +:ref:`int` **compute_list_begin** **(** **)** Starts a list of compute commands created with the ``compute_*`` methods. The returned value should be passed to other ``compute_list_*`` functions. -If ``allow_draw_overlap`` is ``true``, you may have one draw list running at the same time as one compute list. Multiple compute lists cannot be created at the same time; you must finish the previous compute list first using :ref:`compute_list_end`. +Multiple compute lists cannot be created at the same time; you must finish the previous compute list first using :ref:`compute_list_end`. A simple compute operation might look like this (code is not a complete example): @@ -4491,7 +4689,7 @@ Submits the compute list for processing on the GPU. This is the compute equivale .. rst-class:: classref-method -void **compute_list_end** **(** |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** +void **compute_list_end** **(** **)** Finishes a list of compute commands created with the ``compute_*`` methods. @@ -4557,7 +4755,7 @@ void **draw_command_begin_label** **(** :ref:`String` name, :ref:` Create a command buffer debug label region that can be displayed in third-party tools such as `RenderDoc `__. All regions must be ended with a :ref:`draw_command_end_label` call. When viewed from the linear series of submissions to a single queue, calls to :ref:`draw_command_begin_label` and :ref:`draw_command_end_label` must be matched and balanced. -The ``VK_EXT_DEBUG_UTILS_EXTENSION_NAME`` Vulkan extension must be available and enabled for command buffer debug label region to work. See also :ref:`draw_command_insert_label` and :ref:`draw_command_end_label`. +The ``VK_EXT_DEBUG_UTILS_EXTENSION_NAME`` Vulkan extension must be available and enabled for command buffer debug label region to work. See also :ref:`draw_command_end_label`. .. rst-class:: classref-item-separator @@ -4581,7 +4779,7 @@ Ends the command buffer debug label region started by a :ref:`draw_command_begin void **draw_command_insert_label** **(** :ref:`String` name, :ref:`Color` color **)** -Inserts a command buffer debug label region in the current command buffer. Unlike :ref:`draw_command_begin_label`, this region should not be ended with a :ref:`draw_command_end_label` call. +*Deprecated.* Inserting labels no longer applies due to command reordering. .. rst-class:: classref-item-separator @@ -4591,7 +4789,7 @@ Inserts a command buffer debug label region in the current command buffer. Unlik .. rst-class:: classref-method -:ref:`int` **draw_list_begin** **(** :ref:`RID` framebuffer, :ref:`InitialAction` initial_color_action, :ref:`FinalAction` final_color_action, :ref:`InitialAction` initial_depth_action, :ref:`FinalAction` final_depth_action, :ref:`PackedColorArray` clear_color_values=PackedColorArray(), :ref:`float` clear_depth=1.0, :ref:`int` clear_stencil=0, :ref:`Rect2` region=Rect2(0, 0, 0, 0), :ref:`RID[]` storage_textures=[] **)** +:ref:`int` **draw_list_begin** **(** :ref:`RID` framebuffer, :ref:`InitialAction` initial_color_action, :ref:`FinalAction` final_color_action, :ref:`InitialAction` initial_depth_action, :ref:`FinalAction` final_depth_action, :ref:`PackedColorArray` clear_color_values=PackedColorArray(), :ref:`float` clear_depth=1.0, :ref:`int` clear_stencil=0, :ref:`Rect2` region=Rect2(0, 0, 0, 0) **)** Starts a list of raster drawing commands created with the ``draw_*`` methods. The returned value should be passed to other ``draw_list_*`` functions. @@ -4602,7 +4800,7 @@ A simple drawing operation might look like this (code is not a complete example) :: var rd = RenderingDevice.new() - var clear_colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0)] + var clear_colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0)]) var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors) # Draw opaque. @@ -4642,7 +4840,7 @@ High-level variant of :ref:`draw_list_begin` **draw_list_begin_split** **(** :ref:`RID` framebuffer, :ref:`int` splits, :ref:`InitialAction` initial_color_action, :ref:`FinalAction` final_color_action, :ref:`InitialAction` initial_depth_action, :ref:`FinalAction` final_depth_action, :ref:`PackedColorArray` clear_color_values=PackedColorArray(), :ref:`float` clear_depth=1.0, :ref:`int` clear_stencil=0, :ref:`Rect2` region=Rect2(0, 0, 0, 0), :ref:`RID[]` storage_textures=[] **)** -Variant of :ref:`draw_list_begin` with support for multiple splits. The ``splits`` parameter determines how many splits are created. +*Deprecated.* Split draw lists are used automatically by RenderingDevice. .. rst-class:: classref-item-separator @@ -4738,7 +4936,7 @@ Creates a scissor rectangle and enables it for the specified ``draw_list``. Scis .. rst-class:: classref-method -void **draw_list_end** **(** |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** +void **draw_list_end** **(** **)** Finishes a list of raster drawing commands created with the ``draw_*`` methods. @@ -4776,7 +4974,7 @@ Sets the push constant data to ``buffer`` for the specified ``draw_list``. The s :ref:`int` **draw_list_switch_to_next_pass** **(** **)** -Switches to the next draw pass and returns the split's ID. Equivalent to :ref:`draw_list_switch_to_next_pass_split` with ``splits`` set to ``1``. +Switches to the next draw pass. .. rst-class:: classref-item-separator @@ -4788,7 +4986,7 @@ Switches to the next draw pass and returns the split's ID. Equivalent to :ref:`d :ref:`PackedInt64Array` **draw_list_switch_to_next_pass_split** **(** :ref:`int` splits **)** -Switches to the next draw pass, with the number of splits allocated specified in ``splits``. The return value is an array containing the ID of each split. For single-split usage, see :ref:`draw_list_switch_to_next_pass`. +*Deprecated.* Split draw lists are used automatically by RenderingDevice. .. rst-class:: classref-item-separator @@ -4928,7 +5126,7 @@ Tries to free an object in the RenderingDevice. To avoid memory leaks, this shou void **full_barrier** **(** **)** -Puts a *full* memory barrier in place. This is a memory :ref:`barrier` with all flags enabled. :ref:`full_barrier` it should only be used for debugging as it can severely impact performance. +*Deprecated.* Barriers are automatically inserted by RenderingDevice. .. rst-class:: classref-item-separator @@ -5360,7 +5558,7 @@ Once finished with your RID, you will want to free the RID using the RenderingDe .. rst-class:: classref-method -:ref:`Error` **texture_clear** **(** :ref:`RID` texture, :ref:`Color` color, :ref:`int` base_mipmap, :ref:`int` mipmap_count, :ref:`int` base_layer, :ref:`int` layer_count, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** +:ref:`Error` **texture_clear** **(** :ref:`RID` texture, :ref:`Color` color, :ref:`int` base_mipmap, :ref:`int` mipmap_count, :ref:`int` base_layer, :ref:`int` layer_count **)** Clears the specified ``texture`` by replacing all of its pixels with the specified ``color``. ``base_mipmap`` and ``mipmap_count`` determine which mipmaps of the texture are affected by this clear operation, while ``base_layer`` and ``layer_count`` determine which layers of a 3D texture (or texture array) are affected by this clear operation. For 2D textures (which only have one layer by design), ``base_layer`` must be ``0`` and ``layer_count`` must be ``1``. @@ -5374,7 +5572,7 @@ Clears the specified ``texture`` by replacing all of its pixels with the specifi .. rst-class:: classref-method -:ref:`Error` **texture_copy** **(** :ref:`RID` from_texture, :ref:`RID` to_texture, :ref:`Vector3` from_pos, :ref:`Vector3` to_pos, :ref:`Vector3` size, :ref:`int` src_mipmap, :ref:`int` dst_mipmap, :ref:`int` src_layer, :ref:`int` dst_layer, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** +:ref:`Error` **texture_copy** **(** :ref:`RID` from_texture, :ref:`RID` to_texture, :ref:`Vector3` from_pos, :ref:`Vector3` to_pos, :ref:`Vector3` size, :ref:`int` src_mipmap, :ref:`int` dst_mipmap, :ref:`int` src_layer, :ref:`int` dst_layer **)** Copies the ``from_texture`` to ``to_texture`` with the specified ``from_pos``, ``to_pos`` and ``size`` coordinates. The Z axis of the ``from_pos``, ``to_pos`` and ``size`` must be ``0`` for 2-dimensional textures. Source and destination mipmaps/layers must also be specified, with these parameters being ``0`` for textures without mipmaps or single-layer textures. Returns :ref:`@GlobalScope.OK` if the texture copy was successful or :ref:`@GlobalScope.ERR_INVALID_PARAMETER` otherwise. @@ -5486,6 +5684,8 @@ Returns the internal graphics handle for this texture object. For use when commu \ **Note:** This function returns a ``uint64_t`` which internally maps to a ``GLuint`` (OpenGL) or ``VkImage`` (Vulkan). +\ *Deprecated.* Use :ref:`get_driver_resource` with :ref:`DRIVER_RESOURCE_TEXTURE` instead. + .. rst-class:: classref-item-separator ---- @@ -5530,7 +5730,7 @@ Returns ``true`` if the ``texture`` is valid, ``false`` otherwise. .. rst-class:: classref-method -:ref:`Error` **texture_resolve_multisample** **(** :ref:`RID` from_texture, :ref:`RID` to_texture, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** +:ref:`Error` **texture_resolve_multisample** **(** :ref:`RID` from_texture, :ref:`RID` to_texture **)** Resolves the ``from_texture`` texture onto ``to_texture`` with multisample antialiasing enabled. This must be used when rendering a framebuffer for MSAA to work. Returns :ref:`@GlobalScope.OK` if successful, :ref:`@GlobalScope.ERR_INVALID_PARAMETER` otherwise. @@ -5556,7 +5756,7 @@ Resolves the ``from_texture`` texture onto ``to_texture`` with multisample antia .. rst-class:: classref-method -:ref:`Error` **texture_update** **(** :ref:`RID` texture, :ref:`int` layer, :ref:`PackedByteArray` data, |bitfield|\<:ref:`BarrierMask`\> post_barrier=32767 **)** +:ref:`Error` **texture_update** **(** :ref:`RID` texture, :ref:`int` layer, :ref:`PackedByteArray` data **)** Updates texture data with new data, replacing the previous data in place. The updated texture data must have the same dimensions and format. For 2D textures (which only have one layer), ``layer`` must be ``0``. Returns :ref:`@GlobalScope.OK` if the update was successful, :ref:`@GlobalScope.ERR_INVALID_PARAMETER` otherwise. diff --git a/classes/class_renderingserver.rst b/classes/class_renderingserver.rst index 54fec469c18..d117a84a996 100644 --- a/classes/class_renderingserver.rst +++ b/classes/class_renderingserver.rst @@ -267,6 +267,8 @@ Methods +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RenderingDevice` | :ref:`create_local_rendering_device` **(** **)** |const| | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2` | :ref:`debug_canvas_item_get_rect` **(** :ref:`RID` item **)** | + +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`decal_create` **(** **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`decal_set_albedo_mix` **(** :ref:`RID` decal, :ref:`float` albedo_mix **)** | @@ -745,6 +747,8 @@ Methods +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`reflection_probe_set_origin_offset` **(** :ref:`RID` probe, :ref:`Vector3` offset **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`reflection_probe_set_reflection_mask` **(** :ref:`RID` probe, :ref:`int` layers **)** | + +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`reflection_probe_set_resolution` **(** :ref:`RID` probe, :ref:`int` resolution **)** | +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`reflection_probe_set_size` **(** :ref:`RID` probe, :ref:`Vector3` size **)** | @@ -1508,6 +1512,10 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_BLEND_SHAPE_MASK** = ``7`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM_BASE: @@ -1516,6 +1524,10 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM_BASE** = ``13`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM_BITS: @@ -1524,6 +1536,10 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM_BITS** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM0_SHIFT: @@ -1532,6 +1548,10 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM0_SHIFT** = ``13`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM1_SHIFT: @@ -1540,6 +1560,10 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM1_SHIFT** = ``16`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM2_SHIFT: @@ -1548,6 +1572,10 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM2_SHIFT** = ``19`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM3_SHIFT: @@ -1556,6 +1584,10 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM3_SHIFT** = ``22`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_FORMAT_CUSTOM_MASK: @@ -1564,6 +1596,10 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_FORMAT_CUSTOM_MASK** = ``7`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_COMPRESS_FLAGS_BASE: @@ -1572,6 +1608,10 @@ Flag used to mark an index array. :ref:`ArrayFormat` **ARRAY_COMPRESS_FLAGS_BASE** = ``25`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_FLAG_USE_2D_VERTICES: @@ -1588,6 +1628,10 @@ Flag used to mark that the array contains 2D vertices. :ref:`ArrayFormat` **ARRAY_FLAG_USE_DYNAMIC_UPDATE** = ``67108864`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_ARRAY_FLAG_USE_8_BONE_WEIGHTS: @@ -2032,6 +2076,10 @@ Blurs the edges of the shadow. Can be used to hide pixel artifacts in low resolu :ref:`LightParam` **LIGHT_PARAM_TRANSMITTANCE_BIAS** = ``19`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_LIGHT_PARAM_INTENSITY: @@ -2482,6 +2530,10 @@ enum **ParticlesTransformAlign**: :ref:`ParticlesTransformAlign` **PARTICLES_TRANSFORM_ALIGN_DISABLED** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD: @@ -2490,6 +2542,10 @@ enum **ParticlesTransformAlign**: :ref:`ParticlesTransformAlign` **PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_TRANSFORM_ALIGN_Y_TO_VELOCITY: @@ -2498,6 +2554,10 @@ enum **ParticlesTransformAlign**: :ref:`ParticlesTransformAlign` **PARTICLES_TRANSFORM_ALIGN_Y_TO_VELOCITY** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY: @@ -2506,6 +2566,10 @@ enum **ParticlesTransformAlign**: :ref:`ParticlesTransformAlign` **PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -2532,7 +2596,7 @@ Draw particles in the order that they appear in the particles array. :ref:`ParticlesDrawOrder` **PARTICLES_DRAW_ORDER_LIFETIME** = ``1`` -Sort particles based on their lifetime. +Sort particles based on their lifetime. In other words, the particle with the highest lifetime is drawn at the front. .. _class_RenderingServer_constant_PARTICLES_DRAW_ORDER_REVERSE_LIFETIME: @@ -2540,7 +2604,7 @@ Sort particles based on their lifetime. :ref:`ParticlesDrawOrder` **PARTICLES_DRAW_ORDER_REVERSE_LIFETIME** = ``2`` - +Sort particles based on the inverse of their lifetime. In other words, the particle with the lowest lifetime is drawn at the front. .. _class_RenderingServer_constant_PARTICLES_DRAW_ORDER_VIEW_DEPTH: @@ -2566,6 +2630,10 @@ enum **ParticlesCollisionType**: :ref:`ParticlesCollisionType` **PARTICLES_COLLISION_TYPE_SPHERE_ATTRACT** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_TYPE_BOX_ATTRACT: @@ -2574,6 +2642,10 @@ enum **ParticlesCollisionType**: :ref:`ParticlesCollisionType` **PARTICLES_COLLISION_TYPE_BOX_ATTRACT** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_TYPE_VECTOR_FIELD_ATTRACT: @@ -2582,6 +2654,10 @@ enum **ParticlesCollisionType**: :ref:`ParticlesCollisionType` **PARTICLES_COLLISION_TYPE_VECTOR_FIELD_ATTRACT** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_TYPE_SPHERE_COLLIDE: @@ -2590,6 +2666,10 @@ enum **ParticlesCollisionType**: :ref:`ParticlesCollisionType` **PARTICLES_COLLISION_TYPE_SPHERE_COLLIDE** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_TYPE_BOX_COLLIDE: @@ -2598,6 +2678,10 @@ enum **ParticlesCollisionType**: :ref:`ParticlesCollisionType` **PARTICLES_COLLISION_TYPE_BOX_COLLIDE** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_TYPE_SDF_COLLIDE: @@ -2606,6 +2690,10 @@ enum **ParticlesCollisionType**: :ref:`ParticlesCollisionType` **PARTICLES_COLLISION_TYPE_SDF_COLLIDE** = ``5`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_TYPE_HEIGHTFIELD_COLLIDE: @@ -2614,6 +2702,10 @@ enum **ParticlesCollisionType**: :ref:`ParticlesCollisionType` **PARTICLES_COLLISION_TYPE_HEIGHTFIELD_COLLIDE** = ``6`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -2632,6 +2724,10 @@ enum **ParticlesCollisionHeightfieldResolution**: :ref:`ParticlesCollisionHeightfieldResolution` **PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_256** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_512: @@ -2640,6 +2736,10 @@ enum **ParticlesCollisionHeightfieldResolution**: :ref:`ParticlesCollisionHeightfieldResolution` **PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_512** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_1024: @@ -2648,6 +2748,10 @@ enum **ParticlesCollisionHeightfieldResolution**: :ref:`ParticlesCollisionHeightfieldResolution` **PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_1024** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_2048: @@ -2656,6 +2760,10 @@ enum **ParticlesCollisionHeightfieldResolution**: :ref:`ParticlesCollisionHeightfieldResolution` **PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_2048** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_4096: @@ -2664,6 +2772,10 @@ enum **ParticlesCollisionHeightfieldResolution**: :ref:`ParticlesCollisionHeightfieldResolution` **PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_4096** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_8192: @@ -2672,6 +2784,10 @@ enum **ParticlesCollisionHeightfieldResolution**: :ref:`ParticlesCollisionHeightfieldResolution` **PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_8192** = ``5`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_RenderingServer_constant_PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_MAX: @@ -3186,11 +3302,19 @@ Visible render pass (excluding shadows). Shadow render pass. Objects will be rendered several times depending on the number of amounts of lights with shadows and the number of directional shadow splits. +.. _class_RenderingServer_constant_VIEWPORT_RENDER_INFO_TYPE_CANVAS: + +.. rst-class:: classref-enumeration-constant + +:ref:`ViewportRenderInfoType` **VIEWPORT_RENDER_INFO_TYPE_CANVAS** = ``2`` + +Canvas item rendering. This includes all 2D rendering. + .. _class_RenderingServer_constant_VIEWPORT_RENDER_INFO_TYPE_MAX: .. rst-class:: classref-enumeration-constant -:ref:`ViewportRenderInfoType` **VIEWPORT_RENDER_INFO_TYPE_MAX** = ``2`` +:ref:`ViewportRenderInfoType` **VIEWPORT_RENDER_INFO_TYPE_MAX** = ``3`` Represents the size of the :ref:`ViewportRenderInfoType` enum. @@ -4630,7 +4754,7 @@ Uses the default filter mode for this :ref:`Viewport`. :ref:`CanvasItemTextureFilter` **CANVAS_ITEM_TEXTURE_FILTER_NEAREST** = ``1`` -The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. +The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_RenderingServer_constant_CANVAS_ITEM_TEXTURE_FILTER_LINEAR: @@ -4638,7 +4762,7 @@ The texture filter reads from the nearest pixel only. The simplest and fastest m :ref:`CanvasItemTextureFilter` **CANVAS_ITEM_TEXTURE_FILTER_LINEAR** = ``2`` -The texture filter blends between the nearest 4 pixels. Use this when you want to avoid a pixelated style, but do not want mipmaps. +The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_RenderingServer_constant_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: @@ -4646,7 +4770,9 @@ The texture filter blends between the nearest 4 pixels. Use this when you want t :ref:`CanvasItemTextureFilter` **CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS** = ``3`` -The texture filter reads from the nearest pixel in the nearest mipmap. The fastest way to read from textures with mipmaps. +The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look pixelated from up close, and smooth from a distance. + +Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. .. _class_RenderingServer_constant_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: @@ -4654,7 +4780,9 @@ The texture filter reads from the nearest pixel in the nearest mipmap. The faste :ref:`CanvasItemTextureFilter` **CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS** = ``4`` -The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. +The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look smooth from up close, and smooth from a distance. + +Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. .. _class_RenderingServer_constant_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC: @@ -4662,7 +4790,9 @@ The texture filter blends between the nearest 4 pixels and between the nearest 2 :ref:`CanvasItemTextureFilter` **CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC** = ``5`` -The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. +The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. + +\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS` is usually more appropriate in this case. .. _class_RenderingServer_constant_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: @@ -4670,7 +4800,9 @@ The texture filter reads from the nearest pixel, but selects a mipmap based on t :ref:`CanvasItemTextureFilter` **CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC** = ``6`` -The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. +The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. + +\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS` is usually more appropriate in this case. .. _class_RenderingServer_constant_CANVAS_ITEM_TEXTURE_FILTER_MAX: @@ -4770,6 +4902,10 @@ Parent is used for clipping child, but parent is also drawn underneath child as :ref:`CanvasGroupMode` **CANVAS_GROUP_MODE_TRANSPARENT** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -5224,7 +5360,7 @@ enum **Features**: :ref:`Features` **FEATURE_SHADERS** = ``0`` -Hardware supports shaders. This enum is currently unused in Godot 3.x. +*Deprecated.* This constant has not been used since Godot 3.0. .. _class_RenderingServer_constant_FEATURE_MULTITHREADED: @@ -5232,7 +5368,7 @@ Hardware supports shaders. This enum is currently unused in Godot 3.x. :ref:`Features` **FEATURE_MULTITHREADED** = ``1`` -Hardware supports multithreading. This enum is currently unused in Godot 3.x. +*Deprecated.* This constant has not been used since Godot 3.0. .. rst-class:: classref-section-separator @@ -5329,6 +5465,10 @@ The number of custom data arrays available (:ref:`ARRAY_CUSTOM0`! + .. _class_RenderingServer_constant_PARTICLES_EMIT_FLAG_ROTATION_SCALE: @@ -5337,6 +5477,10 @@ The number of custom data arrays available (:ref:`ARRAY_CUSTOM0`! + .. _class_RenderingServer_constant_PARTICLES_EMIT_FLAG_VELOCITY: @@ -5345,6 +5489,10 @@ The number of custom data arrays available (:ref:`ARRAY_CUSTOM0`! + .. _class_RenderingServer_constant_PARTICLES_EMIT_FLAG_COLOR: @@ -5353,6 +5501,10 @@ The number of custom data arrays available (:ref:`ARRAY_CUSTOM0`! + .. _class_RenderingServer_constant_PARTICLES_EMIT_FLAG_CUSTOM: @@ -5361,6 +5513,10 @@ The number of custom data arrays available (:ref:`ARRAY_CUSTOM0`! + .. rst-class:: classref-section-separator @@ -6666,6 +6822,20 @@ Creates a RenderingDevice that can be used to do draw and compute operations on ---- +.. _class_RenderingServer_method_debug_canvas_item_get_rect: + +.. rst-class:: classref-method + +:ref:`Rect2` **debug_canvas_item_get_rect** **(** :ref:`RID` item **)** + +Returns the bounding rectangle for a canvas item in local space, as calculated by the renderer. This bound is used internally for culling. + +\ **Warning:** This function is intended for debugging in the editor, and will pass through and return a zero :ref:`Rect2` in exported projects. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_decal_create: .. rst-class:: classref-method @@ -7238,7 +7408,7 @@ Sets the size of the fog volume when shape is :ref:`FOG_VOLUME_SHAPE_ELLIPSOID` swap_buffers=true, :ref:`float` frame_step=0.0 **)** -Forces redrawing of all viewports at once. +Forces redrawing of all viewports at once. Must be called from the main thread. .. rst-class:: classref-item-separator @@ -7574,7 +7744,7 @@ Returns ``true`` if changes have been made to the RenderingServer's data. :ref:` :ref:`bool` **has_feature** **(** :ref:`Features` feature **)** |const| -Not yet implemented. Always returns ``false``. +*Deprecated.* This method has not been used since Godot 3.0. Always returns false. .. rst-class:: classref-item-separator @@ -9661,7 +9831,7 @@ If ``true``, reflections will ignore sky contribution. Equivalent to :ref:`Refle 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`. +Sets the render cull mask for this reflection probe. Only instances with a matching layer will be reflected by this probe. Equivalent to :ref:`ReflectionProbe.cull_mask`. .. rst-class:: classref-item-separator @@ -9739,6 +9909,18 @@ Sets the origin offset to be used when this reflection probe is in box project m ---- +.. _class_RenderingServer_method_reflection_probe_set_reflection_mask: + +.. rst-class:: classref-method + +void **reflection_probe_set_reflection_mask** **(** :ref:`RID` probe, :ref:`int` layers **)** + +Sets the render reflection mask for this reflection probe. Only instances with a matching layer will have reflections applied from this probe. Equivalent to :ref:`ReflectionProbe.reflection_mask`. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_reflection_probe_set_resolution: .. rst-class:: classref-method @@ -10357,7 +10539,7 @@ Updates the texture specified by the ``texture`` :ref:`RID`'s data wi :ref:`Format` **texture_get_format** **(** :ref:`RID` texture **)** |const| -Returns the :ref:`Format` for the texture. +Returns the format for the texture. .. rst-class:: classref-item-separator diff --git a/classes/class_resource.rst b/classes/class_resource.rst index d0c4350eae1..b2667834390 100644 --- a/classes/class_resource.rst +++ b/classes/class_resource.rst @@ -21,10 +21,12 @@ Base class for serializable objects. Description ----------- -Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from :ref:`RefCounted`, resources are reference-counted and freed when no longer in use. They can also be nested within other resources, and saved on disk. Once loaded from disk, further attempts to load a resource by :ref:`resource_path` returns the same reference. :ref:`PackedScene`, one of the most common :ref:`Object`\ s in a Godot project, is also a resource, uniquely capable of storing and instantiating the :ref:`Node`\ s it contains as many times as desired. +Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from :ref:`RefCounted`, resources are reference-counted and freed when no longer in use. They can also be nested within other resources, and saved on disk. :ref:`PackedScene`, one of the most common :ref:`Object`\ s in a Godot project, is also a resource, uniquely capable of storing and instantiating the :ref:`Node`\ s it contains as many times as desired. In GDScript, resources can loaded from disk by their :ref:`resource_path` using :ref:`@GDScript.load` or :ref:`@GDScript.preload`. +The engine keeps a global cache of all loaded resources, referenced by paths (see :ref:`ResourceLoader.has_cached`). A resource will be cached when loaded for the first time and removed from cache once all references are released. When a resource is cached, subsequent loads using its path will return the cached reference. + \ **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. .. rst-class:: classref-introduction-group diff --git a/classes/class_resourceformatloader.rst b/classes/class_resourceformatloader.rst index 40019ba46b8..e72df80e37c 100644 --- a/classes/class_resourceformatloader.rst +++ b/classes/class_resourceformatloader.rst @@ -78,6 +78,10 @@ enum **CacheMode**: :ref:`CacheMode` **CACHE_MODE_IGNORE** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ResourceFormatLoader_constant_CACHE_MODE_REUSE: @@ -86,6 +90,10 @@ enum **CacheMode**: :ref:`CacheMode` **CACHE_MODE_REUSE** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ResourceFormatLoader_constant_CACHE_MODE_REPLACE: @@ -94,6 +102,10 @@ enum **CacheMode**: :ref:`CacheMode` **CACHE_MODE_REPLACE** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator diff --git a/classes/class_resourceimporterobj.rst b/classes/class_resourceimporterobj.rst index c202703d800..0010925f77e 100644 --- a/classes/class_resourceimporterobj.rst +++ b/classes/class_resourceimporterobj.rst @@ -12,7 +12,7 @@ ResourceImporterOBJ **Inherits:** :ref:`ResourceImporter` **<** :ref:`RefCounted` **<** :ref:`Object` -Imports an OBJ 3D model as a standalone :ref:`Mesh` or scene. +Imports an OBJ 3D model as an independent :ref:`Mesh` or scene. .. rst-class:: classref-introduction-group diff --git a/classes/class_resourceimporterscene.rst b/classes/class_resourceimporterscene.rst index 5501d9772a7..61bfc50bcad 100644 --- a/classes/class_resourceimporterscene.rst +++ b/classes/class_resourceimporterscene.rst @@ -19,7 +19,7 @@ Imports a glTF, FBX, Collada or Blender 3D scene. Description ----------- -See also :ref:`ResourceImporterOBJ`, which is used for OBJ models that can be imported as a standalone :ref:`Mesh` or a scene. +See also :ref:`ResourceImporterOBJ`, which is used for OBJ models that can be imported as an independent :ref:`Mesh` or a scene. Additional options (such as extracting individual meshes or materials to files) are available in the **Advanced Import Settings** dialog. This dialog can be accessed by double-clicking a 3D scene in the FileSystem dock or by selecting a 3D scene in the FileSystem dock, going to the Import dock and choosing **Advanced**. diff --git a/classes/class_resourceloader.rst b/classes/class_resourceloader.rst index 10f8ffba7e9..a5bcb388861 100644 --- a/classes/class_resourceloader.rst +++ b/classes/class_resourceloader.rst @@ -129,7 +129,7 @@ enum **CacheMode**: :ref:`CacheMode` **CACHE_MODE_IGNORE** = ``0`` - +The resource is always loaded from disk, even if a cache entry exists for its path, and the newly loaded copy will not be cached. Instances loaded with this mode will exist independently. .. _class_ResourceLoader_constant_CACHE_MODE_REUSE: @@ -137,7 +137,7 @@ enum **CacheMode**: :ref:`CacheMode` **CACHE_MODE_REUSE** = ``1`` - +If a resource is cached, returns the cached reference. Otherwise it's loaded from disk. .. _class_ResourceLoader_constant_CACHE_MODE_REPLACE: @@ -145,7 +145,7 @@ enum **CacheMode**: :ref:`CacheMode` **CACHE_MODE_REPLACE** = ``2`` - +The resource is always loaded from disk, even if a cache entry exists for its path. The cached entry will be replaced by the newly loaded copy. .. rst-class:: classref-section-separator @@ -180,6 +180,8 @@ 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`. Anything that inherits from :ref:`Resource` can be used as a type hint, for example :ref:`Image`. +\ **Note:** If you use :ref:`Resource.take_over_path`, this method will return ``true`` for the taken path even if the resource wasn't saved (i.e. exists only in resource cache). + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_richtexteffect.rst b/classes/class_richtexteffect.rst index 2d93807769e..0867182c83f 100644 --- a/classes/class_richtexteffect.rst +++ b/classes/class_richtexteffect.rst @@ -19,7 +19,7 @@ A custom effect for a :ref:`RichTextLabel`. Description ----------- -A custom effect for a :ref:`RichTextLabel`. +A custom effect for a :ref:`RichTextLabel`, which can be loaded in the :ref:`RichTextLabel` inspector or using :ref:`RichTextLabel.install_effect`. \ **Note:** For a **RichTextEffect** to be usable, a BBCode tag must be defined as a member variable called ``bbcode`` in the script. diff --git a/classes/class_richtextlabel.rst b/classes/class_richtextlabel.rst index 62c8b0cb537..f104ade88ba 100644 --- a/classes/class_richtextlabel.rst +++ b/classes/class_richtextlabel.rst @@ -1305,7 +1305,32 @@ Returns the number of visible paragraphs. A paragraph is considered visible if a void **install_effect** **(** :ref:`Variant` effect **)** -Installs a custom effect. ``effect`` should be a valid :ref:`RichTextEffect`. +Installs a custom effect. This can also be done in the RichTextLabel inspector using the :ref:`custom_effects` property. ``effect`` should be a valid :ref:`RichTextEffect`. + +Example RichTextEffect: + +:: + + # effect.gd + class_name MyCustomEffect + extends RichTextEffect + + var bbcode = "my_custom_effect" + + # ... + +Registering the above effect in RichTextLabel from script: + +:: + + # rich_text_label.gd + extends RichTextLabel + + func _ready(): + install_effect(MyCustomEffect.new()) + + # Alternatively, if not using `class_name` in the script that extends RichTextEffect: + install_effect(preload("res://effect.gd").new()) .. rst-class:: classref-item-separator diff --git a/classes/class_scenetree.rst b/classes/class_scenetree.rst index 7dcb7d56e0b..d155d61132f 100644 --- a/classes/class_scenetree.rst +++ b/classes/class_scenetree.rst @@ -93,6 +93,8 @@ Methods +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_node_count` **(** **)** |const| | +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_node_count_in_group` **(** :ref:`StringName` group **)** |const| | + +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Node[]` | :ref:`get_nodes_in_group` **(** :ref:`StringName` group **)** | +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Tween[]` | :ref:`get_processed_tweens` **(** **)** | @@ -512,7 +514,7 @@ Changes the running scene to the one at the given ``path``, after loading it int 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 new scene node is added to the tree at the end of the frame. This ensures that both scenes aren't running at the same time, while still freeing the previous scene in a safe way similar to :ref:`Node.queue_free`. As such, you won't be able to access the loaded scene immediately after the :ref:`change_scene_to_file` call. +\ **Note:** See :ref:`change_scene_to_packed` for details on the order of operations. .. rst-class:: classref-item-separator @@ -528,7 +530,13 @@ Changes the running scene to a new instance of the given :ref:`PackedScene` on success, :ref:`@GlobalScope.ERR_CANT_CREATE` if the scene cannot be instantiated, or :ref:`@GlobalScope.ERR_INVALID_PARAMETER` if the scene is invalid. -\ **Note:** The new scene node is added to the tree at the end of the frame. You won't be able to access it immediately after the :ref:`change_scene_to_packed` call. +\ **Note:** Operations happen in the following order when :ref:`change_scene_to_packed` is called: + +1. The current scene node is immediately removed from the tree. From that point, :ref:`Node.get_tree` called on the current (outgoing) scene will return ``null``. :ref:`current_scene` will be ``null``, too, because the new scene is not available yet. + +2. At the end of the frame, the formerly current scene, already removed from the tree, will be deleted (freed from memory) and then the new scene will be instantiated and added to the tree. :ref:`Node.get_tree` and :ref:`current_scene` will be back to working as usual. + +This ensures that both scenes aren't running at the same time, while still freeing the previous scene in a safe way similar to :ref:`Node.queue_free`. .. rst-class:: classref-item-separator @@ -641,6 +649,18 @@ Returns the number of nodes in this **SceneTree**. ---- +.. _class_SceneTree_method_get_node_count_in_group: + +.. rst-class:: classref-method + +:ref:`int` **get_node_count_in_group** **(** :ref:`StringName` group **)** |const| + +Returns the number of nodes assigned to the given group. + +.. rst-class:: classref-item-separator + +---- + .. _class_SceneTree_method_get_nodes_in_group: .. rst-class:: classref-method diff --git a/classes/class_script.rst b/classes/class_script.rst index bfb139f48cf..06b399e7515 100644 --- a/classes/class_script.rst +++ b/classes/class_script.rst @@ -59,6 +59,8 @@ Methods +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Script` | :ref:`get_base_script` **(** **)** |const| | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`get_global_name` **(** **)** |const| | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`StringName` | :ref:`get_instance_base_type` **(** **)** |const| | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_property_default_value` **(** :ref:`StringName` property **)** | @@ -135,6 +137,39 @@ Returns ``true`` if the script can be instantiated. Returns the script directly inherited by this script. +.. rst-class:: classref-item-separator + +---- + +.. _class_Script_method_get_global_name: + +.. rst-class:: classref-method + +:ref:`StringName` **get_global_name** **(** **)** |const| + +Returns the class name associated with the script, if there is one. Returns an empty string otherwise. + +To give the script a global name, you can use the ``class_name`` keyword in GDScript and the ``[GlobalClass]`` attribute in C#. + + +.. tabs:: + + .. code-tab:: gdscript + + class_name MyNode + extends Node + + .. code-tab:: csharp + + using Godot; + + [GlobalClass] + public partial class MyNode : Node + { + } + + + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_scriptlanguageextension.rst b/classes/class_scriptlanguageextension.rst index 3b7cdd84e61..bccce9a3468 100644 --- a/classes/class_scriptlanguageextension.rst +++ b/classes/class_scriptlanguageextension.rst @@ -57,7 +57,7 @@ Methods +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`_debug_parse_stack_level_expression` **(** :ref:`int` level, :ref:`String` expression, :ref:`int` max_subitems, :ref:`int` max_depth **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`_find_function` **(** :ref:`String` class_name, :ref:`String` function_name **)** |virtual| |const| | + | :ref:`int` | :ref:`_find_function` **(** :ref:`String` function, :ref:`String` code **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_finish` **(** **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -113,6 +113,8 @@ Methods +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_profiling_get_frame_data` **(** ScriptLanguageExtensionProfilingInfo* info_array, :ref:`int` info_max **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_profiling_set_save_native_calls` **(** :ref:`bool` enable **)** |virtual| | + +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_profiling_start` **(** **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_profiling_stop` **(** **)** |virtual| | @@ -157,6 +159,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_SCRIPT_LOCATION** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_LOOKUP_RESULT_CLASS: @@ -165,6 +171,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_CLASS** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_LOOKUP_RESULT_CLASS_CONSTANT: @@ -173,6 +183,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_CLASS_CONSTANT** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_LOOKUP_RESULT_CLASS_PROPERTY: @@ -181,6 +195,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_CLASS_PROPERTY** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_LOOKUP_RESULT_CLASS_METHOD: @@ -189,6 +207,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_CLASS_METHOD** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_LOOKUP_RESULT_CLASS_SIGNAL: @@ -197,6 +219,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_CLASS_SIGNAL** = ``5`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_LOOKUP_RESULT_CLASS_ENUM: @@ -205,6 +231,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_CLASS_ENUM** = ``6`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE: @@ -213,6 +243,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE** = ``7`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_LOOKUP_RESULT_CLASS_ANNOTATION: @@ -221,6 +255,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_CLASS_ANNOTATION** = ``8`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_LOOKUP_RESULT_MAX: @@ -229,6 +267,10 @@ enum **LookupResultType**: :ref:`LookupResultType` **LOOKUP_RESULT_MAX** = ``9`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -289,6 +331,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_CLASS** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_FUNCTION: @@ -297,6 +343,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_FUNCTION** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_SIGNAL: @@ -305,6 +355,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_SIGNAL** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_VARIABLE: @@ -313,6 +367,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_VARIABLE** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_MEMBER: @@ -321,6 +379,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_MEMBER** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_ENUM: @@ -329,6 +391,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_ENUM** = ``5`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_CONSTANT: @@ -337,6 +403,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_CONSTANT** = ``6`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_NODE_PATH: @@ -345,6 +415,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_NODE_PATH** = ``7`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_FILE_PATH: @@ -353,6 +427,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_FILE_PATH** = ``8`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_PLAIN_TEXT: @@ -361,6 +439,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_PLAIN_TEXT** = ``9`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_ScriptLanguageExtension_constant_CODE_COMPLETION_KIND_MAX: @@ -369,6 +451,10 @@ enum **CodeCompletionKind**: :ref:`CodeCompletionKind` **CODE_COMPLETION_KIND_MAX** = ``10`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator @@ -608,11 +694,9 @@ void* **_debug_get_stack_level_instance** **(** :ref:`int` level **)* .. rst-class:: classref-method -:ref:`int` **_find_function** **(** :ref:`String` class_name, :ref:`String` function_name **)** |virtual| |const| - -.. container:: contribute +:ref:`int` **_find_function** **(** :ref:`String` function, :ref:`String` code **)** |virtual| |const| - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the line where the function is defined in the code, or ``-1`` if the function is not present. .. rst-class:: classref-item-separator @@ -994,6 +1078,20 @@ void **_init** **(** **)** |virtual| ---- +.. _class_ScriptLanguageExtension_private_method__profiling_set_save_native_calls: + +.. rst-class:: classref-method + +void **_profiling_set_save_native_calls** **(** :ref:`bool` enable **)** |virtual| + +.. container:: contribute + + There is currently no description for this method. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_ScriptLanguageExtension_private_method__profiling_start: .. rst-class:: classref-method diff --git a/classes/class_skeleton3d.rst b/classes/class_skeleton3d.rst index 0b49aa2bbaa..a00e062ac30 100644 --- a/classes/class_skeleton3d.rst +++ b/classes/class_skeleton3d.rst @@ -25,8 +25,6 @@ The overall transform of a bone with respect to the skeleton is determined by bo Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it is not the actual global/world transform of the bone. -To setup different types of inverse kinematics, consider using :ref:`SkeletonIK3D`, or add a custom IK implementation in :ref:`Node._process` as a child node. - .. rst-class:: classref-introduction-group Tutorials @@ -157,9 +155,7 @@ Signals **bone_enabled_changed** **(** :ref:`int` bone_idx **)** -.. container:: contribute - - There is currently no description for this signal. Please help us by :ref:`contributing one `! +Emitted when the bone at ``bone_idx`` is toggled with :ref:`set_bone_enabled`. Use :ref:`is_bone_enabled` to check the new value. .. rst-class:: classref-item-separator @@ -183,9 +179,7 @@ This signal is emitted when one of the bones in the Skeleton3D node have changed **pose_updated** **(** **)** -.. container:: contribute - - There is currently no description for this signal. Please help us by :ref:`contributing one `! +Emitted when the pose is updated, after :ref:`NOTIFICATION_UPDATE_SKELETON` is received. .. rst-class:: classref-item-separator @@ -197,9 +191,7 @@ This signal is emitted when one of the bones in the Skeleton3D node have changed **show_rest_only_changed** **(** **)** -.. container:: contribute - - There is currently no description for this signal. Please help us by :ref:`contributing one `! +Emitted when the value of :ref:`show_rest_only` changes. .. rst-class:: classref-section-separator @@ -216,7 +208,9 @@ Constants **NOTIFICATION_UPDATE_SKELETON** = ``50`` +Notification received when this skeleton's pose needs to be updated. +This notification is received *before* the related :ref:`pose_updated` signal. .. rst-class:: classref-section-separator @@ -276,9 +270,7 @@ Multiplies the 3D position track animation. - void **set_show_rest_only** **(** :ref:`bool` value **)** - :ref:`bool` **is_show_rest_only** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +If ``true``, forces the bones in their default rest pose, regardless of their values. In the editor, this also prevents the bones from being edited. .. rst-class:: classref-section-separator diff --git a/classes/class_skeletonprofilehumanoid.rst b/classes/class_skeletonprofilehumanoid.rst index eb65d0cc9b7..efb6b834796 100644 --- a/classes/class_skeletonprofilehumanoid.rst +++ b/classes/class_skeletonprofilehumanoid.rst @@ -21,6 +21,65 @@ Description A :ref:`SkeletonProfile` as a preset that is optimized for the human form. This exists for standardization, so all parameters are read-only. +A humanoid skeleton profile contains 54 bones divided in 4 groups: ``"Body"``, ``"Face"``, ``"LeftHand"``, and ``"RightHand"``. It is structured as follows: + +:: + + Root + └─ Hips + ├─ LeftUpperLeg + │ └─ LeftLowerLeg + │ └─ LeftFoot + │ └─ LeftToes + ├─ RightUpperLeg + │ └─ RightLowerLeg + │ └─ RightFoot + │ └─ RightToes + └─ Spine + └─ Chest + └─ UpperChest + ├─ Neck + │ └─ Head + │ ├─ Jaw + │ ├─ LeftEye + │ └─ RightEye + ├─ LeftShoulder + │ └─ LeftUpperArm + │ └─ LeftLowerArm + │ └─ LeftHand + │ ├─ LeftThumbMetacarpal + │ │ └─ LeftThumbProximal + │ ├─ LeftIndexProximal + │ │ └─ LeftIndexIntermediate + │ │ └─ LeftIndexDistal + │ ├─ LeftMiddleProximal + │ │ └─ LeftMiddleIntermediate + │ │ └─ LeftMiddleDistal + │ ├─ LeftRingProximal + │ │ └─ LeftRingIntermediate + │ │ └─ LeftRingDistal + │ └─ LeftLittleProximal + │ └─ LeftLittleIntermediate + │ └─ LeftLittleDistal + └─ RightShoulder + └─ RightUpperArm + └─ RightLowerArm + └─ RightHand + ├─ RightThumbMetacarpal + │ └─ RightThumbProximal + ├─ RightIndexProximal + │ └─ RightIndexIntermediate + │ └─ RightIndexDistal + ├─ RightMiddleProximal + │ └─ RightMiddleIntermediate + │ └─ RightMiddleDistal + ├─ RightRingProximal + │ └─ RightRingIntermediate + │ └─ RightRingDistal + └─ RightLittleProximal + └─ RightLittleIntermediate + └─ RightLittleDistal + .. rst-class:: classref-introduction-group Tutorials diff --git a/classes/class_slider.rst b/classes/class_slider.rst index 883712716da..efc975a233c 100644 --- a/classes/class_slider.rst +++ b/classes/class_slider.rst @@ -100,7 +100,7 @@ Emitted when dragging stops. If ``value_changed`` is true, :ref:`Range.value` signal. .. rst-class:: classref-section-separator diff --git a/classes/class_softbody3d.rst b/classes/class_softbody3d.rst index 9a984906ec8..91bd8302eb1 100644 --- a/classes/class_softbody3d.rst +++ b/classes/class_softbody3d.rst @@ -185,9 +185,7 @@ The physics layers this SoftBody3D **scans**. Collision objects can scan one or - void **set_damping_coefficient** **(** :ref:`float` value **)** - :ref:`float` **get_damping_coefficient** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The body's damping coefficient. Higher values will slow down the body more noticeably when forces are applied. .. rst-class:: classref-item-separator @@ -221,9 +219,9 @@ Defines the behavior in physics when :ref:`Node.process_mode` value **)** - :ref:`float` **get_drag_coefficient** **(** **)** -.. container:: contribute +The body's drag coefficient. Higher values increase this body's air resistance. - There is currently no description for this property. Please help us by :ref:`contributing one `! +\ **Note:** This value is currently unused by Godot's default physics implementation. .. rst-class:: classref-item-separator @@ -274,9 +272,7 @@ Higher values will result in a stiffer body, while lower values will increase th - void **set_pressure_coefficient** **(** :ref:`float` value **)** - :ref:`float` **get_pressure_coefficient** **(** **)** -.. container:: contribute - - There is currently no description for this property. Please help us by :ref:`contributing one `! +The pressure coefficient of this soft body. Simulate pressure build-up from inside this body. Higher values increase the strength of this effect. .. rst-class:: classref-item-separator @@ -392,9 +388,7 @@ Returns whether or not the specified layer of the :ref:`collision_mask` **get_physics_rid** **(** **)** |const| -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Returns the internal :ref:`RID` used by the :ref:`PhysicsServer3D` for this body. .. rst-class:: classref-item-separator diff --git a/classes/class_spotlight3d.rst b/classes/class_spotlight3d.rst index 96dee0bab40..a8cd620b576 100644 --- a/classes/class_spotlight3d.rst +++ b/classes/class_spotlight3d.rst @@ -114,9 +114,13 @@ The spotlight's *angular* attenuation curve. See also :ref:`spot_attenuation` value **)** - :ref:`float` **get_param** **(** **)** -The spotlight's light energy (drop-off) attenuation curve. A number of presets are available in the **Inspector** by right-clicking the curve. Zero and negative values are allowed but can produce unusual effects. See also :ref:`spot_angle_attenuation`. +Controls the distance attenuation function for spotlights. -\ **Note:** Very high :ref:`spot_attenuation` values (typically above 10) can impact performance negatively if the light is made to use a larger :ref:`spot_range` to compensate. This is because culling opportunities will become less common and shading costs will be increased (as the light will cover more pixels on screen while resulting in the same amount of brightness). To improve performance, use the lowest :ref:`spot_attenuation` value possible for the visuals you're trying to achieve. +A value of ``0.0`` smoothly attenuates light at the edge of the range. A value of ``1.0`` approaches a physical lighting model. A value of ``0.5`` approximates linear attenuation. + +\ **Note:** Setting it to ``1.0`` may result in distant objects receiving minimal light, even within range. For example, with a range of ``4096``, an object at ``100`` units receives less than ``0.1`` energy. + +\ **Note:** Using negative or values higher than ``10.0`` may lead to unexpected results. .. rst-class:: classref-item-separator diff --git a/classes/class_sprite2d.rst b/classes/class_sprite2d.rst index 51bced63328..6b3d53a8f60 100644 --- a/classes/class_sprite2d.rst +++ b/classes/class_sprite2d.rst @@ -176,7 +176,7 @@ If ``true``, texture is flipped vertically. - void **set_frame** **(** :ref:`int` value **)** - :ref:`int` **get_frame** **(** **)** -Current frame to display from sprite sheet. :ref:`hframes` or :ref:`vframes` must be greater than 1. +Current frame to display from sprite sheet. :ref:`hframes` or :ref:`vframes` must be greater than 1. This property is automatically adjusted when :ref:`hframes` or :ref:`vframes` are changed to keep pointing to the same visual frame (same column and row). If that's impossible, this value is reset to ``0``. .. rst-class:: classref-item-separator @@ -210,7 +210,7 @@ Coordinates of the frame to display from sprite sheet. This is as an alias for t - void **set_hframes** **(** :ref:`int` value **)** - :ref:`int` **get_hframes** **(** **)** -The number of columns in the sprite sheet. +The number of columns in the sprite sheet. When this property is changed, :ref:`frame` is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, :ref:`frame` is reset to ``0``. .. rst-class:: classref-item-separator @@ -312,7 +312,7 @@ The region of the atlas texture to display. :ref:`region_enabled` value **)** - :ref:`int` **get_vframes** **(** **)** -The number of rows in the sprite sheet. +The number of rows in the sprite sheet. When this property is changed, :ref:`frame` is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, :ref:`frame` is reset to ``0``. .. rst-class:: classref-section-separator diff --git a/classes/class_sprite3d.rst b/classes/class_sprite3d.rst index 42adf56d105..1acb2f0cff0 100644 --- a/classes/class_sprite3d.rst +++ b/classes/class_sprite3d.rst @@ -94,7 +94,7 @@ Property Descriptions - void **set_frame** **(** :ref:`int` value **)** - :ref:`int` **get_frame** **(** **)** -Current frame to display from sprite sheet. :ref:`hframes` or :ref:`vframes` must be greater than 1. +Current frame to display from sprite sheet. :ref:`hframes` or :ref:`vframes` must be greater than 1. This property is automatically adjusted when :ref:`hframes` or :ref:`vframes` are changed to keep pointing to the same visual frame (same column and row). If that's impossible, this value is reset to ``0``. .. rst-class:: classref-item-separator @@ -128,7 +128,7 @@ Coordinates of the frame to display from sprite sheet. This is as an alias for t - void **set_hframes** **(** :ref:`int` value **)** - :ref:`int` **get_hframes** **(** **)** -The number of columns in the sprite sheet. +The number of columns in the sprite sheet. When this property is changed, :ref:`frame` is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, :ref:`frame` is reset to ``0``. .. rst-class:: classref-item-separator @@ -196,7 +196,7 @@ The region of the atlas texture to display. :ref:`region_enabled` value **)** - :ref:`int` **get_vframes** **(** **)** -The number of rows in the sprite sheet. +The number of rows in the sprite sheet. When this property is changed, :ref:`frame` is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, :ref:`frame` is reset 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.)` diff --git a/classes/class_string.rst b/classes/class_string.rst index 15a10337844..7d91b325238 100644 --- a/classes/class_string.rst +++ b/classes/class_string.rst @@ -458,16 +458,16 @@ Changes the appearance of the string: replaces underscores (``_``) with spaces, "move_local_x".capitalize() # Returns "Move Local X" "sceneFile_path".capitalize() # Returns "Scene File Path" + "2D, FPS, PNG".capitalize() # Returns "2d, Fps, Png" .. code-tab:: csharp "move_local_x".Capitalize(); // Returns "Move Local X" "sceneFile_path".Capitalize(); // Returns "Scene File Path" + "2D, FPS, PNG".Capitalize(); // Returns "2d, Fps, Png" -\ **Note:** This method not the same as the default appearance of properties in the Inspector dock, as it does not capitalize acronyms (``"2D"``, ``"FPS"``, ``"PNG"``, etc.) as you may expect. - .. rst-class:: classref-item-separator ---- @@ -803,7 +803,7 @@ This is faster than :ref:`split`, if you only need on Returns the 32-bit hash value representing the string's contents. -\ **Note:** Strings with equal hash values are *not* guaranteed to be the same, as a result of hash collisions. On the countrary, strings with different hash values are guaranteed to be different. +\ **Note:** Strings with equal hash values are *not* guaranteed to be the same, as a result of hash collisions. On the contrary, strings with different hash values are guaranteed to be different. .. rst-class:: classref-item-separator @@ -1833,7 +1833,7 @@ Converts the string representing an integer number into an :ref:`int` :ref:`String` **to_lower** **(** **)** |const| -Returns the string converted to lowercase. +Returns the string converted to ``lowercase``. .. rst-class:: classref-item-separator @@ -1859,6 +1859,25 @@ Returns the string converted to ``PascalCase``. Returns the string converted to ``snake_case``. +\ **Note:** Numbers followed by a *single* letter are not separated in the conversion to keep some words (such as "2D") together. + + +.. tabs:: + + .. code-tab:: gdscript + + "Node2D".to_snake_case() # Returns "node_2d" + "2nd place".to_snake_case() # Returns "2_nd_place" + "Texture3DAssetFolder".to_snake_case() # Returns "texture_3d_asset_folder" + + .. code-tab:: csharp + + "Node2D".ToSnakeCase(); // Returns "node_2d" + "2nd place".ToSnakeCase(); // Returns "2_nd_place" + "Texture3DAssetFolder".ToSnakeCase(); // Returns "texture_3d_asset_folder" + + + .. rst-class:: classref-item-separator ---- @@ -1869,7 +1888,7 @@ Returns the string converted to ``snake_case``. :ref:`String` **to_upper** **(** **)** |const| -Returns the string converted to uppercase. +Returns the string converted to ``UPPERCASE``. .. rst-class:: classref-item-separator diff --git a/classes/class_stringname.rst b/classes/class_stringname.rst index 78f95eaec21..9ec5c496d20 100644 --- a/classes/class_stringname.rst +++ b/classes/class_stringname.rst @@ -19,14 +19,20 @@ Description **StringName**\ s are immutable strings designed for general-purpose representation of unique names (also called "string interning"). Two **StringName**\ s with the same value are the same object. Comparing them is extremely fast compared to regular :ref:`String`\ s. -You will usually just pass a :ref:`String` to methods expecting a **StringName** and it will be automatically converted, but you may occasionally want to construct a **StringName** ahead of time with the **StringName** constructor or, in GDScript, the literal syntax ``&"example"``. +You will usually pass a :ref:`String` to methods expecting a **StringName** and it will be automatically converted (often at compile time), but in rare cases you can construct a **StringName** ahead of time with the **StringName** constructor or, in GDScript, the literal syntax ``&"example"``. Manually constructing a **StringName** allows you to control when the conversion from :ref:`String` occurs or to use the literal and prevent conversions entirely. See also :ref:`NodePath`, which is a similar concept specifically designed to store pre-parsed scene tree paths. All of :ref:`String`'s methods are available in this class too. They convert the **StringName** into a string, and they also return a string. This is highly inefficient and should only be used if the string is desired. +\ **Note:** In C#, an explicit conversion to ``System.String`` is required to use the methods listed on this page. Use the ``ToString()`` method to cast a **StringName** to a string, and then use the equivalent methods in ``System.String`` or ``StringExtensions``. + \ **Note:** In a boolean context, a **StringName** will evaluate to ``false`` if it is empty (``StringName("")``). Otherwise, a **StringName** will always evaluate to ``true``. The ``not`` operator cannot be used. Instead, :ref:`is_empty` should be used to check for empty **StringName**\ s. +.. note:: + + There are notable differences when using this API with C#. See :ref:`doc_c_sharp_differences` for more information. + .. rst-class:: classref-reftable-group Constructors @@ -425,16 +431,16 @@ Changes the appearance of the string: replaces underscores (``_``) with spaces, "move_local_x".capitalize() # Returns "Move Local X" "sceneFile_path".capitalize() # Returns "Scene File Path" + "2D, FPS, PNG".capitalize() # Returns "2d, Fps, Png" .. code-tab:: csharp "move_local_x".Capitalize(); // Returns "Move Local X" "sceneFile_path".Capitalize(); // Returns "Scene File Path" + "2D, FPS, PNG".Capitalize(); // Returns "2d, Fps, Png" -\ **Note:** This method not the same as the default appearance of properties in the Inspector dock, as it does not capitalize acronyms (``"2D"``, ``"FPS"``, ``"PNG"``, etc.) as you may expect. - .. rst-class:: classref-item-separator ---- @@ -753,7 +759,7 @@ This is faster than :ref:`split`, if you only nee Returns the 32-bit hash value representing the string's contents. -\ **Note:** Strings with equal hash values are *not* guaranteed to be the same, as a result of hash collisions. On the countrary, strings with different hash values are guaranteed to be different. +\ **Note:** Strings with equal hash values are *not* guaranteed to be the same, as a result of hash collisions. On the contrary, strings with different hash values are guaranteed to be different. .. rst-class:: classref-item-separator @@ -1672,7 +1678,7 @@ Converts the string representing an integer number into an :ref:`int` :ref:`String` **to_lower** **(** **)** |const| -Returns the string converted to lowercase. +Returns the string converted to ``lowercase``. .. rst-class:: classref-item-separator @@ -1698,6 +1704,25 @@ Returns the string converted to ``PascalCase``. Returns the string converted to ``snake_case``. +\ **Note:** Numbers followed by a *single* letter are not separated in the conversion to keep some words (such as "2D") together. + + +.. tabs:: + + .. code-tab:: gdscript + + "Node2D".to_snake_case() # Returns "node_2d" + "2nd place".to_snake_case() # Returns "2_nd_place" + "Texture3DAssetFolder".to_snake_case() # Returns "texture_3d_asset_folder" + + .. code-tab:: csharp + + "Node2D".ToSnakeCase(); // Returns "node_2d" + "2nd place".ToSnakeCase(); // Returns "2_nd_place" + "Texture3DAssetFolder".ToSnakeCase(); // Returns "texture_3d_asset_folder" + + + .. rst-class:: classref-item-separator ---- @@ -1708,7 +1733,7 @@ Returns the string converted to ``snake_case``. :ref:`String` **to_upper** **(** **)** |const| -Returns the string converted to uppercase. +Returns the string converted to ``UPPERCASE``. .. rst-class:: classref-item-separator diff --git a/classes/class_surfacetool.rst b/classes/class_surfacetool.rst index 0129075895e..725dce283b6 100644 --- a/classes/class_surfacetool.rst +++ b/classes/class_surfacetool.rst @@ -401,7 +401,7 @@ Removes the index array by expanding the vertex array. Generates a LOD for a given ``nd_threshold`` in linear units (square root of quadric error metric), using at most ``target_index_count`` indices. -\ *Deprecated.* Unused internally and neglects to preserve normals or UVs. Consider using :ref:`ImporterMesh.generate_lods` instead. +\ *Deprecated.* Unused internally and fails to preserve normals or UVs. Consider using :ref:`ImporterMesh.generate_lods` instead. .. rst-class:: classref-item-separator diff --git a/classes/class_systemfont.rst b/classes/class_systemfont.rst index 672390c4a09..e246266d812 100644 --- a/classes/class_systemfont.rst +++ b/classes/class_systemfont.rst @@ -25,7 +25,7 @@ It will attempt to match font style, but it's not guaranteed. The returned font might be part of a font collection or be a variable font with OpenType "weight", "width" and/or "italic" features set. -You can create :ref:`FontVariation` of the system font for fine control over its features. +You can create :ref:`FontVariation` of the system font for precise control over its features. \ **Note:** This class is implemented on iOS, Linux, macOS and Windows, on other platforms it will fallback to default theme font. diff --git a/classes/class_tabbar.rst b/classes/class_tabbar.rst index ea03bfa8993..7cd5f9db199 100644 --- a/classes/class_tabbar.rst +++ b/classes/class_tabbar.rst @@ -32,7 +32,9 @@ Properties +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`clip_tabs` | ``true`` | +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+ - | :ref:`int` | :ref:`current_tab` | ``0`` | + | :ref:`int` | :ref:`current_tab` | ``-1`` | + +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+ + | :ref:`bool` | :ref:`deselect_enabled` | ``false`` | +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`drag_to_rearrange_enabled` | ``false`` | +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+ @@ -418,14 +420,31 @@ If ``true``, tabs overflowing this node's width will be hidden, displaying two n .. rst-class:: classref-property -:ref:`int` **current_tab** = ``0`` +:ref:`int` **current_tab** = ``-1`` .. rst-class:: classref-property-setget - void **set_current_tab** **(** :ref:`int` value **)** - :ref:`int` **get_current_tab** **(** **)** -Select tab at index ``tab_idx``. +The index of the current selected tab. A value of ``-1`` means that no tab is selected and can only be set when :ref:`deselect_enabled` is ``true`` or if all tabs are hidden or disabled. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TabBar_property_deselect_enabled: + +.. rst-class:: classref-property + +:ref:`bool` **deselect_enabled** = ``false`` + +.. rst-class:: classref-property-setget + +- void **set_deselect_enabled** **(** :ref:`bool` value **)** +- :ref:`bool` **get_deselect_enabled** **(** **)** + +If ``true``, all tabs can be deselected so that no tab is selected. Click on the current tab to deselect it. .. rst-class:: classref-item-separator diff --git a/classes/class_tabcontainer.rst b/classes/class_tabcontainer.rst index 7265cd9fe47..c56585004db 100644 --- a/classes/class_tabcontainer.rst +++ b/classes/class_tabcontainer.rst @@ -38,25 +38,29 @@ Properties .. table:: :widths: auto - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`all_tabs_in_front` | ``false`` | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`clip_tabs` | ``true`` | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`current_tab` | ``0`` | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`drag_to_rearrange_enabled` | ``false`` | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ - | :ref:`AlignmentMode` | :ref:`tab_alignment` | ``0`` | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ - | :ref:`FocusMode` | :ref:`tab_focus_mode` | ``2`` | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`tabs_rearrange_group` | ``-1`` | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`tabs_visible` | ``true`` | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`use_hidden_tabs_for_min_size` | ``false`` | - +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`all_tabs_in_front` | ``false`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`clip_tabs` | ``true`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`int` | :ref:`current_tab` | ``-1`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`deselect_enabled` | ``false`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`drag_to_rearrange_enabled` | ``false`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`AlignmentMode` | :ref:`tab_alignment` | ``0`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`FocusMode` | :ref:`tab_focus_mode` | ``2`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`TabPosition` | :ref:`tabs_position` | ``0`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`int` | :ref:`tabs_rearrange_group` | ``-1`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`tabs_visible` | ``true`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + | :ref:`bool` | :ref:`use_hidden_tabs_for_min_size` | ``false`` | + +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group @@ -271,6 +275,45 @@ Emitted when a tab is selected via click, directional input, or script, even if .. rst-class:: classref-descriptions-group +Enumerations +------------ + +.. _enum_TabContainer_TabPosition: + +.. rst-class:: classref-enumeration + +enum **TabPosition**: + +.. _class_TabContainer_constant_POSITION_TOP: + +.. rst-class:: classref-enumeration-constant + +:ref:`TabPosition` **POSITION_TOP** = ``0`` + +Places the tab bar at the top. + +.. _class_TabContainer_constant_POSITION_BOTTOM: + +.. rst-class:: classref-enumeration-constant + +:ref:`TabPosition` **POSITION_BOTTOM** = ``1`` + +Places the tab bar at the bottom. The tab bar's :ref:`StyleBox` will be flipped vertically. + +.. _class_TabContainer_constant_POSITION_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`TabPosition` **POSITION_MAX** = ``2`` + +Represents the size of the :ref:`TabPosition` enum. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + Property Descriptions --------------------- @@ -312,7 +355,7 @@ If ``true``, tabs overflowing this node's width will be hidden, displaying two n .. rst-class:: classref-property -:ref:`int` **current_tab** = ``0`` +:ref:`int` **current_tab** = ``-1`` .. rst-class:: classref-property-setget @@ -321,6 +364,27 @@ If ``true``, tabs overflowing this node's width will be hidden, displaying two n 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``. +A value of ``-1`` means that no tab is selected. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TabContainer_property_deselect_enabled: + +.. rst-class:: classref-property + +:ref:`bool` **deselect_enabled** = ``false`` + +.. rst-class:: classref-property-setget + +- void **set_deselect_enabled** **(** :ref:`bool` value **)** +- :ref:`bool` **get_deselect_enabled** **(** **)** + +If ``true``, all tabs can be deselected so that no tab is selected. Click on the :ref:`current_tab` to deselect it. + +Only the tab header will be shown if no tabs are selected. + .. rst-class:: classref-item-separator ---- @@ -376,6 +440,23 @@ The focus access mode for the internal :ref:`TabBar` node. ---- +.. _class_TabContainer_property_tabs_position: + +.. rst-class:: classref-property + +:ref:`TabPosition` **tabs_position** = ``0`` + +.. rst-class:: classref-property-setget + +- void **set_tabs_position** **(** :ref:`TabPosition` value **)** +- :ref:`TabPosition` **get_tabs_position** **(** **)** + +Sets the position of the tab bar. See :ref:`TabPosition` for details. + +.. rst-class:: classref-item-separator + +---- + .. _class_TabContainer_property_tabs_rearrange_group: .. rst-class:: classref-property diff --git a/classes/class_textedit.rst b/classes/class_textedit.rst index 99c37bab9fd..3ec58b2afc1 100644 --- a/classes/class_textedit.rst +++ b/classes/class_textedit.rst @@ -1134,7 +1134,7 @@ Allow moving caret, selecting and removing the individual composite character co If ``true``, a right-click moves the caret at the mouse position before displaying the context menu. -If ``false``, the context menu disregards mouse location. +If ``false``, the context menu ignores mouse location. .. rst-class:: classref-item-separator diff --git a/classes/class_textline.rst b/classes/class_textline.rst index f9c7092a718..0f69e797601 100644 --- a/classes/class_textline.rst +++ b/classes/class_textline.rst @@ -34,6 +34,8 @@ Properties +---------------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+ | :ref:`Direction` | :ref:`direction` | ``0`` | +---------------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+ + | :ref:`String` | :ref:`ellipsis_char` | ``"…"`` | + +---------------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+ | |bitfield|\<:ref:`JustificationFlag`\> | :ref:`flags` | ``3`` | +---------------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+ | :ref:`Orientation` | :ref:`orientation` | ``0`` | @@ -136,6 +138,23 @@ Text writing direction. ---- +.. _class_TextLine_property_ellipsis_char: + +.. rst-class:: classref-property + +:ref:`String` **ellipsis_char** = ``"…"`` + +.. rst-class:: classref-property-setget + +- void **set_ellipsis_char** **(** :ref:`String` value **)** +- :ref:`String` **get_ellipsis_char** **(** **)** + +Ellipsis character used for text clipping. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextLine_property_flags: .. rst-class:: classref-property diff --git a/classes/class_textparagraph.rst b/classes/class_textparagraph.rst index a549c5f1cf3..20f8d6ddb5d 100644 --- a/classes/class_textparagraph.rst +++ b/classes/class_textparagraph.rst @@ -38,6 +38,8 @@ Properties +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+ | :ref:`Direction` | :ref:`direction` | ``0`` | +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+ + | :ref:`String` | :ref:`ellipsis_char` | ``"…"`` | + +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+ | |bitfield|\<:ref:`JustificationFlag`\> | :ref:`justification_flags` | ``163`` | +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`max_lines_visible` | ``-1`` | @@ -204,6 +206,23 @@ Text writing direction. ---- +.. _class_TextParagraph_property_ellipsis_char: + +.. rst-class:: classref-property + +:ref:`String` **ellipsis_char** = ``"…"`` + +.. rst-class:: classref-property-setget + +- void **set_ellipsis_char** **(** :ref:`String` value **)** +- :ref:`String` **get_ellipsis_char** **(** **)** + +Ellipsis character used for text clipping. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextParagraph_property_justification_flags: .. rst-class:: classref-property diff --git a/classes/class_textserver.rst b/classes/class_textserver.rst index 796b9d242dc..311c20edf31 100644 --- a/classes/class_textserver.rst +++ b/classes/class_textserver.rst @@ -56,6 +56,8 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`font_get_ascent` **(** :ref:`RID` font_rid, :ref:`int` size **)** |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`font_get_baseline_offset` **(** :ref:`RID` font_rid **)** |const| | + +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`font_get_char_from_glyph_index` **(** :ref:`RID` font_rid, :ref:`int` size, :ref:`int` glyph_index **)** |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`font_get_descent` **(** :ref:`RID` font_rid, :ref:`int` size **)** |const| | @@ -186,6 +188,8 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`font_set_ascent` **(** :ref:`RID` font_rid, :ref:`int` size, :ref:`float` ascent **)** | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`font_set_baseline_offset` **(** :ref:`RID` font_rid, :ref:`float` baseline_offset **)** | + +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`font_set_data` **(** :ref:`RID` font_rid, :ref:`PackedByteArray` data **)** | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`font_set_descent` **(** :ref:`RID` font_rid, :ref:`int` size, :ref:`float` descent **)** | @@ -326,6 +330,8 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedInt32Array` | :ref:`shaped_text_get_character_breaks` **(** :ref:`RID` shaped **)** |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`shaped_text_get_custom_ellipsis` **(** :ref:`RID` shaped **)** |const| | + +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`shaped_text_get_custom_punctuation` **(** :ref:`RID` shaped **)** |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`shaped_text_get_descent` **(** :ref:`RID` shaped **)** |const| | @@ -404,6 +410,8 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`shaped_text_set_bidi_override` **(** :ref:`RID` shaped, :ref:`Array` override **)** | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`shaped_text_set_custom_ellipsis` **(** :ref:`RID` shaped, :ref:`int` char **)** | + +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`shaped_text_set_custom_punctuation` **(** :ref:`RID` shaped, :ref:`String` punct **)** | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`shaped_text_set_direction` **(** :ref:`RID` shaped, :ref:`Direction` direction=0 **)** | @@ -538,7 +546,7 @@ Vertical BGR subpixel layout. :ref:`FontLCDSubpixelLayout` **FONT_LCD_SUBPIXEL_LAYOUT_MAX** = ``5`` - +Represents the size of the :ref:`FontLCDSubpixelLayout` enum. .. rst-class:: classref-item-separator @@ -948,7 +956,7 @@ Determines whether the ellipsis at the end of the text is enforced and may not b :ref:`TextOverrunFlag` **OVERRUN_JUSTIFICATION_AWARE** = ``16`` - +Accounts for the text being justified before attempting to trim it (see :ref:`JustificationFlag`). .. rst-class:: classref-item-separator @@ -1376,7 +1384,7 @@ Spacing at the bottom of the line. :ref:`SpacingType` **SPACING_MAX** = ``4`` - +Represents the size of the :ref:`SpacingType` enum. .. rst-class:: classref-item-separator @@ -1681,6 +1689,18 @@ Returns the font ascent (number of pixels above the baseline). ---- +.. _class_TextServer_method_font_get_baseline_offset: + +.. rst-class:: classref-method + +:ref:`float` **font_get_baseline_offset** **(** :ref:`RID` font_rid **)** |const| + +Returns extra baseline offset (as a fraction of font height). + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServer_method_font_get_char_from_glyph_index: .. rst-class:: classref-method @@ -1735,7 +1755,7 @@ Returns number of faces in the TrueType / OpenType collection. :ref:`int` **font_get_face_index** **(** :ref:`RID` font_rid **)** |const| -Recturns an active face index in the TrueType / OpenType collection. +Returns an active face index in the TrueType / OpenType collection. .. rst-class:: classref-item-separator @@ -1759,7 +1779,7 @@ Returns bitmap font fixed size. :ref:`FixedSizeScaleMode` **font_get_fixed_size_scale_mode** **(** :ref:`RID` font_rid **)** |const| -Returned bitmap font scaling mode. +Returns bitmap font scaling mode. .. rst-class:: classref-item-separator @@ -2477,6 +2497,18 @@ Sets the font ascent (number of pixels above the baseline). ---- +.. _class_TextServer_method_font_set_baseline_offset: + +.. rst-class:: classref-method + +void **font_set_baseline_offset** **(** :ref:`RID` font_rid, :ref:`float` baseline_offset **)** + +Sets extra baseline offset (as a fraction of font height). + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServer_method_font_set_data: .. rst-class:: classref-method @@ -3359,6 +3391,18 @@ Returns array of the composite character boundaries. ---- +.. _class_TextServer_method_shaped_text_get_custom_ellipsis: + +.. rst-class:: classref-method + +:ref:`int` **shaped_text_get_custom_ellipsis** **(** :ref:`RID` shaped **)** |const| + +Returns ellipsis character used for text clipping. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServer_method_shaped_text_get_custom_punctuation: .. rst-class:: classref-method @@ -3833,6 +3877,18 @@ Override ranges should cover full source text without overlaps. BiDi algorithm w ---- +.. _class_TextServer_method_shaped_text_set_custom_ellipsis: + +.. rst-class:: classref-method + +void **shaped_text_set_custom_ellipsis** **(** :ref:`RID` shaped, :ref:`int` char **)** + +Sets ellipsis character used for text clipping. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServer_method_shaped_text_set_custom_punctuation: .. rst-class:: classref-method diff --git a/classes/class_textserverextension.rst b/classes/class_textserverextension.rst index c83473dee3d..502c1e62129 100644 --- a/classes/class_textserverextension.rst +++ b/classes/class_textserverextension.rst @@ -58,6 +58,8 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`_font_get_ascent` **(** :ref:`RID` font_rid, :ref:`int` size **)** |virtual| |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`_font_get_baseline_offset` **(** :ref:`RID` font_rid **)** |virtual| |const| | + +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_font_get_char_from_glyph_index` **(** :ref:`RID` font_rid, :ref:`int` size, :ref:`int` glyph_index **)** |virtual| |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`_font_get_descent` **(** :ref:`RID` font_rid, :ref:`int` size **)** |virtual| |const| | @@ -188,6 +190,8 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_font_set_ascent` **(** :ref:`RID` font_rid, :ref:`int` size, :ref:`float` ascent **)** |virtual| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_font_set_baseline_offset` **(** :ref:`RID` font_rid, :ref:`float` baseline_offset **)** |virtual| | + +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_font_set_data` **(** :ref:`RID` font_rid, :ref:`PackedByteArray` data **)** |virtual| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_font_set_data_ptr` **(** :ref:`RID` font_rid, const uint8_t* data_ptr, :ref:`int` data_size **)** |virtual| | @@ -330,6 +334,8 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedInt32Array` | :ref:`_shaped_text_get_character_breaks` **(** :ref:`RID` shaped **)** |virtual| |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`_shaped_text_get_custom_ellipsis` **(** :ref:`RID` shaped **)** |virtual| |const| | + +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`_shaped_text_get_custom_punctuation` **(** :ref:`RID` shaped **)** |virtual| |const| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`_shaped_text_get_descent` **(** :ref:`RID` shaped **)** |virtual| |const| | @@ -406,6 +412,8 @@ Methods +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_shaped_text_set_bidi_override` **(** :ref:`RID` shaped, :ref:`Array` override **)** |virtual| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_shaped_text_set_custom_ellipsis` **(** :ref:`RID` shaped, :ref:`int` char **)** |virtual| | + +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_shaped_text_set_custom_punctuation` **(** :ref:`RID` shaped, :ref:`String` punct **)** |virtual| | +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_shaped_text_set_direction` **(** :ref:`RID` shaped, :ref:`Direction` direction **)** |virtual| | @@ -636,6 +644,20 @@ void **_font_draw_glyph_outline** **(** :ref:`RID` font_rid, :ref:`RI ---- +.. _class_TextServerExtension_private_method__font_get_baseline_offset: + +.. rst-class:: classref-method + +:ref:`float` **_font_get_baseline_offset** **(** :ref:`RID` font_rid **)** |virtual| |const| + +.. container:: contribute + + There is currently no description for this method. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServerExtension_private_method__font_get_char_from_glyph_index: .. rst-class:: classref-method @@ -1546,6 +1568,20 @@ void **_font_set_ascent** **(** :ref:`RID` font_rid, :ref:`int` font_rid, :ref:`float` baseline_offset **)** |virtual| + +.. container:: contribute + + There is currently no description for this method. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServerExtension_private_method__font_set_data: .. rst-class:: classref-method @@ -2540,6 +2576,20 @@ void **_shaped_text_get_carets** **(** :ref:`RID` shaped, :ref:`int` **_shaped_text_get_custom_ellipsis** **(** :ref:`RID` shaped **)** |virtual| |const| + +.. container:: contribute + + There is currently no description for this method. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServerExtension_private_method__shaped_text_get_custom_punctuation: .. rst-class:: classref-method @@ -3072,6 +3122,20 @@ void **_shaped_text_set_bidi_override** **(** :ref:`RID` shaped, :ref ---- +.. _class_TextServerExtension_private_method__shaped_text_set_custom_ellipsis: + +.. rst-class:: classref-method + +void **_shaped_text_set_custom_ellipsis** **(** :ref:`RID` shaped, :ref:`int` char **)** |virtual| + +.. container:: contribute + + There is currently no description for this method. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServerExtension_private_method__shaped_text_set_custom_punctuation: .. rst-class:: classref-method diff --git a/classes/class_texture2d.rst b/classes/class_texture2d.rst index 46787e5a7c5..146f0829271 100644 --- a/classes/class_texture2d.rst +++ b/classes/class_texture2d.rst @@ -238,6 +238,8 @@ Returns the texture height in pixels. Returns an :ref:`Image` that is a copy of data from this **Texture2D** (a new :ref:`Image` is created each time). :ref:`Image`\ s can be accessed and manipulated directly. +\ **Note:** This will return ``null`` if this **Texture2D** is invalid. + \ **Note:** This will fetch the texture data from the GPU, which might cause performance problems when overused. .. rst-class:: classref-item-separator diff --git a/classes/class_texture2drd.rst b/classes/class_texture2drd.rst index c4246a0536b..3a5147bd6ec 100644 --- a/classes/class_texture2drd.rst +++ b/classes/class_texture2drd.rst @@ -32,7 +32,7 @@ Properties +-------------------------+------------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`bool` | resource_local_to_scene | ``false`` (overrides :ref:`Resource`) | +-------------------------+------------------------------------------------------------------+----------------------------------------------------------------------------------------+ - | :ref:`RID` | :ref:`texture_rd_rid` | ``RID()`` | + | :ref:`RID` | :ref:`texture_rd_rid` | | +-------------------------+------------------------------------------------------------------+----------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -48,7 +48,7 @@ Property Descriptions .. rst-class:: classref-property -:ref:`RID` **texture_rd_rid** = ``RID()`` +:ref:`RID` **texture_rd_rid** .. rst-class:: classref-property-setget diff --git a/classes/class_texture3drd.rst b/classes/class_texture3drd.rst index 08425d55e58..4b5dc493866 100644 --- a/classes/class_texture3drd.rst +++ b/classes/class_texture3drd.rst @@ -29,9 +29,9 @@ Properties .. table:: :widths: auto - +-----------------------+------------------------------------------------------------------+-----------+ - | :ref:`RID` | :ref:`texture_rd_rid` | ``RID()`` | - +-----------------------+------------------------------------------------------------------+-----------+ + +-----------------------+------------------------------------------------------------------+ + | :ref:`RID` | :ref:`texture_rd_rid` | + +-----------------------+------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -46,7 +46,7 @@ Property Descriptions .. rst-class:: classref-property -:ref:`RID` **texture_rd_rid** = ``RID()`` +:ref:`RID` **texture_rd_rid** .. rst-class:: classref-property-setget diff --git a/classes/class_texturelayeredrd.rst b/classes/class_texturelayeredrd.rst index 538432cf5f5..a0a4519ec0f 100644 --- a/classes/class_texturelayeredrd.rst +++ b/classes/class_texturelayeredrd.rst @@ -31,9 +31,9 @@ Properties .. table:: :widths: auto - +-----------------------+-----------------------------------------------------------------------+-----------+ - | :ref:`RID` | :ref:`texture_rd_rid` | ``RID()`` | - +-----------------------+-----------------------------------------------------------------------+-----------+ + +-----------------------+-----------------------------------------------------------------------+ + | :ref:`RID` | :ref:`texture_rd_rid` | + +-----------------------+-----------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -48,7 +48,7 @@ Property Descriptions .. rst-class:: classref-property -:ref:`RID` **texture_rd_rid** = ``RID()`` +:ref:`RID` **texture_rd_rid** .. rst-class:: classref-property-setget diff --git a/classes/class_textureprogressbar.rst b/classes/class_textureprogressbar.rst index d8ab21094c1..63b4445b419 100644 --- a/classes/class_textureprogressbar.rst +++ b/classes/class_textureprogressbar.rst @@ -224,7 +224,7 @@ If ``true``, Godot treats the bar's textures like in :ref:`NinePatchRect` value **)** - :ref:`Vector2` **get_radial_center_offset** **(** **)** -Offsets :ref:`texture_progress` if :ref:`fill_mode` is :ref:`FILL_CLOCKWISE` or :ref:`FILL_COUNTER_CLOCKWISE`. +Offsets :ref:`texture_progress` if :ref:`fill_mode` is :ref:`FILL_CLOCKWISE`, :ref:`FILL_COUNTER_CLOCKWISE`, or :ref:`FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE`. .. rst-class:: classref-item-separator @@ -241,7 +241,7 @@ Offsets :ref:`texture_progress` value **)** - :ref:`float` **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. +Upper limit for the fill of :ref:`texture_progress` if :ref:`fill_mode` is :ref:`FILL_CLOCKWISE`, :ref:`FILL_COUNTER_CLOCKWISE`, or :ref:`FILL_CLOCKWISE_AND_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`. @@ -260,7 +260,7 @@ See :ref:`Range.value`, :ref:`Range.max_value` value **)** - :ref:`float` **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`. +Starting angle for the fill of :ref:`texture_progress` if :ref:`fill_mode` is :ref:`FILL_CLOCKWISE`, :ref:`FILL_COUNTER_CLOCKWISE`, or :ref:`FILL_CLOCKWISE_AND_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`. .. rst-class:: classref-item-separator @@ -277,7 +277,7 @@ Starting angle for the fill of :ref:`texture_progress` margin, :ref:`int` value **)** - :ref:`int` **get_stretch_margin** **(** :ref:`Side` margin **)** |const| -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. +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. Only effective if :ref:`nine_patch_stretch` is ``true``. .. rst-class:: classref-item-separator @@ -294,7 +294,7 @@ The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's botto - void **set_stretch_margin** **(** :ref:`Side` margin, :ref:`int` value **)** - :ref:`int` **get_stretch_margin** **(** :ref:`Side` margin **)** |const| -The width of the 9-patch's left column. +The width of the 9-patch's left column. Only effective if :ref:`nine_patch_stretch` is ``true``. .. rst-class:: classref-item-separator @@ -311,7 +311,7 @@ The width of the 9-patch's left column. - void **set_stretch_margin** **(** :ref:`Side` margin, :ref:`int` value **)** - :ref:`int` **get_stretch_margin** **(** :ref:`Side` margin **)** |const| -The width of the 9-patch's right column. +The width of the 9-patch's right column. Only effective if :ref:`nine_patch_stretch` is ``true``. .. rst-class:: classref-item-separator @@ -328,7 +328,7 @@ The width of the 9-patch's right column. - void **set_stretch_margin** **(** :ref:`Side` margin, :ref:`int` value **)** - :ref:`int` **get_stretch_margin** **(** :ref:`Side` margin **)** |const| -The height of the 9-patch's top row. +The height of the 9-patch's top row. Only effective if :ref:`nine_patch_stretch` is ``true``. .. rst-class:: classref-item-separator diff --git a/classes/class_tiledata.rst b/classes/class_tiledata.rst index db8f6c0bb52..ef421bc9f7d 100644 --- a/classes/class_tiledata.rst +++ b/classes/class_tiledata.rst @@ -61,55 +61,55 @@ Methods .. table:: :widths: auto - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`add_collision_polygon` **(** :ref:`int` layer_id **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_collision_polygon_one_way_margin` **(** :ref:`int` layer_id, :ref:`int` polygon_index **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`PackedVector2Array` | :ref:`get_collision_polygon_points` **(** :ref:`int` layer_id, :ref:`int` polygon_index **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_collision_polygons_count` **(** :ref:`int` layer_id **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`float` | :ref:`get_constant_angular_velocity` **(** :ref:`int` layer_id **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector2` | :ref:`get_constant_linear_velocity` **(** :ref:`int` layer_id **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant` | :ref:`get_custom_data` **(** :ref:`String` layer_name **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant` | :ref:`get_custom_data_by_layer_id` **(** :ref:`int` layer_id **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`NavigationPolygon` | :ref:`get_navigation_polygon` **(** :ref:`int` layer_id **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`OccluderPolygon2D` | :ref:`get_occluder` **(** :ref:`int` layer_id **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`get_terrain_peering_bit` **(** :ref:`CellNeighbor` peering_bit **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_collision_polygon_one_way` **(** :ref:`int` layer_id, :ref:`int` polygon_index **)** |const| | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`remove_collision_polygon` **(** :ref:`int` layer_id, :ref:`int` polygon_index **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_collision_polygon_one_way` **(** :ref:`int` layer_id, :ref:`int` polygon_index, :ref:`bool` one_way **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_collision_polygon_one_way_margin` **(** :ref:`int` layer_id, :ref:`int` polygon_index, :ref:`float` one_way_margin **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_collision_polygon_points` **(** :ref:`int` layer_id, :ref:`int` polygon_index, :ref:`PackedVector2Array` polygon **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_collision_polygons_count` **(** :ref:`int` layer_id, :ref:`int` polygons_count **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_constant_angular_velocity` **(** :ref:`int` layer_id, :ref:`float` velocity **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_constant_linear_velocity` **(** :ref:`int` layer_id, :ref:`Vector2` velocity **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_custom_data` **(** :ref:`String` layer_name, :ref:`Variant` value **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_custom_data_by_layer_id` **(** :ref:`int` layer_id, :ref:`Variant` value **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_navigation_polygon` **(** :ref:`int` layer_id, :ref:`NavigationPolygon` navigation_polygon **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_occluder` **(** :ref:`int` layer_id, :ref:`OccluderPolygon2D` occluder_polygon **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_terrain_peering_bit` **(** :ref:`CellNeighbor` peering_bit, :ref:`int` terrain **)** | - +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_collision_polygon` **(** :ref:`int` layer_id **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_collision_polygon_one_way_margin` **(** :ref:`int` layer_id, :ref:`int` polygon_index **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedVector2Array` | :ref:`get_collision_polygon_points` **(** :ref:`int` layer_id, :ref:`int` polygon_index **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_collision_polygons_count` **(** :ref:`int` layer_id **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`get_constant_angular_velocity` **(** :ref:`int` layer_id **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`get_constant_linear_velocity` **(** :ref:`int` layer_id **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`get_custom_data` **(** :ref:`String` layer_name **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant` | :ref:`get_custom_data_by_layer_id` **(** :ref:`int` layer_id **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`NavigationPolygon` | :ref:`get_navigation_polygon` **(** :ref:`int` layer_id, :ref:`bool` flip_h=false, :ref:`bool` flip_v=false, :ref:`bool` transpose=false **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`OccluderPolygon2D` | :ref:`get_occluder` **(** :ref:`int` layer_id, :ref:`bool` flip_h=false, :ref:`bool` flip_v=false, :ref:`bool` transpose=false **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_terrain_peering_bit` **(** :ref:`CellNeighbor` peering_bit **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_collision_polygon_one_way` **(** :ref:`int` layer_id, :ref:`int` polygon_index **)** |const| | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_collision_polygon` **(** :ref:`int` layer_id, :ref:`int` polygon_index **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_collision_polygon_one_way` **(** :ref:`int` layer_id, :ref:`int` polygon_index, :ref:`bool` one_way **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_collision_polygon_one_way_margin` **(** :ref:`int` layer_id, :ref:`int` polygon_index, :ref:`float` one_way_margin **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_collision_polygon_points` **(** :ref:`int` layer_id, :ref:`int` polygon_index, :ref:`PackedVector2Array` polygon **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_collision_polygons_count` **(** :ref:`int` layer_id, :ref:`int` polygons_count **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_constant_angular_velocity` **(** :ref:`int` layer_id, :ref:`float` velocity **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_constant_linear_velocity` **(** :ref:`int` layer_id, :ref:`Vector2` velocity **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_custom_data` **(** :ref:`String` layer_name, :ref:`Variant` value **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_custom_data_by_layer_id` **(** :ref:`int` layer_id, :ref:`Variant` value **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_navigation_polygon` **(** :ref:`int` layer_id, :ref:`NavigationPolygon` navigation_polygon **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_occluder` **(** :ref:`int` layer_id, :ref:`OccluderPolygon2D` occluder_polygon **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_terrain_peering_bit` **(** :ref:`CellNeighbor` peering_bit, :ref:`int` terrain **)** | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -429,10 +429,12 @@ Returns the custom data value for custom data layer with index ``layer_id``. .. rst-class:: classref-method -:ref:`NavigationPolygon` **get_navigation_polygon** **(** :ref:`int` layer_id **)** |const| +:ref:`NavigationPolygon` **get_navigation_polygon** **(** :ref:`int` layer_id, :ref:`bool` flip_h=false, :ref:`bool` flip_v=false, :ref:`bool` transpose=false **)** |const| Returns the navigation polygon of the tile for the TileSet navigation layer with index ``layer_id``. +\ ``flip_h``, ``flip_v``, and ``transpose`` allow transforming the returned polygon. + .. rst-class:: classref-item-separator ---- @@ -441,10 +443,12 @@ Returns the navigation polygon of the tile for the TileSet navigation layer with .. rst-class:: classref-method -:ref:`OccluderPolygon2D` **get_occluder** **(** :ref:`int` layer_id **)** |const| +:ref:`OccluderPolygon2D` **get_occluder** **(** :ref:`int` layer_id, :ref:`bool` flip_h=false, :ref:`bool` flip_v=false, :ref:`bool` transpose=false **)** |const| Returns the occluder polygon of the tile for the TileSet occlusion layer with index ``layer_id``. +\ ``flip_h``, ``flip_v``, and ``transpose`` allow transforming the returned polygon. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_tilesetatlassource.rst b/classes/class_tilesetatlassource.rst index 8b2f0d31f48..30624c3f5ee 100644 --- a/classes/class_tilesetatlassource.rst +++ b/classes/class_tilesetatlassource.rst @@ -431,7 +431,7 @@ Returns how many animation frames has the tile at coordinates ``atlas_coords``. :ref:`TileAnimationMode` **get_tile_animation_mode** **(** :ref:`Vector2i` atlas_coords **)** |const| -Returns the :ref:`TileAnimationMode` of the tile at ``atlas_coords``. See also :ref:`set_tile_animation_mode`. +Returns the tile animation mode of the tile at ``atlas_coords``. See also :ref:`set_tile_animation_mode`. .. rst-class:: classref-item-separator @@ -655,7 +655,7 @@ Sets how many animation frames the tile at coordinates ``atlas_coords`` has. void **set_tile_animation_mode** **(** :ref:`Vector2i` atlas_coords, :ref:`TileAnimationMode` mode **)** -Sets the :ref:`TileAnimationMode` of the tile at ``atlas_coords`` to ``mode``. See also :ref:`get_tile_animation_mode`. +Sets the tile animation mode of the tile at ``atlas_coords`` to ``mode``. See also :ref:`get_tile_animation_mode`. .. rst-class:: classref-item-separator diff --git a/classes/class_timer.rst b/classes/class_timer.rst index e01b1559ed1..c353e06fd76 100644 --- a/classes/class_timer.rst +++ b/classes/class_timer.rst @@ -85,7 +85,7 @@ Signals **timeout** **(** **)** -Emitted when the timer reaches 0. +Emitted when the timer reaches the end. .. rst-class:: classref-section-separator @@ -108,7 +108,7 @@ enum **TimerProcessCallback**: :ref:`TimerProcessCallback` **TIMER_PROCESS_PHYSICS** = ``0`` -Update the timer during physics frames (see :ref:`Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS`). +Update the timer every physics process frame (see :ref:`Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS`). .. _class_Timer_constant_TIMER_PROCESS_IDLE: @@ -116,7 +116,7 @@ Update the timer during physics frames (see :ref:`Node.NOTIFICATION_INTERNAL_PHY :ref:`TimerProcessCallback` **TIMER_PROCESS_IDLE** = ``1`` -Update the timer during process frames (see :ref:`Node.NOTIFICATION_INTERNAL_PROCESS`). +Update the timer every process (rendered) frame (see :ref:`Node.NOTIFICATION_INTERNAL_PROCESS`). .. rst-class:: classref-section-separator @@ -138,9 +138,9 @@ Property Descriptions - void **set_autostart** **(** :ref:`bool` value **)** - :ref:`bool` **has_autostart** **(** **)** -If ``true``, the timer will automatically start when entering the scene tree. +If ``true``, the timer will start immediately when it enters the scene tree. -\ **Note:** This property is automatically set to ``false`` after the timer enters the scene tree and starts. +\ **Note:** After the timer enters the tree, this property is automatically set to ``false``. .. rst-class:: classref-item-separator @@ -157,7 +157,7 @@ If ``true``, the timer will automatically start when entering the scene tree. - void **set_one_shot** **(** :ref:`bool` value **)** - :ref:`bool` **is_one_shot** **(** **)** -If ``true``, the timer will stop when reaching 0. If ``false``, it will restart. +If ``true``, the timer will stop after reaching the end. Otherwise, as by default, the timer will automatically restart. .. rst-class:: classref-item-separator @@ -174,7 +174,7 @@ If ``true``, the timer will stop when reaching 0. If ``false``, it will restart. - void **set_paused** **(** :ref:`bool` value **)** - :ref:`bool` **is_paused** **(** **)** -If ``true``, the timer is paused and will not process until it is unpaused again, even if :ref:`start` is called. +If ``true``, the timer is paused. A paused timer does not process until this property is set back to ``false``, even when :ref:`start` is called. .. rst-class:: classref-item-separator @@ -191,7 +191,7 @@ If ``true``, the timer is paused and will not process until it is unpaused again - void **set_timer_process_callback** **(** :ref:`TimerProcessCallback` value **)** - :ref:`TimerProcessCallback` **get_timer_process_callback** **(** **)** -Processing callback. See :ref:`TimerProcessCallback`. +Specifies when the timer is updated during the main loop (see :ref:`TimerProcessCallback`). .. rst-class:: classref-item-separator @@ -207,9 +207,9 @@ Processing callback. See :ref:`TimerProcessCallback` **get_time_left** **(** **)** -The timer's remaining time in seconds. Returns 0 if the timer is inactive. +The timer's remaining time in seconds. This is always ``0`` if the timer is stopped. -\ **Note:** This value is read-only and cannot be set. It is based on :ref:`wait_time`, which can be set using :ref:`start`. +\ **Note:** This property is read-only and cannot be modified. It is based on :ref:`wait_time`. .. rst-class:: classref-item-separator @@ -226,9 +226,9 @@ The timer's remaining time in seconds. Returns 0 if the timer is inactive. - void **set_wait_time** **(** :ref:`float` value **)** - :ref:`float` **get_wait_time** **(** **)** -The wait time in seconds. +The time required for the timer to end, in seconds. This property can also be set every time :ref:`start` is called. -\ **Note:** Timers can only emit once per rendered frame at most (or once per physics frame if :ref:`process_callback` 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. Timers are affected by :ref:`Engine.time_scale`, a higher scale means quicker timeouts, and vice versa. +\ **Note:** Timers can only process once per physics or process frame (depending on the :ref:`process_callback`). An unstable framerate may cause the timer to end inconsistently, which is especially noticeable if the wait time is lower than roughly ``0.05`` seconds. For very short timers, it is recommended to write your own code instead of using a **Timer** node. Timers are also affected by :ref:`Engine.time_scale`. .. rst-class:: classref-section-separator @@ -245,7 +245,7 @@ Method Descriptions :ref:`bool` **is_stopped** **(** **)** |const| -Returns ``true`` if the timer is stopped. +Returns ``true`` if the timer is stopped or has not started. .. rst-class:: classref-item-separator @@ -257,9 +257,9 @@ Returns ``true`` if the timer is stopped. void **start** **(** :ref:`float` time_sec=-1 **)** -Starts the timer. Sets :ref:`wait_time` to ``time_sec`` if ``time_sec > 0``. This also resets the remaining time to :ref:`wait_time`. +Starts the timer, if it was not started already. Fails if the timer is not inside the tree. If ``time_sec`` is greater than ``0``, this value is used for the :ref:`wait_time`. -\ **Note:** This method will not resume a paused timer. See :ref:`paused`. +\ **Note:** This method does not resume a paused timer. See :ref:`paused`. .. rst-class:: classref-item-separator diff --git a/classes/class_transform2d.rst b/classes/class_transform2d.rst index cc9eb73dccc..eb7388fed4c 100644 --- a/classes/class_transform2d.rst +++ b/classes/class_transform2d.rst @@ -19,7 +19,7 @@ Description A 2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, and 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. +For a general introduction, see the :doc:`Matrices and transforms <../tutorials/math/matrices_and_transforms>` tutorial. .. note:: @@ -149,6 +149,10 @@ Operators +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform2D` | :ref:`operator *` **(** :ref:`int` right **)** | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform2D` | :ref:`operator /` **(** :ref:`float` right **)** | + +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform2D` | :ref:`operator /` **(** :ref:`int` right **)** | + +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`operator ==` **(** :ref:`Transform2D` right **)** | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`operator []` **(** :ref:`int` index **)** | @@ -673,6 +677,30 @@ This operator multiplies all components of the **Transform2D**, including the :r ---- +.. _class_Transform2D_operator_div_float: + +.. rst-class:: classref-operator + +:ref:`Transform2D` **operator /** **(** :ref:`float` right **)** + +This operator divides all components of the **Transform2D**, including the :ref:`origin` vector, which inversely scales it uniformly. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Transform2D_operator_div_int: + +.. rst-class:: classref-operator + +:ref:`Transform2D` **operator /** **(** :ref:`int` right **)** + +This operator divides all components of the **Transform2D**, including the :ref:`origin` vector, which inversely scales it uniformly. + +.. rst-class:: classref-item-separator + +---- + .. _class_Transform2D_operator_eq_Transform2D: .. rst-class:: classref-operator diff --git a/classes/class_transform3d.rst b/classes/class_transform3d.rst index 68eb7cf7079..03930305ae9 100644 --- a/classes/class_transform3d.rst +++ b/classes/class_transform3d.rst @@ -19,7 +19,7 @@ Description A 3×4 matrix (3 rows, 4 columns) used for 3D linear transformations. It can represent transformations such as translation, rotation, and 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. +For a general introduction, see the :doc:`Matrices and transforms <../tutorials/math/matrices_and_transforms>` tutorial. .. note:: @@ -137,6 +137,10 @@ Operators +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform3D` | :ref:`operator *` **(** :ref:`int` right **)** | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform3D` | :ref:`operator /` **(** :ref:`float` right **)** | + +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform3D` | :ref:`operator /` **(** :ref:`int` right **)** | + +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`operator ==` **(** :ref:`Transform3D` right **)** | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ @@ -567,6 +571,30 @@ This operator multiplies all components of the **Transform3D**, including the :r ---- +.. _class_Transform3D_operator_div_float: + +.. rst-class:: classref-operator + +:ref:`Transform3D` **operator /** **(** :ref:`float` right **)** + +This operator divides all components of the **Transform3D**, including the :ref:`origin` vector, which inversely scales it uniformly. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Transform3D_operator_div_int: + +.. rst-class:: classref-operator + +:ref:`Transform3D` **operator /** **(** :ref:`int` right **)** + +This operator divides all components of the **Transform3D**, including the :ref:`origin` vector, which inversely scales it uniformly. + +.. rst-class:: classref-item-separator + +---- + .. _class_Transform3D_operator_eq_Transform3D: .. rst-class:: classref-operator diff --git a/classes/class_tree.rst b/classes/class_tree.rst index 5228f1d0cc3..f16b6fe4889 100644 --- a/classes/class_tree.rst +++ b/classes/class_tree.rst @@ -186,125 +186,133 @@ Theme Properties .. table:: :widths: auto - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`children_hl_line_color` | ``Color(0.27, 0.27, 0.27, 1)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`custom_button_font_highlight` | ``Color(0.95, 0.95, 0.95, 1)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`drop_position_color` | ``Color(1, 1, 1, 1)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`font_color` | ``Color(0.7, 0.7, 0.7, 1)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`font_outline_color` | ``Color(1, 1, 1, 1)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`font_selected_color` | ``Color(1, 1, 1, 1)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`guide_color` | ``Color(0.7, 0.7, 0.7, 0.25)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`parent_hl_line_color` | ``Color(0.27, 0.27, 0.27, 1)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`relationship_line_color` | ``Color(0.27, 0.27, 0.27, 1)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Color` | :ref:`title_button_color` | ``Color(0.875, 0.875, 0.875, 1)`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`button_margin` | ``4`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`children_hl_line_width` | ``1`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`draw_guides` | ``1`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`draw_relationship_lines` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`h_separation` | ``4`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`icon_max_width` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`inner_item_margin_bottom` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`inner_item_margin_left` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`inner_item_margin_right` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`inner_item_margin_top` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`item_margin` | ``16`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`outline_size` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`parent_hl_line_margin` | ``0`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`parent_hl_line_width` | ``1`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`relationship_line_width` | ``1`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`scroll_border` | ``4`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`scroll_speed` | ``12`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`scrollbar_h_separation` | ``4`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`scrollbar_margin_bottom` | ``-1`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`scrollbar_margin_left` | ``-1`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`scrollbar_margin_right` | ``-1`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`scrollbar_margin_top` | ``-1`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`scrollbar_v_separation` | ``4`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`v_separation` | ``4`` | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Font` | :ref:`font` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Font` | :ref:`title_button_font` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`font_size` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`int` | :ref:`title_button_font_size` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Texture2D` | :ref:`arrow` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Texture2D` | :ref:`arrow_collapsed` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Texture2D` | :ref:`arrow_collapsed_mirrored` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Texture2D` | :ref:`checked` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Texture2D` | :ref:`indeterminate` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Texture2D` | :ref:`select_arrow` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Texture2D` | :ref:`unchecked` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`Texture2D` | :ref:`updown` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :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:`focus` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :ref:`StyleBox` | :ref:`panel` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ - | :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` | | - +-----------------------------------+------------------------------------------------------------------------------------------+-----------------------------------+ + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`children_hl_line_color` | ``Color(0.27, 0.27, 0.27, 1)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`custom_button_font_highlight` | ``Color(0.95, 0.95, 0.95, 1)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`drop_position_color` | ``Color(1, 1, 1, 1)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`font_color` | ``Color(0.7, 0.7, 0.7, 1)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`font_disabled_color` | ``Color(0.875, 0.875, 0.875, 0.5)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`font_outline_color` | ``Color(1, 1, 1, 1)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`font_selected_color` | ``Color(1, 1, 1, 1)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`guide_color` | ``Color(0.7, 0.7, 0.7, 0.25)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`parent_hl_line_color` | ``Color(0.27, 0.27, 0.27, 1)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`relationship_line_color` | ``Color(0.27, 0.27, 0.27, 1)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Color` | :ref:`title_button_color` | ``Color(0.875, 0.875, 0.875, 1)`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`button_margin` | ``4`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`children_hl_line_width` | ``1`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`draw_guides` | ``1`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`draw_relationship_lines` | ``0`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`h_separation` | ``4`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`icon_max_width` | ``0`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`inner_item_margin_bottom` | ``0`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`inner_item_margin_left` | ``0`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`inner_item_margin_right` | ``0`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`inner_item_margin_top` | ``0`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`item_margin` | ``16`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`outline_size` | ``0`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`parent_hl_line_margin` | ``0`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`parent_hl_line_width` | ``1`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`relationship_line_width` | ``1`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`scroll_border` | ``4`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`scroll_speed` | ``12`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`scrollbar_h_separation` | ``4`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`scrollbar_margin_bottom` | ``-1`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`scrollbar_margin_left` | ``-1`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`scrollbar_margin_right` | ``-1`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`scrollbar_margin_top` | ``-1`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`scrollbar_v_separation` | ``4`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`v_separation` | ``4`` | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Font` | :ref:`font` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Font` | :ref:`title_button_font` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`font_size` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`int` | :ref:`title_button_font_size` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`arrow` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`arrow_collapsed` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`arrow_collapsed_mirrored` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`checked` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`checked_disabled` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`indeterminate` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`indeterminate_disabled` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`select_arrow` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`unchecked` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`unchecked_disabled` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`Texture2D` | :ref:`updown` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :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:`focus` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :ref:`StyleBox` | :ref:`panel` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ + | :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` | | + +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ .. rst-class:: classref-section-separator @@ -1344,6 +1352,18 @@ Default text :ref:`Color` of the item. ---- +.. _class_Tree_theme_color_font_disabled_color: + +.. rst-class:: classref-themeproperty + +:ref:`Color` **font_disabled_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` + +Text :ref:`Color` for a :ref:`TreeItem.CELL_MODE_CHECK` mode cell when it's non-editable (see :ref:`TreeItem.set_editable`). + +.. rst-class:: classref-item-separator + +---- + .. _class_Tree_theme_color_font_outline_color: .. rst-class:: classref-themeproperty @@ -1796,7 +1816,19 @@ The arrow icon used when a foldable item is collapsed (for right-to-left layouts :ref:`Texture2D` **checked** -The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is checked. +The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is checked and editable (see :ref:`TreeItem.set_editable`). + +.. rst-class:: classref-item-separator + +---- + +.. _class_Tree_theme_icon_checked_disabled: + +.. rst-class:: classref-themeproperty + +:ref:`Texture2D` **checked_disabled** + +The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is checked and non-editable (see :ref:`TreeItem.set_editable`). .. rst-class:: classref-item-separator @@ -1808,7 +1840,19 @@ The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` **indeterminate** -The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is indeterminate. +The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is indeterminate and editable (see :ref:`TreeItem.set_editable`). + +.. rst-class:: classref-item-separator + +---- + +.. _class_Tree_theme_icon_indeterminate_disabled: + +.. rst-class:: classref-themeproperty + +:ref:`Texture2D` **indeterminate_disabled** + +The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is indeterminate and non-editable (see :ref:`TreeItem.set_editable`). .. rst-class:: classref-item-separator @@ -1832,7 +1876,19 @@ The arrow icon to display for the :ref:`TreeItem.CELL_MODE_RANGE` **unchecked** -The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is unchecked. +The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is unchecked and editable (see :ref:`TreeItem.set_editable`). + +.. rst-class:: classref-item-separator + +---- + +.. _class_Tree_theme_icon_unchecked_disabled: + +.. rst-class:: classref-themeproperty + +:ref:`Texture2D` **unchecked_disabled** + +The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is unchecked and non-editable (see :ref:`TreeItem.set_editable`). .. rst-class:: classref-item-separator diff --git a/classes/class_treeitem.rst b/classes/class_treeitem.rst index 58acc52d5b7..876722f61cd 100644 --- a/classes/class_treeitem.rst +++ b/classes/class_treeitem.rst @@ -74,6 +74,8 @@ Methods +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_button_by_id` **(** :ref:`int` column, :ref:`int` id **)** |const| | +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`get_button_color` **(** :ref:`int` column, :ref:`int` id **)** |const| | + +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_button_count` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_button_id` **(** :ref:`int` column, :ref:`int` button_index **)** |const| | @@ -92,6 +94,8 @@ Methods +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_custom_color` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Callable` | :ref:`get_custom_draw_callback` **(** :ref:`int` column **)** |const| | + +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Font` | :ref:`get_custom_font` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_custom_font_size` **(** :ref:`int` column **)** |const| | @@ -202,6 +206,8 @@ Methods +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_draw` **(** :ref:`int` column, :ref:`Object` object, :ref:`StringName` callback **)** | +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_custom_draw_callback` **(** :ref:`int` column, :ref:`Callable` callback **)** | + +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_font` **(** :ref:`int` column, :ref:`Font` font **)** | +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_font_size` **(** :ref:`int` column, :ref:`int` font_size **)** | @@ -304,6 +310,10 @@ Cell contains an icon. :ref:`TreeCellMode` **CELL_MODE_CUSTOM** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-section-separator @@ -524,6 +534,18 @@ Returns the button index if there is a button with ID ``id`` in column ``column` ---- +.. _class_TreeItem_method_get_button_color: + +.. rst-class:: classref-method + +:ref:`Color` **get_button_color** **(** :ref:`int` column, :ref:`int` id **)** |const| + +Returns the color of the button with ID ``id`` in column ``column``. If the specified button does not exist, returns :ref:`Color.BLACK`. + +.. rst-class:: classref-item-separator + +---- + .. _class_TreeItem_method_get_button_count: .. rst-class:: classref-method @@ -634,6 +656,18 @@ Returns the custom color of column ``column``. ---- +.. _class_TreeItem_method_get_custom_draw_callback: + +.. rst-class:: classref-method + +:ref:`Callable` **get_custom_draw_callback** **(** :ref:`int` column **)** |const| + +Returns the custom callback of column ``column``. + +.. rst-class:: classref-item-separator + +---- + .. _class_TreeItem_method_get_custom_font: .. rst-class:: classref-method @@ -1316,6 +1350,22 @@ 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`. +\ *Deprecated.* Use :ref:`set_custom_draw_callback` instead. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TreeItem_method_set_custom_draw_callback: + +.. rst-class:: classref-method + +void **set_custom_draw_callback** **(** :ref:`int` column, :ref:`Callable` callback **)** + +Sets the given column's custom draw callback. Use an empty :ref:`Callable` (``Callable()``) to clear the custom callback. + +The ``callback`` should accept two arguments: the **TreeItem** that is drawn and its position and size as a :ref:`Rect2`. + .. rst-class:: classref-item-separator ---- @@ -1612,9 +1662,7 @@ Sets the given column's tooltip text. void **uncollapse_tree** **(** **)** -.. container:: contribute - - There is currently no description for this method. Please help us by :ref:`contributing one `! +Uncollapses all **TreeItem**\ s necessary to reveal this **TreeItem**, i.e. all ancestor **TreeItem**\ s. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_tween.rst b/classes/class_tween.rst index a427e5eb694..05d207e046e 100644 --- a/classes/class_tween.rst +++ b/classes/class_tween.rst @@ -21,7 +21,7 @@ Description Tweens are mostly 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. Animating something with a **Tween** is called tweening. -\ **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**; it would be difficult to do the same thing with an :ref:`AnimationPlayer` node. Tweens are also more light-weight than :ref:`AnimationPlayer`, so they are very much suited for simple animations or general tasks that don't require visual tweaking provided by the editor. They can be used in a fire-and-forget manner for some logic that normally would be done by code. You can e.g. make something shoot periodically by using a looped :ref:`CallbackTweener` with a delay. +\ **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**; it would be difficult to do the same thing with an :ref:`AnimationPlayer` node. Tweens are also more light-weight than :ref:`AnimationPlayer`, so they are very much suited for simple animations or general tasks that don't require visual tweaking provided by the editor. They can be used in a "fire-and-forget" manner for some logic that normally would be done by code. You can e.g. make something shoot periodically by using a looped :ref:`CallbackTweener` with a delay. A **Tween** can be created by using either :ref:`SceneTree.create_tween` or :ref:`Node.create_tween`. **Tween**\ s created manually (i.e. by using ``Tween.new()``) are invalid and can't be used for tweening values. diff --git a/classes/class_undoredo.rst b/classes/class_undoredo.rst index 7ee3c1e1bc2..8247e9076d4 100644 --- a/classes/class_undoredo.rst +++ b/classes/class_undoredo.rst @@ -120,6 +120,18 @@ If you are registering multiple properties/method which depend on one another, b +.. rst-class:: classref-reftable-group + +Properties +---------- + +.. table:: + :widths: auto + + +-----------------------+-----------------------------------------------------+-------+ + | :ref:`int` | :ref:`max_steps` | ``0`` | + +-----------------------+-----------------------------------------------------+-------+ + .. rst-class:: classref-reftable-group Methods @@ -234,6 +246,28 @@ Makes subsequent actions with the same name be merged into one. .. rst-class:: classref-descriptions-group +Property Descriptions +--------------------- + +.. _class_UndoRedo_property_max_steps: + +.. rst-class:: classref-property + +:ref:`int` **max_steps** = ``0`` + +.. rst-class:: classref-property-setget + +- void **set_max_steps** **(** :ref:`int` value **)** +- :ref:`int` **get_max_steps** **(** **)** + +The maximum number of steps that can be stored in the undo/redo history. If the number of stored steps exceeds this limit, older steps are removed from history and can no longer be reached by calling :ref:`undo`. A value of ``0`` or lower means no limit. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + Method Descriptions ------------------- diff --git a/classes/class_vector2i.rst b/classes/class_vector2i.rst index 56b3dfdb12f..bb3fb590b6a 100644 --- a/classes/class_vector2i.rst +++ b/classes/class_vector2i.rst @@ -81,6 +81,10 @@ Methods +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`clamp` **(** :ref:`Vector2i` min, :ref:`Vector2i` max **)** |const| | +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`distance_squared_to` **(** :ref:`Vector2i` to **)** |const| | + +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`distance_to` **(** :ref:`Vector2i` to **)** |const| | + +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`length` **(** **)** |const| | +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`length_squared` **(** **)** |const| | @@ -352,6 +356,32 @@ Returns a new vector with all components clamped between the components of ``min ---- +.. _class_Vector2i_method_distance_squared_to: + +.. rst-class:: classref-method + +:ref:`int` **distance_squared_to** **(** :ref:`Vector2i` to **)** |const| + +Returns the squared distance between this vector and ``to``. + +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. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Vector2i_method_distance_to: + +.. rst-class:: classref-method + +:ref:`float` **distance_to** **(** :ref:`Vector2i` to **)** |const| + +Returns the distance between this vector and ``to``. + +.. rst-class:: classref-item-separator + +---- + .. _class_Vector2i_method_length: .. rst-class:: classref-method diff --git a/classes/class_vector3i.rst b/classes/class_vector3i.rst index f5bf5c78bc8..a881ea5c799 100644 --- a/classes/class_vector3i.rst +++ b/classes/class_vector3i.rst @@ -81,6 +81,10 @@ Methods +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3i` | :ref:`clamp` **(** :ref:`Vector3i` min, :ref:`Vector3i` max **)** |const| | +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`distance_squared_to` **(** :ref:`Vector3i` to **)** |const| | + +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`distance_to` **(** :ref:`Vector3i` to **)** |const| | + +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`length` **(** **)** |const| | +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`length_squared` **(** **)** |const| | @@ -376,6 +380,32 @@ Returns a new vector with all components clamped between the components of ``min ---- +.. _class_Vector3i_method_distance_squared_to: + +.. rst-class:: classref-method + +:ref:`int` **distance_squared_to** **(** :ref:`Vector3i` to **)** |const| + +Returns the squared distance between this vector and ``to``. + +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. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Vector3i_method_distance_to: + +.. rst-class:: classref-method + +:ref:`float` **distance_to** **(** :ref:`Vector3i` to **)** |const| + +Returns the distance between this vector and ``to``. + +.. rst-class:: classref-item-separator + +---- + .. _class_Vector3i_method_length: .. rst-class:: classref-method diff --git a/classes/class_vector4i.rst b/classes/class_vector4i.rst index 6b98458efd7..4a26815ac30 100644 --- a/classes/class_vector4i.rst +++ b/classes/class_vector4i.rst @@ -21,7 +21,7 @@ A 4-element structure that can be used to represent 4D grid coordinates or any o It uses integer coordinates and is therefore preferable to :ref:`Vector4` when exact precision is required. Note that the values are limited to 32 bits, and unlike :ref:`Vector4` this cannot be configured with an engine build option. Use :ref:`int` or :ref:`PackedInt64Array` if 64-bit values are needed. -\ **Note:** In a boolean context, a Vector4i will evaluate to ``false`` if it's equal to ``Vector4i(0, 0, 0, 0)``. Otherwise, a Vector3i will always evaluate to ``true``. +\ **Note:** In a boolean context, a Vector4i will evaluate to ``false`` if it's equal to ``Vector4i(0, 0, 0, 0)``. Otherwise, a Vector4i will always evaluate to ``true``. .. rst-class:: classref-reftable-group @@ -72,6 +72,10 @@ Methods +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector4i` | :ref:`clamp` **(** :ref:`Vector4i` min, :ref:`Vector4i` max **)** |const| | +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`distance_squared_to` **(** :ref:`Vector4i` to **)** |const| | + +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`distance_to` **(** :ref:`Vector4i` to **)** |const| | + +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`length` **(** **)** |const| | +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`length_squared` **(** **)** |const| | @@ -339,6 +343,32 @@ Returns a new vector with all components clamped between the components of ``min ---- +.. _class_Vector4i_method_distance_squared_to: + +.. rst-class:: classref-method + +:ref:`int` **distance_squared_to** **(** :ref:`Vector4i` to **)** |const| + +Returns the squared distance between this vector and ``to``. + +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. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Vector4i_method_distance_to: + +.. rst-class:: classref-method + +:ref:`float` **distance_to** **(** :ref:`Vector4i` to **)** |const| + +Returns the distance between this vector and ``to``. + +.. rst-class:: classref-item-separator + +---- + .. _class_Vector4i_method_length: .. rst-class:: classref-method diff --git a/classes/class_vehiclewheel3d.rst b/classes/class_vehiclewheel3d.rst index 7e8612be9f9..5ae487e5e56 100644 --- a/classes/class_vehiclewheel3d.rst +++ b/classes/class_vehiclewheel3d.rst @@ -333,7 +333,7 @@ This is the distance in meters the wheel is lowered from its origin point. Don't - void **set_roll_influence** **(** :ref:`float` value **)** - :ref:`float` **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. +This value affects the roll of your vehicle. If set to 1.0 for all wheels, your vehicle will resist body roll, while a value of 0.0 will be prone to rolling over. .. rst-class:: classref-section-separator diff --git a/classes/class_videostream.rst b/classes/class_videostream.rst index abe3c5a8da7..f024deadd14 100644 --- a/classes/class_videostream.rst +++ b/classes/class_videostream.rst @@ -30,6 +30,8 @@ Tutorials - :doc:`Playing videos <../tutorials/animation/playing_videos>` +- :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_videostreamplayer.rst b/classes/class_videostreamplayer.rst index 901b798505b..79901416ab2 100644 --- a/classes/class_videostreamplayer.rst +++ b/classes/class_videostreamplayer.rst @@ -23,8 +23,6 @@ A control used for playback of :ref:`VideoStream` resources. Supported video formats are `Ogg Theora `__ (``.ogv``, :ref:`VideoStreamTheora`) and any format exposed via a GDExtension plugin. -\ **Note:** Due to a bug, VideoStreamPlayer does not support localization remapping yet. - \ **Warning:** On Web, video playback *will* perform poorly due to missing architecture-specific assembly optimizations. .. rst-class:: classref-introduction-group diff --git a/classes/class_viewport.rst b/classes/class_viewport.rst index 62d8d61b1e3..a35cae4c5db 100644 --- a/classes/class_viewport.rst +++ b/classes/class_viewport.rst @@ -191,6 +191,8 @@ Methods +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Control` | :ref:`gui_get_focus_owner` **(** **)** |const| | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Control` | :ref:`gui_get_hovered_control` **(** **)** |const| | + +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`gui_is_drag_successful` **(** **)** |const| | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`gui_is_dragging` **(** **)** |const| | @@ -508,6 +510,10 @@ enum **RenderInfoType**: :ref:`RenderInfoType` **RENDER_INFO_TYPE_VISIBLE** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_RENDER_INFO_TYPE_SHADOW: @@ -516,6 +522,10 @@ enum **RenderInfoType**: :ref:`RenderInfoType` **RENDER_INFO_TYPE_SHADOW** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_RENDER_INFO_TYPE_MAX: @@ -524,6 +534,10 @@ enum **RenderInfoType**: :ref:`RenderInfoType` **RENDER_INFO_TYPE_MAX** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -558,6 +572,10 @@ Objects are displayed without light information. :ref:`DebugDraw` **DEBUG_DRAW_LIGHTING** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_OVERDRAW: @@ -582,6 +600,10 @@ Objects are displayed in wireframe style. :ref:`DebugDraw` **DEBUG_DRAW_NORMAL_BUFFER** = ``5`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_VOXEL_GI_ALBEDO: @@ -630,6 +652,10 @@ Draws the shadow atlas that stores shadows from :ref:`DirectionalLight3D` **DEBUG_DRAW_SCENE_LUMINANCE** = ``11`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_SSAO: @@ -670,6 +696,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_SDFGI** = ``16`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_SDFGI_PROBES: @@ -678,6 +708,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_SDFGI_PROBES** = ``17`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_GI_BUFFER: @@ -686,6 +720,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_GI_BUFFER** = ``18`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_DISABLE_LOD: @@ -694,6 +732,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_DISABLE_LOD** = ``19`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS: @@ -702,6 +744,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_CLUSTER_OMNI_LIGHTS** = ``20`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS: @@ -710,6 +756,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_CLUSTER_SPOT_LIGHTS** = ``21`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_DECALS: @@ -718,6 +768,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_CLUSTER_DECALS** = ``22`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES: @@ -726,6 +780,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_CLUSTER_REFLECTION_PROBES** = ``23`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_OCCLUDERS: @@ -734,6 +792,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_OCCLUDERS** = ``24`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_MOTION_VECTORS: @@ -742,6 +804,10 @@ Draws the decal atlas used by :ref:`Decal`\ s and light projector t :ref:`DebugDraw` **DEBUG_DRAW_MOTION_VECTORS** = ``25`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_DEBUG_DRAW_INTERNAL_BUFFER: @@ -768,7 +834,7 @@ enum **DefaultCanvasItemTextureFilter**: :ref:`DefaultCanvasItemTextureFilter` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST** = ``0`` -The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. +The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR: @@ -776,7 +842,7 @@ The texture filter reads from the nearest pixel only. The simplest and fastest m :ref:`DefaultCanvasItemTextureFilter` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR** = ``1`` -The texture filter blends between the nearest 4 pixels. Use this when you want to avoid a pixelated style, but do not want mipmaps. +The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: @@ -784,7 +850,9 @@ The texture filter blends between the nearest 4 pixels. Use this when you want t :ref:`DefaultCanvasItemTextureFilter` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS** = ``2`` -The texture filter reads from the nearest pixel in the nearest mipmap. The fastest way to read from textures with mipmaps. +The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look smooth from up close, and smooth from a distance. + +Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: @@ -792,7 +860,9 @@ The texture filter reads from the nearest pixel in the nearest mipmap. The faste :ref:`DefaultCanvasItemTextureFilter` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS** = ``3`` -The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. +The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look pixelated from up close, and smooth from a distance. + +Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX: @@ -860,6 +930,10 @@ enum **SDFOversize**: :ref:`SDFOversize` **SDF_OVERSIZE_100_PERCENT** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_SDF_OVERSIZE_120_PERCENT: @@ -868,6 +942,10 @@ enum **SDFOversize**: :ref:`SDFOversize` **SDF_OVERSIZE_120_PERCENT** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_SDF_OVERSIZE_150_PERCENT: @@ -876,6 +954,10 @@ enum **SDFOversize**: :ref:`SDFOversize` **SDF_OVERSIZE_150_PERCENT** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_SDF_OVERSIZE_200_PERCENT: @@ -884,6 +966,10 @@ enum **SDFOversize**: :ref:`SDFOversize` **SDF_OVERSIZE_200_PERCENT** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_SDF_OVERSIZE_MAX: @@ -892,6 +978,10 @@ enum **SDFOversize**: :ref:`SDFOversize` **SDF_OVERSIZE_MAX** = ``4`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -910,6 +1000,10 @@ enum **SDFScale**: :ref:`SDFScale` **SDF_SCALE_100_PERCENT** = ``0`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_SDF_SCALE_50_PERCENT: @@ -918,6 +1012,10 @@ enum **SDFScale**: :ref:`SDFScale` **SDF_SCALE_50_PERCENT** = ``1`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_SDF_SCALE_25_PERCENT: @@ -926,6 +1024,10 @@ enum **SDFScale**: :ref:`SDFScale` **SDF_SCALE_25_PERCENT** = ``2`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. _class_Viewport_constant_SDF_SCALE_MAX: @@ -934,6 +1036,10 @@ enum **SDFScale**: :ref:`SDFScale` **SDF_SCALE_MAX** = ``3`` +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + .. rst-class:: classref-item-separator @@ -1907,7 +2013,7 @@ Returns the mouse's position in this **Viewport** using the coordinate system of :ref:`PositionalShadowAtlasQuadrantSubdiv` **get_positional_shadow_atlas_quadrant_subdiv** **(** :ref:`int` quadrant **)** |const| -Returns the :ref:`PositionalShadowAtlasQuadrantSubdiv` of the specified quadrant. +Returns the positional shadow atlas quadrant subdivision of the specified quadrant. .. rst-class:: classref-item-separator @@ -2005,6 +2111,20 @@ Returns the :ref:`Control` having the focus within this viewport. ---- +.. _class_Viewport_method_gui_get_hovered_control: + +.. rst-class:: classref-method + +:ref:`Control` **gui_get_hovered_control** **(** **)** |const| + +Returns the :ref:`Control` that the mouse is currently hovering over in this viewport. If no :ref:`Control` has the cursor, returns null. + +Typically the leaf :ref:`Control` node or deepest level of the subtree which claims hover. This is very useful when used together with :ref:`Node.is_ancestor_of` to find if the mouse is within a control tree. + +.. rst-class:: classref-item-separator + +---- + .. _class_Viewport_method_gui_is_drag_successful: .. rst-class:: classref-method diff --git a/classes/class_visualshadernodetextureparameter.rst b/classes/class_visualshadernodetextureparameter.rst index 9ba2f704b75..b0baaedae4e 100644 --- a/classes/class_visualshadernodetextureparameter.rst +++ b/classes/class_visualshadernodetextureparameter.rst @@ -164,7 +164,7 @@ Sample the texture using the filter determined by the node this shader is attach :ref:`TextureFilter` **FILTER_NEAREST** = ``1`` -The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. +The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR: @@ -172,7 +172,7 @@ The texture filter reads from the nearest pixel only. The simplest and fastest m :ref:`TextureFilter` **FILTER_LINEAR** = ``2`` -The texture filter blends between the nearest four pixels. Use this for most cases where you want to avoid a pixelated style. +The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). .. _class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST_MIPMAP: @@ -180,7 +180,9 @@ The texture filter blends between the nearest four pixels. Use this for most cas :ref:`TextureFilter` **FILTER_NEAREST_MIPMAP** = ``3`` -The texture filter reads from the nearest pixel in the nearest mipmap. This is the fastest way to read from textures with mipmaps. +The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look pixelated from up close, and smooth from a distance. + +Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP: @@ -188,7 +190,9 @@ The texture filter reads from the nearest pixel in the nearest mipmap. This is t :ref:`TextureFilter` **FILTER_LINEAR_MIPMAP** = ``4`` -The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. +The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``). This makes the texture look smooth from up close, and smooth from a distance. + +Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST_MIPMAP_ANISOTROPIC: @@ -196,9 +200,9 @@ The texture filter blends between the nearest 4 pixels and between the nearest 2 :ref:`TextureFilter` **FILTER_NEAREST_MIPMAP_ANISOTROPIC** = ``5`` -The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. +The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. -\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_LINEAR_MIPMAP` is usually more appropriate. +\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_NEAREST_MIPMAP` is usually more appropriate in this case. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP_ANISOTROPIC: @@ -206,9 +210,9 @@ The texture filter reads from the nearest pixel, but selects a mipmap based on t :ref:`TextureFilter` **FILTER_LINEAR_MIPMAP_ANISOTROPIC** = ``6`` -The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. +The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter` is ``true``) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level`. -\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_LINEAR_MIPMAP` is usually more appropriate. +\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_LINEAR_MIPMAP` is usually more appropriate in this case. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_MAX: diff --git a/classes/class_webrtcpeerconnection.rst b/classes/class_webrtcpeerconnection.rst index 7188fdf4a9a..bbde093947d 100644 --- a/classes/class_webrtcpeerconnection.rst +++ b/classes/class_webrtcpeerconnection.rst @@ -376,7 +376,7 @@ Returns the ICE :ref:`GatheringState` :ref:`SignalingState` **get_signaling_state** **(** **)** |const| -Returns the :ref:`SignalingState` on the local end of the connection while connecting or reconnecting to another peer. +Returns the signaling state on the local end of the connection while connecting or reconnecting to another peer. .. rst-class:: classref-item-separator diff --git a/classes/class_window.rst b/classes/class_window.rst index 17e3e4258f9..dde6a1121bf 100644 --- a/classes/class_window.rst +++ b/classes/class_window.rst @@ -84,6 +84,8 @@ Properties +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+ | :ref:`bool` | :ref:`transient` | ``false`` | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+ + | :ref:`bool` | :ref:`transient_to_focused` | ``false`` | + +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+ | :ref:`bool` | :ref:`transparent` | ``false`` | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+ | :ref:`bool` | :ref:`unfocusable` | ``false`` | @@ -1365,6 +1367,23 @@ Note that behavior might be different depending on the platform. ---- +.. _class_Window_property_transient_to_focused: + +.. rst-class:: classref-property + +:ref:`bool` **transient_to_focused** = ``false`` + +.. rst-class:: classref-property-setget + +- void **set_transient_to_focused** **(** :ref:`bool` value **)** +- :ref:`bool` **is_transient_to_focused** **(** **)** + +If ``true``, and the **Window** is :ref:`transient`, this window will (at the time of becoming visible) become transient to the currently focused window instead of the immediate parent window in the hierarchy. Note that the transient parent is assigned at the time this window becomes visible, so changing it afterwards has no effect until re-shown. + +.. rst-class:: classref-item-separator + +---- + .. _class_Window_property_transparent: .. rst-class:: classref-property @@ -1380,7 +1399,7 @@ If ``true``, the **Window**'s background can be transparent. This is best used w \ **Note:** Transparency support is implemented on Linux, macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. -\ **Note:** This property has no effect if either :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed`, or the window's :ref:`Viewport.transparent_bg` is set to ``false``. +\ **Note:** This property has no effect if :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed` is set to ``false``. .. rst-class:: classref-item-separator @@ -2077,6 +2096,8 @@ void **move_to_foreground** **(** **)** Moves the **Window** on top of other windows and focuses it. +\ *Deprecated.* Use :ref:`grab_focus` instead. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_workerthreadpool.rst b/classes/class_workerthreadpool.rst index 6e2cda3d480..81a325ac7ca 100644 --- a/classes/class_workerthreadpool.rst +++ b/classes/class_workerthreadpool.rst @@ -200,7 +200,7 @@ Returns :ref:`@GlobalScope.OK` if the task could Returns :ref:`@GlobalScope.ERR_INVALID_PARAMETER` if a task with the passed ID does not exist (maybe because it was already awaited and disposed of). -Returns :ref:`@GlobalScope.ERR_BUSY` if the call is made from another running task and, due to task scheduling, the task to await is at a lower level in the call stack and therefore can't progress. This is an advanced situation that should only matter when some tasks depend on others. +Returns :ref:`@GlobalScope.ERR_BUSY` if the call is made from another running task and, due to task scheduling, there's potential for deadlocking (e.g., the task to await may be at a lower level in the call stack and therefore can't progress). This is an advanced situation that should only matter when some tasks depend on others (in the current implementation, the tricky case is a task trying to wait on an older 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.)` diff --git a/classes/class_xrinterface.rst b/classes/class_xrinterface.rst index c535049adbd..446ef15b845 100644 --- a/classes/class_xrinterface.rst +++ b/classes/class_xrinterface.rst @@ -290,7 +290,7 @@ Player is free to move around, full positional tracking. :ref:`PlayAreaMode` **XR_PLAY_AREA_STAGE** = ``4`` -Same as :ref:`XR_PLAY_AREA_ROOMSCALE` but origin point is fixed to the center of the physical space, :ref:`XRServer.center_on_hmd` disabled. +Same as :ref:`XR_PLAY_AREA_ROOMSCALE` but origin point is fixed to the center of the physical space. In this mode, system-level recentering may be disabled, requiring the use of :ref:`XRServer.center_on_hmd`. .. rst-class:: classref-item-separator @@ -586,6 +586,8 @@ Is ``true`` if this interface has been initialized. Is ``true`` if passthrough is enabled. +\ *Deprecated.* Check if :ref:`environment_blend_mode` is :ref:`XR_ENV_BLEND_MODE_ALPHA_BLEND`, instead. + .. rst-class:: classref-item-separator ---- @@ -598,6 +600,8 @@ Is ``true`` if passthrough is enabled. Is ``true`` if this interface supports passthrough. +\ *Deprecated.* Check that :ref:`XR_ENV_BLEND_MODE_ALPHA_BLEND` is supported using :ref:`get_supported_environment_blend_modes`, instead. + .. rst-class:: classref-item-separator ---- @@ -610,7 +614,7 @@ Is ``true`` if this interface supports passthrough. Sets the active environment blend mode. -\ ``mode`` is the :ref:`EnvironmentBlendMode` starting with the next frame. +\ ``mode`` is the environment blend mode starting with the next frame. \ **Note:** Not all runtimes support all environment blend modes, so it is important to check this at startup. For example: @@ -640,6 +644,8 @@ Sets the active environment blend mode. Sets the active play area mode, will return ``false`` if the mode can't be used with this interface. +\ **Note:** Changing this after the interface has already been initialized can be jarring for the player, so it's recommended to recenter on the HMD with :ref:`XRServer.center_on_hmd` (if switching to :ref:`XR_PLAY_AREA_STAGE`) or make the switch during a scene change. + .. rst-class:: classref-item-separator ---- @@ -654,6 +660,8 @@ Starts passthrough, will return ``false`` if passthrough couldn't be started. \ **Note:** The viewport used for XR must have a transparent background, otherwise passthrough may not properly render. +\ *Deprecated.* Set the :ref:`environment_blend_mode` to :ref:`XR_ENV_BLEND_MODE_ALPHA_BLEND`, instead. + .. rst-class:: classref-item-separator ---- @@ -666,6 +674,8 @@ void **stop_passthrough** **(** **)** Stops passthrough. +\ *Deprecated.* Set the :ref:`environment_blend_mode` to :ref:`XR_ENV_BLEND_MODE_OPAQUE`, instead. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_xrinterfaceextension.rst b/classes/class_xrinterfaceextension.rst index ede44829506..d0de1b03526 100644 --- a/classes/class_xrinterfaceextension.rst +++ b/classes/class_xrinterfaceextension.rst @@ -233,7 +233,7 @@ Returns an :ref:`PackedVector3Array` that denotes the :ref:`PlayAreaMode` **_get_play_area_mode** **(** **)** |virtual| |const| -Returns the :ref:`PlayAreaMode` that sets up our play area. +Returns the play area mode that sets up our play area. .. rst-class:: classref-item-separator diff --git a/classes/class_xrorigin3d.rst b/classes/class_xrorigin3d.rst index 31c8aaab479..c339ab1b05c 100644 --- a/classes/class_xrorigin3d.rst +++ b/classes/class_xrorigin3d.rst @@ -21,11 +21,11 @@ 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 XRCamera3D, XRController3D and XRAnchor3D nodes should be direct children of this node for spatial tracking to work correctly. +Multiple origin points can be added to the scene tree, but only one can used at a time. All the :ref:`XRCamera3D`, :ref:`XRController3D`, and :ref:`XRAnchor3D` 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 XROrigin3D 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. +For example, if your character is driving a car, the **XROrigin3D** 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. .. rst-class:: classref-introduction-group @@ -68,7 +68,7 @@ Property Descriptions - void **set_current** **(** :ref:`bool` value **)** - :ref:`bool` **is_current** **(** **)** -Is this XROrigin3D node the current origin used by the :ref:`XRServer`? +If ``true``, this origin node is currently being used by the :ref:`XRServer`. Only one origin point can be used at a time. .. rst-class:: classref-item-separator @@ -85,9 +85,7 @@ Is this XROrigin3D node the current origin used by the :ref:`XRServer` value **)** - :ref:`float` **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:`XRServer` itself. +The scale of the game world compared to the real world. This is the same as :ref:`XRServer.world_scale`. By default, most AR/VR platforms assume that 1 game unit corresponds to 1 real world meter. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_xrserver.rst b/classes/class_xrserver.rst index a32116e915f..bbf3f16f114 100644 --- a/classes/class_xrserver.rst +++ b/classes/class_xrserver.rst @@ -59,6 +59,8 @@ Methods +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`center_on_hmd` **(** :ref:`RotationMode` rotation_mode, :ref:`bool` keep_height **)** | +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform3D` | :ref:`clear_reference_frame` **(** **)** |const| | + +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`XRInterface` | :ref:`find_interface` **(** :ref:`String` name **)** |const| | +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform3D` | :ref:`get_hmd_transform` **(** **)** | @@ -306,7 +308,7 @@ The current origin of our tracking space in the virtual world. This is used by t - void **set_world_scale** **(** :ref:`float` value **)** - :ref:`float` **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. +The scale of the game world compared to the real world. By default, most AR/VR platforms assume that 1 game unit corresponds to 1 real world meter. .. rst-class:: classref-section-separator @@ -363,6 +365,18 @@ You should call this method after a few seconds have passed. For example, when t ---- +.. _class_XRServer_method_clear_reference_frame: + +.. rst-class:: classref-method + +:ref:`Transform3D` **clear_reference_frame** **(** **)** |const| + +Clears the reference frame that was set by previous calls to :ref:`center_on_hmd`. + +.. rst-class:: classref-item-separator + +---- + .. _class_XRServer_method_find_interface: .. rst-class:: classref-method diff --git a/classes/index.rst b/classes/index.rst index 75b918b1bcb..8731b60a2f8 100644 --- a/classes/index.rst +++ b/classes/index.rst @@ -1,4 +1,5 @@ :github_url: hide +:allow_comments: False .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. diff --git a/community/asset_library/index.rst b/community/asset_library/index.rst index 78bb27d58ac..c50b33c34e9 100644 --- a/community/asset_library/index.rst +++ b/community/asset_library/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + Asset Library ============= diff --git a/community/channels.rst b/community/channels.rst index 1a2662aff4f..b34f5c11f00 100644 --- a/community/channels.rst +++ b/community/channels.rst @@ -9,42 +9,28 @@ Note that some of these channels are run and moderated by members of the Godot c A brief overview over these and other channels is also available on the `Godot website `_. -Q&A ---- +Forums +------ -- `Official Godot Questions & Answers `_ +- `Official Godot Forum `_ +- `Community Forum `_ -Rocket.Chat ------------ +Chats +----- - `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) `_ +- `IRC (#godotengine on Libera.Chat) `_ -Language-based communities --------------------------- +.. note:: -See the `User groups `_ page of -the website for a list of local communities. + As of January 2021, core developer chat has moved to the Godot Contributors Chat platform listed above. + IRC is less active. Please stick around to get an answer, + as it may take several hours for someone to see and answer your questions. -Social networks ---------------- +Social networks and other sites +------------------------------- - `GitHub `_ - `Facebook group `_ @@ -53,8 +39,11 @@ Social networks - `Reddit `_ - `YouTube `_ - `Steam `_ +- `itch.io `_ +- `linkin.bio `_ -Forum ------ +Language-based communities +-------------------------- -- `Godot Forums `_ +See the `User groups `_ page of +the website for a list of local communities. diff --git a/community/tutorials.rst b/community/tutorials.rst index c17eec390d9..68d0f2ce951 100644 --- a/community/tutorials.rst +++ b/community/tutorials.rst @@ -10,9 +10,7 @@ Think there is something missing here? Feel free to submit a `Pull Request `_, `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 a complete introduction to programming using Godot and GDScript, the unofficial `Godot Tutorials `_ YouTube channel is a good place to start. +The Godot video tutorials by `GDQuest `_ are well-regarded in the community and often recommended as a gentle introduction to beginners. GDQuest's *Learn GDScript From Zero* is a free and open source interactive tutorial for absolute beginners to learn to program with Godot's GDScript language. It is available as a `desktop application `_ or `in the browser `_. @@ -21,33 +19,22 @@ Some tutorials mentioned below provide more advanced tutorials, e.g. on 3D or sh Video tutorials --------------- -- `Godot Tutorials `_ (2D, GDScript, Programming Basics). -- `Emilio `_ (2D, GDScript). -- `FinePointCGI `_ (2D, 3D, GDScript and C#). -- `GDQuest `_ (2D and 3D, GDScript 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). -- `Mister Taft Creates `_ (2D, GDScript). -- `Miziziziz `_ (2D and 3D, GDScript). -- `P1X / Krzysztof Jankowski `_ (3D). -- `Pigdev `_ (2D, GDScript). -- `Steincodes `__ (2D, GDScript). -- `TheBuffED `_ (2D, GDScript). -- `Code with Tom `_ (2D and 3D, GDScript). -- `BornCG `_ (2D and 3D, GDScript). -- `TheGuideKnight `_ (2D, GDScript). -- `GDScript Dude `_ (GDScript). -- `Garbaj `_ (3D, GDScript). -- `Kasper Frandsen `_ (3D, Shaders). -- `bitbrain `_ (2D, GDScript). -- `Gwizz `_ (2D, GDScript). -- `Quiver `_ (2D, GDScript). -- `Maker Tech `_ (2D, GDScript). -- `Clear Code `_ (2D, GDScript, Programming Basics). -- `Game Dev Artisan `_ (2D, GDScript). +- `BornCG `_ (2D and 3D, GDScript) +- `Clear Code `_ (2D, GDScript, Programming Basics) +- `FencerDevLog `_ (2D, 3D, GDScript, Shaders) +- `FinePointCGI `_ (2D, 3D, GDScript and C#) +- `GDQuest `_ (2D and 3D, GDScript and C#) +- `Game Dev Artisan `_ (2D, GDScript) +- `Game Development Center `_ (2D, networked multiplayer, GDScript) +- `Game Endeavor `_ (2D, GDScript) +- `Gwizz `_ (2D, GDScript) +- `Godotneers `_ (2D, Shaders, GDScript) +- `HeartBeast `_ (2D, GDScript) +- `KidsCanCode `__ (2D and 3D, GDScript) +- `Maker Tech `_ (2D, GDScript) +- `Pigdev `_ (2D, GDScript) +- `Queble `_ (2D, GDScript) +- `Quiver `_ (2D, GDScript) Text tutorials -------------- @@ -57,16 +44,19 @@ Text tutorials - `Godot Recipes by KidsCanCode `__ - `Godot Tutorials by SomethingLikeGames `__ - `Game Dev Artisan website `__ +- `Night Quest Games Blog `__ Devlogs ------- -- `Andrea Catania (Physics & AI) `_ - `Bastiaan Olij (AR & VR) `_ +- `bitbrain `_ - `DevDuck (2D) `_ Resources --------- - `awesome-godot: A curated list of free/libre plugins, scripts and add-ons `_ +- `Godot Asset Library `_ +- `Godot Shaders: A community-driven shader library `_ - `Zeef Godot Engine: A curated directory of resources by Andre Schmitz `_ diff --git a/conf.py b/conf.py index 8aac8f7a63c..82e4c88e1b2 100644 --- a/conf.py +++ b/conf.py @@ -117,7 +117,14 @@ "zh_TW": "Godot Engine %s 正體中文 (台灣) 文件", } +# RTD normalized their language codes to ll-cc (e.g. zh-cn), +# but Sphinx did not and still uses ll_CC (e.g. zh_CN). +# `language` is the Sphinx configuration so it needs to be converted back. language = os.getenv("READTHEDOCS_LANGUAGE", "en") +if "-" in language: + (lang_name, lang_country) = language.split("-") + language = lang_name + "_" + lang_country.upper() + if not language in supported_languages.keys(): print("Unknown language: " + language) print("Supported languages: " + ", ".join(supported_languages.keys())) @@ -127,6 +134,7 @@ language = "en" is_i18n = tags.has("i18n") # noqa: F821 +print("Build language: {}, i18n tag: {}".format(language, is_i18n)) exclude_patterns = ["_build"] @@ -185,9 +193,11 @@ # Set this to `True` when in the `latest` branch to clearly indicate to the reader # that they are not reading the `stable` documentation. "godot_is_latest": True, - "godot_version": "4.2", + "godot_version": "4.3", # Enables a banner that displays the up-to-date status of each article. "godot_show_article_status": True, + # Display user-contributed notes at the bottom of pages that don't have `:allow_comments: False` at the top. + "godot_show_article_comments": on_rtd and not is_i18n, } html_logo = "img/docs_logo.svg" @@ -209,9 +219,7 @@ html_css_files.append("css/dev.css") html_js_files = [ - "js/custom.js?6", # Increment the number at the end when the file changes to bust the cache. - ('https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js', {'defer': 'defer'}), - ('js/algolia.js', {'defer': 'defer'}) + "js/custom.js?7", # Increment the number at the end when the file changes to bust the cache. ] # Output file base name for HTML help builder diff --git a/contributing/development/code_style_guidelines.rst b/contributing/development/code_style_guidelines.rst index 021a9b8823c..deb2488ea62 100644 --- a/contributing/development/code_style_guidelines.rst +++ b/contributing/development/code_style_guidelines.rst @@ -160,35 +160,35 @@ 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. */ - /*************************************************************************/ + /**************************************************************************/ + /* my_new_file.h */ + /**************************************************************************/ + /* This file is part of: */ + /* GODOT ENGINE */ + /* https://godotengine.org */ + /**************************************************************************/ + /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ + /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ + /* */ + /* 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 @@ -205,35 +205,35 @@ Example: .. 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. */ - /*************************************************************************/ + /**************************************************************************/ + /* my_new_file.cpp */ + /**************************************************************************/ + /* This file is part of: */ + /* GODOT ENGINE */ + /* https://godotengine.org */ + /**************************************************************************/ + /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ + /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ + /* */ + /* 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" diff --git a/contributing/development/compiling/compiling_for_android.rst b/contributing/development/compiling/compiling_for_android.rst index 01d84c7847a..b91b4a49da7 100644 --- a/contributing/development/compiling/compiling_for_android.rst +++ b/contributing/development/compiling/compiling_for_android.rst @@ -83,9 +83,8 @@ 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. +As Google requires all APKs to include ARMv8 (64-bit) libraries since August 2019, +the commands below 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: @@ -95,13 +94,13 @@ root directory with the following arguments: :: scons platform=android target=template_release arch=arm32 - scons platform=android target=template_release arch=arm64 - cd platform/android/java - # On Windows - .\gradlew generateGodotTemplates - # On Linux and macOS - ./gradlew generateGodotTemplates + scons platform=android target=template_release arch=arm64 generate_apk=yes +.. note:: + + If you are changing the list of architectures you're building, remember to add + ``generate_apk=yes`` to the *last* architecture you're building, so that an APK + file is generated after the build. The resulting APK will be located at ``bin/android_release.apk``. @@ -110,13 +109,7 @@ The resulting APK will be located at ``bin/android_release.apk``. :: scons platform=android target=template_debug arch=arm32 - scons platform=android target=template_debug arch=arm64 - cd platform/android/java - # On Windows - .\gradlew generateGodotTemplates - # On Linux and macOS - ./gradlew generateGodotTemplates - + scons platform=android target=template_debug arch=arm64 generate_apk=yes The resulting APK will be located at ``bin/android_debug.apk``. @@ -128,7 +121,7 @@ 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 +If you also want to include support for x86 and x86_64 devices, run the SCons command a third and fourth time with the ``arch=x86_32``, and ``arch=x86_64`` arguments before building the APK with Gradle. For example, for the release template: @@ -138,13 +131,7 @@ example, for the release template: scons platform=android target=template_release arch=arm32 scons platform=android target=template_release arch=arm64 scons platform=android target=template_release arch=x86_32 - scons platform=android target=template_release arch=x86_64 - cd platform/android/java - # On Windows - .\gradlew generateGodotTemplates - # On Linux and macOS - ./gradlew generateGodotTemplates - + scons platform=android target=template_release arch=x86_64 generate_apk=yes 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 @@ -188,7 +175,7 @@ with their respective names. The templates folder can be located in: - macOS: ``$HOME/Library/Application Support/Godot/export_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``). +``version.py`` in your Godot source repository (e.g. ``4.1.3.stable`` or ``4.2.dev``). You also need to write this same version string to a ``version.txt`` file located next to your export templates. @@ -216,13 +203,11 @@ root directory with the following arguments: scons platform=android arch=arm32 production=yes target=editor scons platform=android arch=arm64 production=yes target=editor scons platform=android arch=x86_32 production=yes target=editor - scons platform=android arch=x86_64 production=yes target=editor - cd platform/android/java - # On Windows - .\gradlew generateGodotEditor - # On Linux and macOS - ./gradlew generateGodotEditor + scons platform=android arch=x86_64 production=yes target=editor generate_apk=yes +You can skip certain architectures depending on your target device to speed up +compilation. Remember to add ``generate_apk=yes`` to the *last* architecture +you're building, so that an APK file is generated after the build. The resulting APK will be located at ``bin/android_editor_builds/android_editor-release.apk``. diff --git a/contributing/development/compiling/compiling_for_ios.rst b/contributing/development/compiling/compiling_for_ios.rst index a5b2257cc6b..4f1b2b5110f 100644 --- a/contributing/development/compiling/compiling_for_ios.rst +++ b/contributing/development/compiling/compiling_for_ios.rst @@ -15,8 +15,7 @@ Requirements - `Python 3.6+ `_. - `SCons 3.0+ `_ build system. -- `Xcode `_ - (or the more lightweight Command Line Tools for Xcode). +- `Xcode `_. If you are building the ``master`` branch: @@ -78,11 +77,11 @@ should be placed in ``libgodot.ios.debug.xcframework`` and ``libgodot.ios.releas $ cp -r misc/dist/ios_xcode . - $ cp libgodot.ios.debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a - $ lipo -create libgodot.ios.debug.arm64.simulator.a libgodot.ios.debug.x86_64.simulator.a -output ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a + $ cp libgodot.ios.template_debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a + $ lipo -create libgodot.ios.template_debug.arm64.simulator.a libgodot.ios.template_debug.x86_64.simulator.a -output ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a - $ cp libgodot.ios.opt.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a - $ lipo -create libgodot.ios.opt.arm64.simulator.a libgodot.ios.opt.x86_64.simulator.a -output ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a + $ cp libgodot.ios.template_release.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a + $ lipo -create libgodot.ios.template_release.arm64.simulator.a libgodot.ios.template_release.x86_64.simulator.a -output ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a The MoltenVK static ``.xcframework`` folder must also be placed in the ``ios_xcode`` folder once it has been created. diff --git a/contributing/development/compiling/compiling_for_linuxbsd.rst b/contributing/development/compiling/compiling_for_linuxbsd.rst index 59a39220b95..c87c2984979 100644 --- a/contributing/development/compiling/compiling_for_linuxbsd.rst +++ b/contributing/development/compiling/compiling_for_linuxbsd.rst @@ -264,6 +264,7 @@ Manager. Using Clang appears to be a requirement for OpenBSD, otherwise fonts would not build. + For RISC-V architecture devices, use the Clang compiler instead of the GCC compiler. .. note:: If you are compiling Godot for production use, then you can make the final executable smaller and faster by adding the @@ -387,7 +388,9 @@ There are two solutions: - In your SCons command, add the parameter ``use_static_cpp=no``. - Follow `these instructions `__ to configure, build, and - install ``libatomic_ops``. Then, copy ``/usr/lib/libatomic_ops.a`` to ``/usr/lib/libatomic.a``. + install ``libatomic_ops``. Then, copy ``/usr/lib/libatomic_ops.a`` to ``/usr/lib/libatomic.a``, or create a soft link + to ``libatomic_ops`` by command ``ln -s /usr/lib/libatomic_ops.a /usr/lib/libatomic.a``. The soft link can ensure the + latest ``libatomic_ops`` will be used without the need to copy it everytime when it is updated. Using mold for faster development --------------------------------- diff --git a/contributing/development/compiling/compiling_for_macos.rst b/contributing/development/compiling/compiling_for_macos.rst index f90376460c6..0029a51f414 100644 --- a/contributing/development/compiling/compiling_for_macos.rst +++ b/contributing/development/compiling/compiling_for_macos.rst @@ -128,7 +128,7 @@ of those two architectures by leaving out the ``lipo`` step below. scons platform=macos target=template_release arch=x86_64 scons platform=macos target=template_debug arch=x86_64 -- For ARM64 (Apple M1):: +- For Arm64 (Apple M1):: scons platform=macos target=template_release arch=arm64 scons platform=macos target=template_debug arch=arm64 @@ -136,20 +136,20 @@ of those two architectures by leaving out the ``lipo`` step below. 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.macos.opt.x86_64 bin/godot.macos.opt.arm64 -output bin/godot.macos.opt.universal - lipo -create bin/godot.macos.opt.debug.x86_64 bin/godot.macos.opt.debug.arm64 -output bin/godot.macos.opt.debug.universal + lipo -create bin/godot.macos.template_release.x86_64 bin/godot.macos.template_release.arm64 -output bin/godot.macos.template_release.universal + lipo -create bin/godot.macos.template_debug.x86_64 bin/godot.macos.template_debug.arm64 -output bin/godot.macos.template_debug.universal To create an ``.app`` bundle like in the official builds, you need to use the template located in ``misc/dist/macos_template.app``. The release and debug builds should be placed in ``macos_template.app/Contents/MacOS`` with the names -``godot_macos_release.64`` and ``godot_macos_debug.64`` respectively. You can do so +``godot_macos_release.universal`` and ``godot_macos_debug.universal`` 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/macos_template.app . mkdir -p macos_template.app/Contents/MacOS - cp bin/godot.macos.opt.universal macos_template.app/Contents/MacOS/godot_macos_release.64 - cp bin/godot.macos.opt.debug.universal macos_template.app/Contents/MacOS/godot_macos_debug.64 + cp bin/godot.macos.template_release.universal macos_template.app/Contents/MacOS/godot_macos_release.universal + cp bin/godot.macos.template_debug.universal macos_template.app/Contents/MacOS/godot_macos_debug.universal chmod +x macos_template.app/Contents/MacOS/godot_macos* .. note:: diff --git a/contributing/development/compiling/compiling_for_uwp.rst b/contributing/development/compiling/compiling_for_uwp.rst deleted file mode 100644 index f07e86a9cf1..00000000000 --- a/contributing/development/compiling/compiling_for_uwp.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. _doc_compiling_for_uwp: - -Compiling for Universal Windows Platform -======================================== - -.. important:: - - Compiling UWP export templates is not implemented in Godot 4. - Godot 3 has limited UWP support, but there are many - `known issues `__. - - We recommend you use the :ref:`Win32 export ` instead. diff --git a/contributing/development/compiling/compiling_for_web.rst b/contributing/development/compiling/compiling_for_web.rst index 09c6601bbb1..baa9e6e1517 100644 --- a/contributing/development/compiling/compiling_for_web.rst +++ b/contributing/development/compiling/compiling_for_web.rst @@ -15,7 +15,7 @@ Requirements To compile export templates for the Web, the following is required: -- `Emscripten 1.39.9+ `__. +- `Emscripten 3.1.39+ `__. - `Python 3.6+ `__. - `SCons 3.0+ `__ build system. @@ -25,6 +25,10 @@ To compile export templates for the Web, the following is required: For a general overview of SCons usage for Godot, see :ref:`doc_introduction_to_the_buildsystem`. +.. note:: Emscripten 3.1.39+ is recommended, but older 3.x versions are known to work. + + Please note that the minimum requirement for GDExtension support is 3.1.14. + Building export templates ------------------------- @@ -49,17 +53,17 @@ enabled. Since ``eval()`` calls can be a security concern, the 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.web.opt.wasm32.zip`` for release or ``godot.web.opt.debug.wasm32.zip`` +``godot.web.template_release.wasm32.zip`` for release or ``godot.web.template_debug.wasm32.zip`` for debug. Finally, rename the zip archive to ``web_release.zip`` for the release template:: - mv bin/godot.web.opt.wasm32.zip bin/web_release.zip + mv bin/godot.web.template_release.wasm32.zip bin/web_release.zip And ``web_debug.zip`` for the debug template:: - mv bin/godot.web.opt.debug.wasm32.zip bin/web_debug.zip + mv bin/godot.web.template_debug.wasm32.zip bin/web_debug.zip GDExtension ----------- @@ -80,8 +84,8 @@ Its name will have ``_dlink`` added. Finally, rename the zip archives to ``web_dlink_release.zip`` and ``web_dlink_release.zip`` for the release template:: - mv bin/godot.web.opt.wasm32.dlink.zip bin/web_dlink_release.zip - mv bin/godot.web.opt.debug.wasm32.dlink.zip bin/web_dlink_debug.zip + mv bin/godot.web.template_release.wasm32.dlink.zip bin/web_dlink_release.zip + mv bin/godot.web.template_debug.wasm32.dlink.zip bin/web_dlink_debug.zip Building the editor ------------------- @@ -93,7 +97,7 @@ over the native build. You can build the editor with:: scons platform=web target=editor Once finished, the resulting file will be placed in the ``bin`` subdirectory. -Its name will be ``godot.web.opt.tools.wasm32.zip``. You can upload the +Its name will be ``godot.web.editor.wasm32.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 diff --git a/contributing/development/compiling/compiling_for_windows.rst b/contributing/development/compiling/compiling_for_windows.rst index 5e7bfbfe4fd..de487eee53f 100644 --- a/contributing/development/compiling/compiling_for_windows.rst +++ b/contributing/development/compiling/compiling_for_windows.rst @@ -16,7 +16,7 @@ Requirements For compiling under Windows, the following is required: - `Visual Studio Community `_, - version 2017 or later. VS 2019 is recommended. + version 2019 or later. Visual Studio 2022 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 @@ -123,16 +123,27 @@ 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. +.. tip:: + + 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. This is particularly + the case for the GDScript VM which performs much better with MinGW compared + to MSVC. Therefore, it's recommended to use MinGW to produce builds that you + distribute to players. + + All official Godot binaries are built in + `custom containers `__ + using MinGW. Running SCons ~~~~~~~~~~~~~ After opening a command prompt, change to the root directory of -the engine source code (using ``cd``) and type:: +the engine source code (using ``cd``) and type: + +.. code-block:: doscon C:\godot> scons platform=windows @@ -162,6 +173,138 @@ dependencies. Running it will bring up the Project Manager. :ref:`doc_data_paths_self_contained_mode` by creating a file called ``._sc_`` or ``_sc_`` in the ``bin/`` folder. +Compiling with support for Direct3D 12 +-------------------------------------- + +By default, builds of Godot do not contain support for the Direct3D 12 graphics +API. + +To compile Godot with Direct3D 12 support you need at least the following: + +- `The DirectX Shader Compiler `_. + The zip folder will be named "dxc\_" followed by the date of release. Download + it anywhere, unzip it and remember the path to the unzipped folder, you will + need it below. +- `godot-nir-static library `_. + We compile the Mesa libraries you will need into a static library. Download it + anywhere, unzip it and remember the path to the unzipped folder, you will + need it below. + +.. note:: You can optionally build the godot-nir-static libraries yourself with + the following steps: + + 1. Install the Python package `mako `_ + which is needed to generate some files. + 2. Clone the `godot-nir-static `_ + directory and navigate to it. + 3. Run the following:: + + git submodule update --init + ./update_mesa.sh + scons + + If you are buildng with MinGW, add ``use_mingw=yes`` to the ``scons`` + command, you can also specify build architecture using ``arch={architecture}``. + + Mesa static library should be built using the same compiler you are + using for building Godot. + +Optionally, you can compile with the following for additional features: + +- `PIX `_ is a performance tuning + and debugging application for Direct3D12 applications. If you compile-in + support for it, you can get much more detailed information through PIX that + will help you optimize your game and troubleshoot graphics bugs. To use it, + download the WinPixEventRuntime package. You will be taken to a NuGet package + page where you can click "Download package" to get it. Once downloaded, change + the file extension to .zip and unzip the file to some path. +- `Agility SDK `_ can + be used to provide access to the latest Direct3D 12 features without relying + on driver updates. To use it, download the latest Agility SDK package. You + will be taken to a NuGet package page where you can click "Download package" + to get it. Once downloaded, change the file extension to .zip and unzip the + file to some path. + +.. note:: If you use a preview version of the Agility SDK, remember to enable + developer mode in Windows; otherwise it won't be used. + +.. note:: If you want to use a PIX with MinGW build, navigate to PIX runtime + directory and use the following commands to generate import library:: + + # For x86-64: + gendef ./bin/x64/WinPixEventRuntime.dll + dlltool --machine i386:x86-64 --no-leading-underscore -d WinPixEventRuntime.def -D WinPixEventRuntime.dll -l ./bin/x64/libWinPixEventRuntime.a + + # For ARM64: + gendef ./bin/ARM64/WinPixEventRuntime.dll + dlltool --machine arm64 --no-leading-underscore -d WinPixEventRuntime.def -D WinPixEventRuntime.dll -l ./bin/ARM64/libWinPixEventRuntime.a + +When building Godot, you will need to tell SCons to use Direct3D 12 and where to +look for the additional libraries: + +.. code-block:: doscon + + C:\godot> scons platform=windows d3d12=yes dxc_path=<...> mesa_libs=<...> + +Or, with all options enabled: + +.. code-block:: doscon + + C:\godot> scons platform=windows d3d12=yes dxc_path=<...> mesa_libs=<...> agility_sdk_path=<...> pix_path=<...> + +.. note:: The build process will copy ``dxil.dll`` from the ``bin//`` + directory in the DXC folder to the Godot binary directory and the + appropriate ``bin/`` file in the Godot binary directory. + Direct3D 12-enabled Godot packages for distribution to end users must + include the ``dxil.dll`` (and relevant folders if using multi-arch), + both for the editor and games. At runtime, the renderer will try to + load the DLL from the arch-specific folders, and will fall back to the + same directory as the Godot executable if the appropriate arch isn't + found. + +.. note:: For the Agility SDK's DLLs you have to explicitly choose the kind of + workflow. Single-arch is the default (DLLs copied to ``bin/``). If you + pass ``agility_sdk_multi_arch=yes`` to SCons, you'll opt-in for + multi-arch. DLLs will be copied to the appropriate ``bin//`` + subdirectories and at runtime the right one will be loaded. + +Compiling with ANGLE support +---------------------------- + +ANGLE provides a translation layer from OpenGL ES 3.x to Direct3D 11 and can be used +to improve support for the Compatibility renderer on some older GPUs with outdated +OpenGL drivers and on Windows for ARM. + +By default, Godot is built with dynamically linked ANGLE, you can use it by placing +``libEGL.dll`` and ``libGLESv2.dll`` alongside the executable. + +.. note:: You can use dynamically linked ANGLE with export templates as well, rename + aforementioned DLLs to ``libEGL.{architecture}.dll`` and ``libGLESv2.{architecture}.dll`` + and place them alongside export template executables, and libraries will + be automatically copied during the export process. + +To compile Godot with statically linked ANGLE: + +- Download pre-built static libraries from `godot-angle-static library `_, and unzip them. +- When building Godot, add ``angle_libs={path}`` to tell SCons where to look for the ANGLE libraries:: + + scons platform=windows angle_libs=<...> + +.. note:: You can optionally build the godot-angle-static libraries yourself with + the following steps: + + 1. Clone the `godot-angle-static `_ + directory and navigate to it. + 2. Run the following command:: + + scons + + If you are buildng with MinGW, add ``use_mingw=yes`` to the command, + you can also specify build architecture using ``arch={architecture}``. + + ANGLE static library should be built using the same compiler you are + using for building Godot. + Development in Visual Studio ---------------------------- @@ -268,7 +411,9 @@ Creating Windows export templates --------------------------------- Windows export templates are created by compiling Godot without the editor, -with the following flags:: +with the following flags: + +.. code-block:: doscon C:\godot> scons platform=windows target=template_debug arch=x86_32 C:\godot> scons platform=windows target=template_release arch=x86_32 @@ -277,7 +422,9 @@ with the following flags:: 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``):: +(such as ``3.1.1.stable`` or ``3.2.dev``): + +.. code-block:: none %USERPROFILE%\AppData\Roaming\Godot\templates\\ diff --git a/contributing/development/compiling/compiling_with_dotnet.rst b/contributing/development/compiling/compiling_with_dotnet.rst index d427e2c6796..dfbfcb51a96 100644 --- a/contributing/development/compiling/compiling_with_dotnet.rst +++ b/contributing/development/compiling/compiling_with_dotnet.rst @@ -100,23 +100,29 @@ distributed as NuGet packages. This is all transparent to the user, but it can make things complicated during development. In order to use Godot with a development version of those packages, a local -NuGet source must be created where MSBuild can find them. This can be done with -the .NET CLI: +NuGet source must be created where MSBuild can find them. -:: +First, pick a location for the local NuGet source. If you don't have a +preference, create an empty directory at one of these recommended locations: + +- On Windows, ``C:\Users\\MyLocalNugetSource`` +- On Linux, \*BSD, etc., ``~/MyLocalNugetSource`` + +This path is referred to later as ````. - dotnet nuget add source ~/MyLocalNugetSource --name MyLocalNugetSource +After picking a directory, run this .NET CLI command to configure NuGet to use +your local source: + +:: -The Godot NuGet packages must be added to that local source. Additionally, we -must make sure there are no other versions of the package in the NuGet cache, as -MSBuild may pick one of those instead. + dotnet nuget add source --name MyLocalNugetSource -In order to simplify this process, the ``build_assemblies.py`` script provides -the following ``--push-nupkgs-local`` option: +When you run the ``build_assemblies.py`` script, pass ```` to +the ``--push-nupkgs-local`` option: :: - ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local ~/MyLocalNugetSource + ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local This option ensures the packages will be added to the specified local NuGet source and that conflicting versions of the package are removed from the NuGet @@ -132,7 +138,7 @@ the ``--precision=double`` argument: :: - ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local ~/MyLocalNugetSource --precision=double + ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local --precision=double Examples -------- diff --git a/contributing/development/compiling/index.rst b/contributing/development/compiling/index.rst index 66a01388d88..9758d673cea 100644 --- a/contributing/development/compiling/index.rst +++ b/contributing/development/compiling/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + Building from source ==================== @@ -47,7 +49,6 @@ will try their best to cover all possible situations. compiling_for_android compiling_for_ios cross-compiling_for_ios_on_linux - compiling_for_uwp compiling_for_web Other compilation targets and options diff --git a/contributing/development/compiling/introduction_to_the_buildsystem.rst b/contributing/development/compiling/introduction_to_the_buildsystem.rst index 2702c99c23c..941711c1b1f 100644 --- a/contributing/development/compiling/introduction_to_the_buildsystem.rst +++ b/contributing/development/compiling/introduction_to_the_buildsystem.rst @@ -31,7 +31,6 @@ documentation to learn more: - :ref:`doc_compiling_for_ios` - :ref:`doc_compiling_for_linuxbsd` - :ref:`doc_compiling_for_macos` -- :ref:`doc_compiling_for_uwp` - :ref:`doc_compiling_for_web` - :ref:`doc_compiling_for_windows` @@ -94,7 +93,9 @@ generally with this naming convention:: godot..[.dev][.double].[.][.] -For the previous build attempt, the result would look like this:: +For the previous build attempt, the result would look like this: + +.. code-block:: console ls bin bin/godot.linuxbsd.editor.x86_64 @@ -104,7 +105,7 @@ whole editor compiled in, and is meant for 64 bits. A Windows binary with the same configuration will look like this: -.. code-block:: console +.. code-block:: doscon C:\godot> dir bin/ godot.windows.editor.64.exe @@ -450,5 +451,5 @@ line (and nothing else). This version identifier is based on the ``major``, 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, +every target. Linux and Windows come in second place, but Linux has the advantage of being the easier platform to set this up. diff --git a/contributing/development/compiling/optimizing_for_size.rst b/contributing/development/compiling/optimizing_for_size.rst index a60cf5d5761..0fc3893a080 100644 --- a/contributing/development/compiling/optimizing_for_size.rst +++ b/contributing/development/compiling/optimizing_for_size.rst @@ -258,3 +258,52 @@ following: .. seealso:: :ref:`doc_overriding_build_options`. + +Optimizing the distribution of your project +------------------------------------------- + +Desktop +^^^^^^^ + +.. note:: + + This section is only relevant when distributing the files on a desktop + platform that doesn't perform its own compression or packing. As such, this + advice is relevant when you distribute ZIP archives on itch.io or GitHub + Releases. + + Platforms like Steam already apply their own compression scheme, so you + don't need to create a ZIP archive to distribute files in the first place. + +As an aside, you can look into optimizing the distribution of your project itself. +This can be done even without recompiling the export template. + +`7-Zip `__ can be used to create ZIP archives that are more +efficient than usual, while remaining compatible with every ZIP extractor +(including Windows' own built-in extractor). ZIP size reduction in a large +project can reach dozens of megabytes compared to a typical ZIP compressor, +although average savings are in the 1-5 MB range. Creating this ZIP archive will +take longer than usual, but it will extract just as fast as any other ZIP +archive. + +When using the 7-Zip GUI, this is done by creating a ZIP archive with the Ultra +compression mode. When using the command line, this is done using the following +command: + +:: + + 7z a -mx9 my_project.zip folder_containing_executable_and_pck + +Web +^^^ + +Enabling gzip or Brotli compression for all file types from the web export +(especially the ``.wasm`` and ``.pck``) can reduce the download size +significantly, leading to faster loading times, especially on slow connections. + +Creating precompressed gzip or Brotli files with a high compression level can be +even more efficient, as long as the web server is configured to serve those +files when they exist. When supported, Brotli should be preferred over gzip as +it has a greater potential for file size reduction. + +See :ref:`doc_exporting_for_web_serving_the_files` for instructions. diff --git a/contributing/development/configuring_an_ide/clion.rst b/contributing/development/configuring_an_ide/clion.rst index 9c283d1d056..2a715f2db56 100644 --- a/contributing/development/configuring_an_ide/clion.rst +++ b/contributing/development/configuring_an_ide/clion.rst @@ -24,7 +24,7 @@ CLion does not support compiling and debugging Godot via SCons out of the box. T :: - scons + scons dev_build=yes To add a custom build target that invokes SCons for compilation: @@ -47,7 +47,7 @@ To add a custom build target that invokes SCons for compilation: .. note:: CLion does not expand shell commands like ``scons -j$(nproc)``. Use concrete values instead, e.g. ``scons -j8``. -.. figure:: img/clion-create-build-tool.png +.. figure:: img/clion-create-build-tool.webp :align: center - Back in the **External Tools** dialog, click the **+** again to add a second external tool for cleaning the Godot build via SCons. Give the tool a name, e.g. ``Clean Godot debug``, set **Program** to ``scons``, set **Arguments** to ``-c`` (which will clean the build), and set the **Working directory** to ``$ProjectFileDir$``. Click **OK** to create the tool. diff --git a/contributing/development/configuring_an_ide/img/clion-create-build-tool.png b/contributing/development/configuring_an_ide/img/clion-create-build-tool.png deleted file mode 100644 index cab02d2ea41..00000000000 Binary files a/contributing/development/configuring_an_ide/img/clion-create-build-tool.png and /dev/null differ diff --git a/contributing/development/configuring_an_ide/img/clion-create-build-tool.webp b/contributing/development/configuring_an_ide/img/clion-create-build-tool.webp new file mode 100644 index 00000000000..d11646d56b2 Binary files /dev/null and b/contributing/development/configuring_an_ide/img/clion-create-build-tool.webp differ diff --git a/contributing/development/configuring_an_ide/index.rst b/contributing/development/configuring_an_ide/index.rst index b8624988477..fedc764e9c0 100644 --- a/contributing/development/configuring_an_ide/index.rst +++ b/contributing/development/configuring_an_ide/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + .. _doc_configuring_an_ide: Configuring an IDE diff --git a/contributing/development/configuring_an_ide/visual_studio_code.rst b/contributing/development/configuring_an_ide/visual_studio_code.rst index 111cf53e0f7..349592316dc 100644 --- a/contributing/development/configuring_an_ide/visual_studio_code.rst +++ b/contributing/development/configuring_an_ide/visual_studio_code.rst @@ -80,7 +80,7 @@ To run and debug the project you need to create a new configuration in the ``lau "name": "Launch Project", "type": "lldb", "request": "launch", - // Change to godot.linuxbsd.tools.64.llvm for llvm-based builds. + // Change to godot.linuxbsd.editor.dev.x86_64.llvm for llvm-based builds. "program": "${workspaceFolder}/bin/godot.linuxbsd.editor.dev.x86_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. @@ -97,7 +97,7 @@ To run and debug the project you need to create a new configuration in the ``lau "name": "Launch Project", "type": "cppdbg", "request": "launch", - // Change to godot.linuxbsd.tools.64.llvm for llvm-based builds. + // Change to godot.linuxbsd.editor.dev.x86_64.llvm for llvm-based builds. "program": "${workspaceFolder}/bin/godot.linuxbsd.editor.dev.x86_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. diff --git a/contributing/development/core_and_modules/common_engine_methods_and_macros.rst b/contributing/development/core_and_modules/common_engine_methods_and_macros.rst index 67f0dcc8bb4..0cbd4106c78 100644 --- a/contributing/development/core_and_modules/common_engine_methods_and_macros.rst +++ b/contributing/development/core_and_modules/common_engine_methods_and_macros.rst @@ -137,11 +137,11 @@ use this snippet: .. code-block:: cpp - uint64_t begin = OS::get_singleton()->get_ticks_usec(); + uint64_t begin = Time::get_singleton()->get_ticks_usec(); // Your code here... - uint64_t end = OS::get_singleton()->get_ticks_usec(); + uint64_t end = Time::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`` diff --git a/contributing/development/core_and_modules/custom_platform_ports.rst b/contributing/development/core_and_modules/custom_platform_ports.rst index bd110afed66..80a1e09a8fe 100644 --- a/contributing/development/core_and_modules/custom_platform_ports.rst +++ b/contributing/development/core_and_modules/custom_platform_ports.rst @@ -47,7 +47,6 @@ The official platform ports can be used as a reference when creating a custom pl - `Linux/\*BSD `__ - `Android `__ - `iOS `__ -- `UWP `__ *(not currently working)* - `Web `__ While platform code is usually self-contained, there are exceptions to this diff --git a/contributing/development/core_and_modules/index.rst b/contributing/development/core_and_modules/index.rst index d0f991fe993..a97df05f2a0 100644 --- a/contributing/development/core_and_modules/index.rst +++ b/contributing/development/core_and_modules/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + Engine core and modules ======================= diff --git a/contributing/development/core_and_modules/internal_rendering_architecture.rst b/contributing/development/core_and_modules/internal_rendering_architecture.rst index 0a0dd544dcb..0a8131fa557 100644 --- a/contributing/development/core_and_modules/internal_rendering_architecture.rst +++ b/contributing/development/core_and_modules/internal_rendering_architecture.rst @@ -177,7 +177,11 @@ Vulkan driver. **Vulkan context creation:** -- `drivers/vulkan/vulkan_context.cpp `__ +- `drivers/vulkan/vulkan_context.cpp `__ + +**Direct3D 12 context creation:** + +- `drivers/d3d12/d3d12_context.cpp `__ Direct3D 12 ^^^^^^^^^^^ @@ -194,11 +198,10 @@ Mesa NIR (`more information `__ +**This driver is still experimental and only available in Godot 4.3 and later.** +While Direct3D 12 allows supporting Direct3D-exclusive features on Windows 11 such +as windowed optimizations and Auto HDR, Vulkan is still recommended for most projects. +See the `pull request that introduced Direct3D 12 support `__ for more information. Metal @@ -269,7 +272,11 @@ RenderingDevice presents a similar level of abstraction as Metal or WebGPU. **Vulkan RenderingDevice implementation:** -- `drivers/vulkan/rendering_device_vulkan.cpp `__ +- `drivers/vulkan/rendering_device_driver_vulkan.cpp `__ + +**Direct3D 12 RenderingDevice implementation:** + +- `drivers/d3d12/rendering_device_driver_d3d12.cpp `__ Core rendering classes architecture ----------------------------------- @@ -278,7 +285,7 @@ This diagram represents the structure of rendering classes in Godot, including t .. image:: img/rendering_architecture_diagram.webp -`View at full size `__ +`View at full size `__ .. _doc_internal_rendering_architecture_core_shaders: @@ -337,22 +344,22 @@ this. **Core GLSL material shaders:** -- Forward+: `servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl `__ -- Forward Mobile: `servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl `__ -- Compatibility: `drivers/gles3/shaders/scene.glsl `__ +- Forward+: `servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl `__ +- Forward Mobile: `servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl `__ +- Compatibility: `drivers/gles3/shaders/scene.glsl `__ **Material shader generation:** -- `scene/resources/material.cpp `__ +- `scene/resources/material.cpp `__ **Other GLSL shaders for Forward+ and Forward Mobile rendering methods:** -- `servers/rendering/renderer_rd/shaders/ `__ -- `modules/lightmapper_rd/ `__ +- `servers/rendering/renderer_rd/shaders/ `__ +- `modules/lightmapper_rd/ `__ **Other GLSL shaders for the Compatibility rendering method:** -- `drivers/gles3/shaders/ `__ +- `drivers/gles3/shaders/ `__ 2D and 3D rendering separation ------------------------------ @@ -388,7 +395,12 @@ release. **2D and 3D rendering buffer configuration C++ code:** -- `servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp `__ +- `servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp `__ + +**FSR 1.0:** + +- `servers/rendering/renderer_rd/effects/fsr.cpp `__ +- `thirdparty/amd-fsr/ `__ 2D rendering techniques ----------------------- @@ -415,7 +427,7 @@ used to calculate particle collisions in 2D. **2D SDF generation GLSL shader:** -- `https://github.com/godotengine/godot/blob/4.0/servers/rendering/renderer_rd/shaders/canvas_sdf.glsl `__ +- `servers/rendering/renderer_rd/shaders/canvas_sdf.glsl `__ 3D rendering techniques ----------------------- @@ -506,12 +518,19 @@ done by running the vertex shader corresponding to the previous rendered frame (with the previous camera transform) in addition to the vertex shader for the current rendered frame, then storing the difference between them in a color buffer. -Using `FSR 2.0 `__ instead -of a custom TAA implementation is planned in a future release. +Alternatively, FSR 2.2 can be used as an upscaling solution that also provides +its own temporal antialiasing algorithm. FSR 2.2 is implemented on top of the +RenderingDevice abstraction as opposed to using AMD's reference code directly. **TAA resolve:** -- `servers/rendering/renderer_rd/shaders/effects/taa_resolve.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/taa_resolve.glsl `__ + +**FSR 2.2:** + +- `servers/rendering/renderer_rd/effects/fsr2.cpp `__ +- `servers/rendering/renderer_rd/shaders/effects/fsr2/ `__ +- `thirdparty/amd-fsr2/ `__ Global illumination ^^^^^^^^^^^^^^^^^^^ @@ -538,32 +557,32 @@ This would allow baking lightmaps while using the Compatibility backend. **Core GI C++ code:** -- `servers/rendering/renderer_rd/environment/gi.cpp `__ -- `scene/3d/voxel_gi.cpp `__ - VoxelGI node -- `editor/plugins/voxel_gi_editor_plugin.cpp `__ - Editor UI for the VoxelGI node +- `servers/rendering/renderer_rd/environment/gi.cpp `__ +- `scene/3d/voxel_gi.cpp `__ - VoxelGI node +- `editor/plugins/voxel_gi_editor_plugin.cpp `__ - Editor UI for the VoxelGI node **Core GI GLSL shaders:** -- `servers/rendering/renderer_rd/shaders/environment/voxel_gi.glsl `__ -- `servers/rendering/renderer_rd/shaders/environment/voxel_gi_debug.glsl `__ - VoxelGI debug draw mode -- `servers/rendering/renderer_rd/shaders/environment/sdfgi_debug.glsl `__ - SDFGI Cascades debug draw mode -- `servers/rendering/renderer_rd/shaders/environment/sdfgi_debug_probes.glsl `__ - SDFGI Probes debug draw mode -- `servers/rendering/renderer_rd/shaders/environment/sdfgi_integrate.glsl `__ -- `servers/rendering/renderer_rd/shaders/environment/sdfgi_preprocess.glsl `__ -- `servers/rendering/renderer_rd/shaders/environment/sdfgi_direct_light.glsl `__ +- `servers/rendering/renderer_rd/shaders/environment/voxel_gi.glsl `__ +- `servers/rendering/renderer_rd/shaders/environment/voxel_gi_debug.glsl `__ - VoxelGI debug draw mode +- `servers/rendering/renderer_rd/shaders/environment/sdfgi_debug.glsl `__ - SDFGI Cascades debug draw mode +- `servers/rendering/renderer_rd/shaders/environment/sdfgi_debug_probes.glsl `__ - SDFGI Probes debug draw mode +- `servers/rendering/renderer_rd/shaders/environment/sdfgi_integrate.glsl `__ +- `servers/rendering/renderer_rd/shaders/environment/sdfgi_preprocess.glsl `__ +- `servers/rendering/renderer_rd/shaders/environment/sdfgi_direct_light.glsl `__ **Lightmapper C++ code:** -- `scene/3d/lightmap_gi.cpp `__ - LightmapGI node -- `editor/plugins/lightmap_gi_editor_plugin.cpp `__ - Editor UI for the LightmapGI node -- `scene/3d/lightmapper.cpp `__ - Abstract class -- `modules/lightmapper_rd/lightmapper_rd.cpp `__ - GPU-based lightmapper implementation +- `scene/3d/lightmap_gi.cpp `__ - LightmapGI node +- `editor/plugins/lightmap_gi_editor_plugin.cpp `__ - Editor UI for the LightmapGI node +- `scene/3d/lightmapper.cpp `__ - Abstract class +- `modules/lightmapper_rd/lightmapper_rd.cpp `__ - GPU-based lightmapper implementation **Lightmapper GLSL shaders:** -- `modules/lightmapper_rd/lm_raster.glsl `__ -- `modules/lightmapper_rd/lm_compute.glsl `__ -- `modules/lightmapper_rd/lm_blendseams.glsl `__ +- `modules/lightmapper_rd/lm_raster.glsl `__ +- `modules/lightmapper_rd/lm_compute.glsl `__ +- `modules/lightmapper_rd/lm_blendseams.glsl `__ Depth of field ^^^^^^^^^^^^^^ @@ -585,15 +604,15 @@ when temporal antialiasing is enabled. **Depth of field C++ code:** -- `servers/rendering/renderer_rd/effects/bokeh_dof.cpp `__ +- `servers/rendering/renderer_rd/effects/bokeh_dof.cpp `__ **Depth of field GLSL shader (compute - used for Forward+):** -- `servers/rendering/renderer_rd/shaders/effects/bokeh_dof.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/bokeh_dof.glsl `__ **Depth of field GLSL shader (raster - used for Forward Mobile):** -- `servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl `__ Screen-space effects (SSAO, SSIL, SSR, SSS) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -619,31 +638,31 @@ SSR is always performed at half resolution to improve performance. **Screen-space effects C++ code:** -- `servers/rendering/renderer_rd/effects/ss_effects.cpp `__ +- `servers/rendering/renderer_rd/effects/ss_effects.cpp `__ **Screen-space ambient occlusion GLSL shader:** -- `servers/rendering/renderer_rd/shaders/effects/ssao.glsl `__ -- `servers/rendering/renderer_rd/shaders/effects/ssao_blur.glsl `__ -- `servers/rendering/renderer_rd/shaders/effects/ssao_interleave.glsl `__ -- `servers/rendering/renderer_rd/shaders/effects/ssao_importance_map.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/ssao.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/ssao_blur.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/ssao_interleave.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/ssao_importance_map.glsl `__ **Screen-space indirect lighting GLSL shader:** -- `servers/rendering/renderer_rd/shaders/effects/ssil.glsl `__ -- `servers/rendering/renderer_rd/shaders/effects/ssil_blur.glsl `__ -- `servers/rendering/renderer_rd/shaders/effects/ssil_interleave.glsl `__ -- `servers/rendering/renderer_rd/shaders/effects/ssil_importance_map.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/ssil.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/ssil_blur.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/ssil_interleave.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/ssil_importance_map.glsl `__ **Screen-space reflections GLSL shader:** -- `servers/rendering/renderer_rd/shaders/effects/screen_space_reflection.glsl `__ -- `servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_scale.glsl `__ -- `servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_filter.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/screen_space_reflection.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_scale.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_filter.glsl `__ **Subsurface scattering GLSL:** -- `servers/rendering/renderer_rd/shaders/effects/subsurface_scattering.glsl `__ +- `servers/rendering/renderer_rd/shaders/effects/subsurface_scattering.glsl `__ Sky rendering ^^^^^^^^^^^^^ @@ -666,9 +685,9 @@ article. **Sky rendering C++ code:** -- `servers/rendering/renderer_rd/environment/sky.cpp `__ - Sky rendering -- `scene/resources/sky.cpp `__ - Sky resource (not to be confused with sky rendering) -- `scene/resources/sky_material.cpp `__ SkyMaterial resources (used in the Sky resource) +- `servers/rendering/renderer_rd/environment/sky.cpp `__ - Sky rendering +- `scene/resources/sky.cpp `__ - Sky resource (not to be confused with sky rendering) +- `scene/resources/sky_material.cpp `__ SkyMaterial resources (used in the Sky resource) **Sky rendering GLSL shader:** @@ -699,14 +718,14 @@ article. **Volumetric fog C++ code:** -- `servers/rendering/renderer_rd/environment/fog.cpp `__ - General volumetric fog -- `scene/3d/fog_volume.cpp `__ - FogVolume node -- `scene/resources/fog_material.cpp `__ - FogMaterial resource (used by FogVolume) +- `servers/rendering/renderer_rd/environment/fog.cpp `__ - General volumetric fog +- `scene/3d/fog_volume.cpp `__ - FogVolume node +- `scene/resources/fog_material.cpp `__ - FogMaterial resource (used by FogVolume) **Volumetric fog GLSL shaders:** -- `servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl `__ -- `servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl `__ +- `servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl `__ +- `servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl `__ Occlusion culling ^^^^^^^^^^^^^^^^^ @@ -748,8 +767,8 @@ RendererSceneOcclusionCull. **Occlusion culling C++ code:** -- `scene/3d/occluder_instance_3d.cpp `__ -- `servers/rendering/renderer_scene_occlusion_cull.cpp `__ +- `scene/3d/occluder_instance_3d.cpp `__ +- `servers/rendering/renderer_scene_occlusion_cull.cpp `__ Visibility range (LOD) ^^^^^^^^^^^^^^^^^^^^^^^ @@ -763,7 +782,7 @@ same mesh with different LODs (to allow for split screen rendering to look corre **Visibility range C++ code:** -- `servers/rendering/renderer_scene_cull.cpp `__ +- `servers/rendering/renderer_scene_cull.cpp `__ Automatic mesh LOD ^^^^^^^^^^^^^^^^^^ @@ -790,8 +809,8 @@ their own mesh LOD thresholds (which can be different from the main scene render **Mesh LOD generation on import C++ code:** -- `scene/resources/importer_mesh.cpp `__ +- `scene/resources/importer_mesh.cpp `__ **Mesh LOD determination C++ code:** -- `servers/rendering/renderer_scene_cull.cpp `__ +- `servers/rendering/renderer_scene_cull.cpp `__ diff --git a/contributing/development/core_and_modules/object_class.rst b/contributing/development/core_and_modules/object_class.rst index 77db5fdbfbe..e2afbdad761 100644 --- a/contributing/development/core_and_modules/object_class.rst +++ b/contributing/development/core_and_modules/object_class.rst @@ -71,13 +71,17 @@ Registering functions is one: .. code-block:: cpp - ClassDB::bind_method(D_METHOD("methodname", "arg1name", "arg2name"), &MyCustomMethod); + ClassDB::bind_method(D_METHOD("methodname", "arg1name", "arg2name", "arg3name"), &MyCustomType::method); -Default values for arguments can be passed in reverse order: +Default values for arguments can be passed as parameters at the end: .. code-block:: cpp - ClassDB::bind_method(D_METHOD("methodname", "arg1name", "arg2name"), &MyCustomType::method, DEFVAL(-1)); // default value for arg2name + ClassDB::bind_method(D_METHOD("methodname", "arg1name", "arg2name", "arg3name"), &MyCustomType::method, DEFVAL(-1), DEFVAL(-2)); // Default values for arg2name (-1) and arg3name (-2). + +Default values must be provided in the same order as they are declared, +skipping required arguments and then providing default values for the optional ones. +This matches the syntax for declaring methods in C++. ``D_METHOD`` is a macro that converts "methodname" to a StringName for more efficiency. Argument names are used for introspection, but when @@ -142,7 +146,7 @@ For example: PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_RANGE, "0,49,1", PROPERTY_USAGE_EDITOR) -This is an integer property named "amount". The hint is a range, and the range +This is an integer property named "amount". The hint is a range, and the range goes from 0 to 49 in steps of 1 (integers). It is only usable for the editor (editing the value visually) but won't be serialized. diff --git a/contributing/development/debugging/index.rst b/contributing/development/debugging/index.rst index 78ababf5f86..e72ba360fa2 100644 --- a/contributing/development/debugging/index.rst +++ b/contributing/development/debugging/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + Debugging and profiling ======================= diff --git a/contributing/development/debugging/vulkan/index.rst b/contributing/development/debugging/vulkan/index.rst index 4aad3c35f25..44866960f12 100644 --- a/contributing/development/debugging/vulkan/index.rst +++ b/contributing/development/debugging/vulkan/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + Vulkan ====== diff --git a/contributing/development/editor/index.rst b/contributing/development/editor/index.rst index ec95117cbea..6df59a08ac1 100644 --- a/contributing/development/editor/index.rst +++ b/contributing/development/editor/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + Editor development ================== diff --git a/contributing/development/file_formats/index.rst b/contributing/development/file_formats/index.rst index 99b4dcea30d..ab281ec0ccb 100644 --- a/contributing/development/file_formats/index.rst +++ b/contributing/development/file_formats/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + Godot file formats ================== diff --git a/contributing/development/index.rst b/contributing/development/index.rst index 859bd06c675..a5a0cfe5267 100644 --- a/contributing/development/index.rst +++ b/contributing/development/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + .. _doc_contributing_to_the_engine: Engine development diff --git a/contributing/documentation/index.rst b/contributing/documentation/index.rst index ea42f4161ca..68d8697ff62 100644 --- a/contributing/documentation/index.rst +++ b/contributing/documentation/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + .. _doc_contributing_writing_documentation: Writing documentation diff --git a/contributing/workflow/bug_triage_guidelines.rst b/contributing/workflow/bug_triage_guidelines.rst index 0d1092d65ed..d338ee48366 100644 --- a/contributing/workflow/bug_triage_guidelines.rst +++ b/contributing/workflow/bug_triage_guidelines.rst @@ -142,7 +142,7 @@ can focus on the issues labelled with their team's topic. **Platforms:** -*Android*, *HTML5*, *iOS*, *Linux*, *macOS*, *Windows*, *UWP* +*Android*, *iOS*, *Linux*, *macOS*, *Web*, *Windows* 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 diff --git a/contributing/workflow/img/testing_pull_requests_checks_artifacts.webp b/contributing/workflow/img/testing_pull_requests_checks_artifacts.webp index c336fb5aea8..d758290d9cf 100644 Binary files a/contributing/workflow/img/testing_pull_requests_checks_artifacts.webp and b/contributing/workflow/img/testing_pull_requests_checks_artifacts.webp differ diff --git a/contributing/workflow/img/testing_pull_requests_checks_artifacts_list.webp b/contributing/workflow/img/testing_pull_requests_checks_artifacts_list.webp index d758290d9cf..c336fb5aea8 100644 Binary files a/contributing/workflow/img/testing_pull_requests_checks_artifacts_list.webp and b/contributing/workflow/img/testing_pull_requests_checks_artifacts_list.webp differ diff --git a/contributing/workflow/index.rst b/contributing/workflow/index.rst index 7950396beac..0c6e451e6d9 100644 --- a/contributing/workflow/index.rst +++ b/contributing/workflow/index.rst @@ -1,3 +1,5 @@ +:allow_comments: False + .. _doc_contributing_workflow: Contribution workflow diff --git a/contributing/workflow/pr_workflow.rst b/contributing/workflow/pr_workflow.rst index db43fb3637f..b11b30d3415 100644 --- a/contributing/workflow/pr_workflow.rst +++ b/contributing/workflow/pr_workflow.rst @@ -436,7 +436,7 @@ 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 +aware of our workflow and Git usage tips, reviewers might request you 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. @@ -518,7 +518,7 @@ will raise an error: 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 +This is reasonable 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: @@ -530,6 +530,31 @@ 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. +Rebasing onto another branch +---------------------------- + +If you have accidentally opened your PR on the wrong branch, or need to target another branch +for some reason, you might need to filter out a lot of commits that differ between the old branch +(for example ``4.2``) and the new branch (for example ``master``). This can make rebasing difficult +and tedious. Fortunately ``git`` has a command just for this situation, ``git rebase --onto``. + +If your PR was created from the ``4.2`` branch and you want to update it to instead start at ``master`` +the following steps *should* fix this in one step: + +.. code-block:: text + + $ git rebase -i --onto master 4.2 + +This will take all the commits on your branch *after* the ``4.2`` branch, and then splice them on top of ``master``, +ignoring any commits from the ``4.2`` branch not on the ``master`` branch. You may still need to do some fixing, but +this command should save you a lot of tedious work removing commits. + +Just like above for the interactive rebase you need to force push your branch to handle the different changes: + +:: + + $ git push --force origin better-project-manager + Deleting a Git branch --------------------- diff --git a/getting_started/first_2d_game/01.project_setup.rst b/getting_started/first_2d_game/01.project_setup.rst index 12639be18c1..50ca655c182 100644 --- a/getting_started/first_2d_game/01.project_setup.rst +++ b/getting_started/first_2d_game/01.project_setup.rst @@ -40,7 +40,7 @@ Your project folder should look like this. This game is designed for portrait mode, so we need to adjust the size of the game window. Click on *Project -> Project Settings* to open the project settings -window and in the left column, open the *Display -> Window* tab. There, set +window, in the left column open the *Display -> Window* tab. There, set "Viewport Width" to ``480`` and "Viewport Height" to ``720``. .. image:: img/setting-project-width-and-height.webp diff --git a/getting_started/first_2d_game/03.coding_the_player.rst b/getting_started/first_2d_game/03.coding_the_player.rst index f49af6c34fc..a94d1651644 100644 --- a/getting_started/first_2d_game/03.coding_the_player.rst +++ b/getting_started/first_2d_game/03.coding_the_player.rst @@ -372,14 +372,29 @@ Inspector tab to see the list of signals the player can emit: Notice our custom "hit" signal is there as well! Since our enemies are going to be ``RigidBody2D`` nodes, we want the ``body_entered(body: Node2D)`` signal. This signal will be emitted when a body contacts the player. Click "Connect.." and -the "Connect a Signal" window appears. We don't need to change any of these -settings so click "Connect" again. Godot will automatically create a function in -your player's script. +the "Connect a Signal" window appears. + +Godot will create a function with that exact name directly in script +for you. You don't need to change the default settings right now. + +.. warning:: + + .. The issue for this bug is #41283 + + If you're using an external text editor (for example, Visual Studio Code), + a bug currently prevents Godot from doing so. You'll be sent to your external + editor, but the new function won't be there. + + In this case, you'll need to write the function yourself into the Player's + script file. .. image:: img/player_signal_connection.webp -Note the green icon indicating that a signal is connected to this function. Add -this code to the function: +Note the green icon indicating that a signal is connected to this function; this does +not mean the function exists, only that the signal will attempt to connect to a function +with that name, so double-check that the spelling of the function matches exactly! + +Next, add this code to the function: .. tabs:: .. code-tab:: gdscript GDScript diff --git a/getting_started/first_2d_game/04.creating_the_enemy.rst b/getting_started/first_2d_game/04.creating_the_enemy.rst index 0275c0419cd..e336bd1136a 100644 --- a/getting_started/first_2d_game/04.creating_the_enemy.rst +++ b/getting_started/first_2d_game/04.creating_the_enemy.rst @@ -24,7 +24,7 @@ Click Scene -> New Scene from the top menu and add the following nodes: Don't forget to set the children so they can't be selected, like you did with the Player scene. -Select the ``Mob`` node and set it's ``Gravity Scale`` +Select the ``Mob`` node and set its ``Gravity Scale`` property in the :ref:`RigidBody2D ` section of the inspector to ``0``. This will prevent the mob from falling downwards. @@ -54,7 +54,7 @@ Like the player images, these mob images need to be scaled down. Set the ``AnimatedSprite2D``'s ``Scale`` property to ``(0.75, 0.75)``. As in the ``Player`` scene, add a ``CapsuleShape2D`` for the collision. To align -the shape with the image, you'll need to set the ``Rotation Degrees`` property +the shape with the image, you'll need to set the ``Rotation`` property to ``90`` (under "Transform" in the Inspector). Save the scene. diff --git a/getting_started/first_2d_game/05.the_main_game_scene.rst b/getting_started/first_2d_game/05.the_main_game_scene.rst index 9e7f47ad48d..8475ca11fbc 100644 --- a/getting_started/first_2d_game/05.the_main_game_scene.rst +++ b/getting_started/first_2d_game/05.the_main_game_scene.rst @@ -198,7 +198,7 @@ Note that a new instance must be added to the scene using ``add_child()``. var mob = mob_scene.instantiate() # Choose a random location on Path2D. - var mob_spawn_location = get_node("MobPath/MobSpawnLocation") + var mob_spawn_location = $MobPath/MobSpawnLocation mob_spawn_location.progress_ratio = randf() # Set the mob's direction perpendicular to the path direction. @@ -288,7 +288,7 @@ You should be able to move the player around, see mobs spawning, and see the player disappear when hit by a mob. When you're sure everything is working, remove the call to ``new_game()`` from -``_ready()``. +``_ready()`` and replace it with ``pass``. What's our game lacking? Some user interface. In the next lesson, we'll add a title screen and display the player's score. diff --git a/getting_started/first_2d_game/06.heads_up_display.rst b/getting_started/first_2d_game/06.heads_up_display.rst index 95b561c6f22..f94e58a06e6 100644 --- a/getting_started/first_2d_game/06.heads_up_display.rst +++ b/getting_started/first_2d_game/06.heads_up_display.rst @@ -184,8 +184,8 @@ Add the code below to ``HUD`` to update the score GetNode