diff --git a/_static/css/custom.css b/_static/css/custom.css index 3379f5f50..6b89f28a9 100644 --- a/_static/css/custom.css +++ b/_static/css/custom.css @@ -337,7 +337,8 @@ article ol, } body, -.rst-content table.docutils thead { +.rst-content table.docutils thead, +.rst-content table.docutils caption { color: var(--body-color); } @@ -644,7 +645,9 @@ footer { } .wy-body-for-nav { + position: relative; background-color: var(--content-wrap-background-color); + overflow: visible; } @media only screen and (min-width: 769px) { diff --git a/about/faq.rst b/about/faq.rst index 74c5d5d13..3ebf34951 100644 --- a/about/faq.rst +++ b/about/faq.rst @@ -204,7 +204,7 @@ Windows - Move the Godot executable to a stable location (i.e. outside of your Downloads folder), so you don't accidentally move it and break the shortcut in the future. - Right-click the Godot executable and choose **Create Shortcut**. -- Move the created shortcut to ``%LOCALAPPDATA%\Microsoft\Windows\Start Menu\Programs``. +- Move the created shortcut to ``%APPDATA%\Microsoft\Windows\Start Menu\Programs``. This is the user-wide location for shortcuts that will appear in the Start menu. You can also pin Godot in the task bar by right-clicking the executable and choosing **Pin to Task Bar**. @@ -436,9 +436,6 @@ When creating a non-game application, make sure to enable :ref:`low-processor mode ` in the Project Settings to decrease CPU and GPU usage. -That said, we wouldn't recommend using Godot to create a *mobile* application -since low-processor mode isn't supported on mobile platforms yet. - Check out `Material Maker `__ and `Pixelorama `__ for examples of open source applications made with Godot. diff --git a/about/troubleshooting.rst b/about/troubleshooting.rst index 6a3105c62..08d757831 100644 --- a/about/troubleshooting.rst +++ b/about/troubleshooting.rst @@ -91,6 +91,29 @@ resolve this, open **Project > Project Settings** and enable **Display > Window > Dpi > Allow Hidpi**. On top of that, make sure your project is configured to support :ref:`multiple resolutions `. +The editor or project appears to have washed out colors +------------------------------------------------------- + +On Windows, this is usually caused by incorrect OS or monitor settings, as Godot +currently does not support :abbr:`HDR (High Dynamic Range)` *output* +(even though it may internally render in HDR). + +As `most displays are not designed to display SDR content in HDR mode `__, +it is recommended to disable HDR in the Windows settings when not running applications +that use HDR output. On Windows 11, this can be done by pressing +:kbd:`Windows + Alt + B` (this shortcut is part of the Xbox Game Bar app). +To toggle HDR automatically based on applications currently running, you can use +`AutoActions `__. + +If you insist on leaving HDR enabled, it is possible to somewhat improve the +result by ensuring the display is configured to use :abbr:`HGIG (HDR Gaming Interest Group)` +tonemapping (as opposed to :abbr:`DTM (Dynamic Tone Mapping)`), then +`using the Windows HDR calibration app `__. +It is also strongly recommended to use Windows 11 instead of Windows 10 when using HDR. +The end result will still likely be inferior to disabling HDR on the display, though. + +Support for HDR *output* is planned in a future release. + The editor/project freezes or displays glitched visuals after resuming the PC from suspend ------------------------------------------------------------------------------------------ diff --git a/community/contributing/code_style_guidelines.rst b/community/contributing/code_style_guidelines.rst index d53a8f58c..7dbf94b1b 100644 --- a/community/contributing/code_style_guidelines.rst +++ b/community/contributing/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/community/contributing/pr_workflow.rst b/community/contributing/pr_workflow.rst index 8f0d17f70..064da08dc 100644 --- a/community/contributing/pr_workflow.rst +++ b/community/contributing/pr_workflow.rst @@ -347,9 +347,16 @@ do: $ git push origin better-project-manager -Git will ask you for your username and password, and the changes will be sent -to your remote. If you check the fork's page on GitHub, you should see a new -branch with your added commits. +Git will ask you for your username and password. For your password, enter your +GitHub Personal Access Token (PAT). If you do not have a GitHub Personal Access +Token, or do not have one with the correct permissions for your newly forked +repository, you will need to create one. Follow this link to create your Personal +Access Token: `Creating a personal access token +`_. + +After you have successfully verified your account using your PAT, the changes +will be sent to your remote repository. If you check the fork's page on GitHub, +you should see a new branch with your added commits. Issuing a pull request ---------------------- @@ -511,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: @@ -523,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/conf.py b/conf.py index 25acbcdf4..d78d72b84 100644 --- a/conf.py +++ b/conf.py @@ -24,6 +24,9 @@ extensions = [ # we can ignore this so we still can treat other warnings as errors. sphinx_tabs_nowarn = True +# Disable collapsing tabs for codeblocks. +sphinx_tabs_disable_tab_closing = True + # Custom 4O4 page HTML template. # https://github.com/readthedocs/sphinx-notfound-page notfound_context = { @@ -113,7 +116,14 @@ supported_languages = { "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())) @@ -123,6 +133,7 @@ if not language in supported_languages.keys(): language = "en" is_i18n = tags.has("i18n") # noqa: F821 +print("Build language: {}, i18n tag: {}".format(language, is_i18n)) exclude_patterns = ["_build"] diff --git a/development/compiling/compiling_for_osx.rst b/development/compiling/compiling_for_osx.rst index 9f5b1f7f0..151a7b1ef 100644 --- a/development/compiling/compiling_for_osx.rst +++ b/development/compiling/compiling_for_osx.rst @@ -140,6 +140,22 @@ template from the official Godot distribution:: zip -q -9 -r osx.zip osx_template.app +Using Pyston for faster development +----------------------------------- + +You can use `Pyston `__ to run SCons. Pyston is a +JIT-enabled implementation of the Python language (which SCons is written in). +Its "full" version is currently only compatible with Linux, but Pyston-lite is +also compatible with macOS (both x86 and ARM). Pyston can speed up incremental +builds significantly, often by a factor between 1.5× and 2×. Pyston can be +combined with alternative likers such as LLD or Mold to get even faster builds. + +To install Pyston-lite, run ``python -m pip install pyston_lite_autoload`` then +run SCons as usual. This will automatically load a subset of Pyston's +optimizations in any Python program you run. However, this won't bring as much +of a performance improvement compared to installing "full" Pyston (which +currently can't be done on macOS). + Cross-compiling for macOS from Linux ------------------------------------ diff --git a/development/compiling/compiling_for_x11.rst b/development/compiling/compiling_for_x11.rst index 27430df2e..6daa22d86 100644 --- a/development/compiling/compiling_for_x11.rst +++ b/development/compiling/compiling_for_x11.rst @@ -256,3 +256,10 @@ to get even faster builds. If you can't run ``pyston-scons`` after creating the symbolic link, make sure ``$HOME/.local/bin/`` is part of your user's ``PATH`` environment variable. + +.. note:: + + Alternatively, you can run ``python -m pip install pyston_lite_autoload`` + then run SCons as usual. This will automatically load a subset of Pyston's + optimizations in any Python program you run. However, this won't bring as + much of a performance improvement compared to installing "full" Pyston. diff --git a/development/cpp/custom_modules_in_cpp.rst b/development/cpp/custom_modules_in_cpp.rst index e2d784133..a5b52b219 100644 --- a/development/cpp/custom_modules_in_cpp.rst +++ b/development/cpp/custom_modules_in_cpp.rst @@ -489,7 +489,7 @@ Run command: :: - user@host:~/godot/bin$ ./bin/ --doctool . + user@host:~/godot$ ./bin/ --doctool . Now if you go to the ``godot/modules/summator/doc_classes`` folder, you will see that it contains a ``Summator.xml`` file, or any other classes, that you referenced diff --git a/development/cpp/macos_debug.rst b/development/cpp/macos_debug.rst index fa254baa5..babadb9df 100644 --- a/development/cpp/macos_debug.rst +++ b/development/cpp/macos_debug.rst @@ -29,6 +29,8 @@ Create an ``editor.entitlements`` text file with the following contents: com.apple.security.device.camera + com.apple.security.get-task-allow + diff --git a/development/editor/introduction_to_editor_development.rst b/development/editor/introduction_to_editor_development.rst index ed72aabd6..5f142268f 100644 --- a/development/editor/introduction_to_editor_development.rst +++ b/development/editor/introduction_to_editor_development.rst @@ -77,7 +77,7 @@ from ``servers/`` and ``core/``, it cannot depend on includes from ``editor/``. Currently, there are some dependencies to ``editor/`` includes in ``scene/`` files, but -`they are in the process of being removed `__. +`they are in the process of being removed `__. Development tips ---------------- diff --git a/getting_started/introduction/first_look_at_the_editor.rst b/getting_started/introduction/first_look_at_the_editor.rst index 829483d5d..f34a92ba4 100644 --- a/getting_started/introduction/first_look_at_the_editor.rst +++ b/getting_started/introduction/first_look_at_the_editor.rst @@ -19,7 +19,7 @@ The Project manager ------------------- When you launch Godot, the first window you see is the Project Manager. In the -default tab, "Projects," you can manage existing projects, import or create new +default tab **Local Projects**, you can manage existing projects, import or create new ones, and more. .. image:: img/editor_intro_project_manager.png diff --git a/getting_started/introduction/introduction_to_godot.rst b/getting_started/introduction/introduction_to_godot.rst index edad4ae8d..f5340fe1f 100644 --- a/getting_started/introduction/introduction_to_godot.rst +++ b/getting_started/introduction/introduction_to_godot.rst @@ -29,7 +29,7 @@ programming skills or a developer to port the game for you. What can the engine do? ----------------------- -Godot was initially developed in-house by an Argentinan game studio. Its +Godot was initially developed in-house by an Argentinian game studio. Its development started in 2001, and the engine was rewritten and improved tremendously since its open-source release in 2014. diff --git a/getting_started/step_by_step/img/instancing_physics_material_expand.png b/getting_started/step_by_step/img/instancing_physics_material_expand.png deleted file mode 100644 index 67f452186..000000000 Binary files a/getting_started/step_by_step/img/instancing_physics_material_expand.png and /dev/null differ diff --git a/getting_started/step_by_step/img/instancing_physics_material_expand.webp b/getting_started/step_by_step/img/instancing_physics_material_expand.webp new file mode 100644 index 000000000..e98776922 Binary files /dev/null and b/getting_started/step_by_step/img/instancing_physics_material_expand.webp differ diff --git a/getting_started/step_by_step/img/instancing_property_bounce_updated.png b/getting_started/step_by_step/img/instancing_property_bounce_updated.png deleted file mode 100644 index 2b7c3117b..000000000 Binary files a/getting_started/step_by_step/img/instancing_property_bounce_updated.png and /dev/null differ diff --git a/getting_started/step_by_step/img/instancing_property_bounce_updated.webp b/getting_started/step_by_step/img/instancing_property_bounce_updated.webp new file mode 100644 index 000000000..a6405bb64 Binary files /dev/null and b/getting_started/step_by_step/img/instancing_property_bounce_updated.webp differ diff --git a/getting_started/step_by_step/instancing.rst b/getting_started/step_by_step/instancing.rst index 65a955ca7..31b9c04ba 100644 --- a/getting_started/step_by_step/instancing.rst +++ b/getting_started/step_by_step/instancing.rst @@ -117,12 +117,12 @@ There is more to instances. With this feature, you can: Let's try this. Open ``Ball.tscn`` and select the Ball node. In the Inspector on the right, click on the PhysicsMaterial property to expand it. -.. image:: img/instancing_physics_material_expand.png +.. image:: img/instancing_physics_material_expand.webp -Set its Bounce property to ``2`` by clicking on the number field, typing ``2``, +Set its Bounce property to ``0.5`` by clicking on the number field, typing ``0.5``, and pressing :kbd:`Enter`. -.. image:: img/instancing_property_bounce_updated.png +.. image:: img/instancing_property_bounce_updated.webp Play the game by pressing :kbd:`F5` and notice how all balls now bounce a lot more. As the Ball scene is a template for all instances, modifying it and saving @@ -178,7 +178,7 @@ You can come up with a diagram like this for almost any type of game. Each rectangle represents an entity that's visible in the game from the player's perspective. The arrows tell you which scene owns which. -Once you have a diagram, we recommended creating a scene for each element listed +Once you have a diagram, we recommend creating a scene for each element listed in it to develop your game. You'll use instancing, either by code or directly in the editor, to build your tree of scenes. diff --git a/getting_started/step_by_step/scripting_first_script.rst b/getting_started/step_by_step/scripting_first_script.rst index 7edb8d3a3..72e9c6462 100644 --- a/getting_started/step_by_step/scripting_first_script.rst +++ b/getting_started/step_by_step/scripting_first_script.rst @@ -132,7 +132,7 @@ our node's ``texture``. capitalized words separated by a space. In GDScript code, these properties are in "snake_case", which is lowercase with words separated by an underscore. - You can hover any property's name in the Inspector to see a description and + You can hover over any property's name in the Inspector to see a description and its identifier in code. Hello, world! diff --git a/tutorials/animation/introduction.rst b/tutorials/animation/introduction.rst index faaa87890..cf89d67d7 100644 --- a/tutorials/animation/introduction.rst +++ b/tutorials/animation/introduction.rst @@ -401,7 +401,7 @@ where they were. If you want to reset the tracks in the editor, select the AnimationPlayer node, open the **Animation** bottom panel then choose **Apply Reset** in the -animation editor's **Animation** dropdown menu. +animation editor's **Edit** dropdown menu. When adding tracks on new animations, the editor will ask you to automatically create a RESET track when using the keyframe icon next to a property in the inspector. diff --git a/tutorials/best_practices/godot_interfaces.rst b/tutorials/best_practices/godot_interfaces.rst index 79a8417cf..3d8742c33 100644 --- a/tutorials/best_practices/godot_interfaces.rst +++ b/tutorials/best_practices/godot_interfaces.rst @@ -504,7 +504,7 @@ accesses: Child.MyMethod(); } - public void PrintMe() { + public void PrintMe() { GD.Print(GetClass()); } diff --git a/tutorials/best_practices/logic_preferences.rst b/tutorials/best_practices/logic_preferences.rst index fb83eed9a..bb36995b7 100644 --- a/tutorials/best_practices/logic_preferences.rst +++ b/tutorials/best_practices/logic_preferences.rst @@ -6,6 +6,22 @@ Logic preferences Ever wondered whether one should approach problem X with strategy Y or Z? This article covers a variety of topics related to these dilemmas. +Adding nodes and changing properties: which first? +-------------------------------------------------- + +When initializing nodes from a script at runtime, you may need to change +properties such as the node's name or position. A common dilemma is, when +should you change those values? + +It is the best practice to change values on a node before adding it to the +scene tree. Some properties setters have code to update other +corresponding values, and that code can be slow! For most cases, this code +has no impact on your game's performance, but in heavy use cases such as +procedural generation, it can bring your game to a crawl. + +For these reasons, it is always a best practice to set the initial values +of a node before adding it to the scene tree. + Loading vs. preloading ---------------------- diff --git a/tutorials/editor/external_editor.rst b/tutorials/editor/external_editor.rst index 572a32f8b..1c4064c07 100644 --- a/tutorials/editor/external_editor.rst +++ b/tutorials/editor/external_editor.rst @@ -35,7 +35,7 @@ Some example Exec Flags for various editors include: +=====================+=====================================================+ | Geany/Kate | ``{file} --line {line} --column {col}`` | +---------------------+-----------------------------------------------------+ -| Atom/Sublime Text | ``{file}:{line}`` | +| Atom | ``{file}:{line}`` | +---------------------+-----------------------------------------------------+ | JetBrains Rider | ``{project} --line {line} {file}`` | +---------------------+-----------------------------------------------------+ @@ -45,6 +45,8 @@ Some example Exec Flags for various editors include: +---------------------+-----------------------------------------------------+ | Emacs | ``emacs +{line}:{col} {file}`` | +---------------------+-----------------------------------------------------+ +| Sublime Text | ``{project} {file}:{line}:{column}`` | ++---------------------+-----------------------------------------------------+ .. note:: For Visual Studio Code, you will have to point to the ``code.cmd`` file. For Emacs, you can call ``emacsclient`` instead of ``emacs`` if diff --git a/tutorials/export/exporting_for_android.rst b/tutorials/export/exporting_for_android.rst index f411f28ca..e4515f27a 100644 --- a/tutorials/export/exporting_for_android.rst +++ b/tutorials/export/exporting_for_android.rst @@ -23,7 +23,7 @@ Download the Android SDK Download and install the Android SDK. -- You can install it using `Android Studio version 4.1 or later `__. +- You can install the Android SDK using `Android Studio version 4.1 or later `__. - Run it once to complete the SDK setup using these `instructions `__. - Ensure that the `required packages `__ are installed as well. @@ -35,7 +35,7 @@ Download and install the Android SDK. - CMake version 3.10.2.4988404 - NDK version r23c (23.2.8568313) -- You can install it using the `command line tools `__. +- Alternatively, you can install the Android SDK using the `command line tools `__. - Once the command line tools are installed, run the `sdkmanager `__ command to complete the setup process: diff --git a/tutorials/io/saving_games.rst b/tutorials/io/saving_games.rst index aa1796f86..4833da75d 100644 --- a/tutorials/io/saving_games.rst +++ b/tutorials/io/saving_games.rst @@ -38,7 +38,7 @@ to save them and then tell them all to save with this script: .. code-tab:: gdscript GDScript var save_nodes = get_tree().get_nodes_in_group("Persist") - for i in save_nodes: + for node in save_nodes: # Now, we can call our save function on each node. .. code-tab:: csharp diff --git a/tutorials/networking/http_request_class.rst b/tutorials/networking/http_request_class.rst index 7d02daf38..6cb08fb80 100644 --- a/tutorials/networking/http_request_class.rst +++ b/tutorials/networking/http_request_class.rst @@ -38,6 +38,7 @@ Below is all the code we need to make it work. The URL points to an online API m func _ready(): $HTTPRequest.connect("request_completed", self, "_on_request_completed") + $Button.connect("pressed", self, "_on_Button_pressed") func _on_Button_pressed(): $HTTPRequest.request("http://www.mocky.io/v2/5185415ba171ea3a00704eed") diff --git a/tutorials/performance/cpu_optimization.rst b/tutorials/performance/cpu_optimization.rst index cf335cab6..519749040 100644 --- a/tutorials/performance/cpu_optimization.rst +++ b/tutorials/performance/cpu_optimization.rst @@ -8,7 +8,7 @@ Measuring performance We have to know where the "bottlenecks" are to know how to speed up our program. Bottlenecks are the slowest parts of the program that limit the rate that -everything can progress. Focussing on bottlenecks allows us to concentrate our +everything can progress. Focusing on bottlenecks allows us to concentrate our efforts on optimizing the areas which will give us the greatest speed improvement, instead of spending a lot of time optimizing functions that will lead to small performance improvements. diff --git a/tutorials/plugins/editor/inspector_plugins.rst b/tutorials/plugins/editor/inspector_plugins.rst index eaf4f3e46..79394636f 100644 --- a/tutorials/plugins/editor/inspector_plugins.rst +++ b/tutorials/plugins/editor/inspector_plugins.rst @@ -141,6 +141,7 @@ specifically add :ref:`class_EditorProperty`-based controls. #if TOOLS using Godot; + [Tool] public class MyInspectorPlugin : EditorInspectorPlugin { public override bool CanHandle(Object @object) @@ -247,6 +248,7 @@ followed by ``set_bottom_editor()`` to position it below the name. #if TOOLS using Godot; + [Tool] public class RandomIntEditor : EditorProperty { // The main control for editing the property. diff --git a/tutorials/plugins/editor/making_plugins.rst b/tutorials/plugins/editor/making_plugins.rst index d7a0caac3..acad761a1 100644 --- a/tutorials/plugins/editor/making_plugins.rst +++ b/tutorials/plugins/editor/making_plugins.rst @@ -95,9 +95,10 @@ editor, and it must inherit from :ref:`class_EditorPlugin`. .. warning:: - In addition to the EditorPlugin script, any other GDScript that your plugin uses - must *also* be a tool. Any GDScript without ``tool`` imported into the editor - will act like an empty file! + In addition to the EditorPlugin script, any other script that your plugin uses + must *also* be a tool. + * Any GDScript without ``tool`` imported into the editor will act like an empty file! + * Any C# class without ``[Tool]`` won't be reloaded when the project is built forcing you to re-enable the plugin! It's important to deal with initialization and clean-up of resources. A good practice is to use the virtual function diff --git a/tutorials/rendering/multiple_resolutions.rst b/tutorials/rendering/multiple_resolutions.rst index 78d12f670..6085b0514 100644 --- a/tutorials/rendering/multiple_resolutions.rst +++ b/tutorials/rendering/multiple_resolutions.rst @@ -330,6 +330,14 @@ to change the display orientation project setting. and makes better use of tall smartphone displays (such as 18:9 or 19:9 aspect ratios). - Configure Control nodes' anchors to snap to the correct corners using the **Layout** menu. +.. tip:: + + To better support tablets and foldable phones (which frequently feature + displays with aspect ratios close to 4:3), consider using a base resolution + that has a 4:3 aspect ratio while following the rest of the instructions + here. For instance, you can set the base window width to ``1280`` and the + base window height to ``960``. + Mobile game in portrait mode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -349,6 +357,14 @@ Mobile game in portrait mode and makes better use of tall smartphone displays (such as 18:9 or 19:9 aspect ratios). - Configure Control nodes' anchors to snap to the correct corners using the **Layout** menu. +.. tip:: + + To better support tablets and foldable phones (which frequently feature + displays with aspect ratios close to 4:3), consider using a base resolution + that has a 3:4 aspect ratio while following the rest of the instructions + here. For instance, you can set the base window width to ``960`` and the + base window height to ``1280``. + Non-game application ^^^^^^^^^^^^^^^^^^^^ diff --git a/tutorials/scripting/cross_language_scripting.rst b/tutorials/scripting/cross_language_scripting.rst index 54389afee..1d3c67c0a 100644 --- a/tutorials/scripting/cross_language_scripting.rst +++ b/tutorials/scripting/cross_language_scripting.rst @@ -89,6 +89,9 @@ with :ref:`new() `. ``Invalid call. Nonexistent function `new` in base``. For example, MyCoolNode.cs should contain a class named MyCoolNode. + + The C# class needs to derive a Godot class, for example ``Godot.Object``. + Otherwise, the same error will occur. You also need to check your ``.cs`` file is referenced in the project's ``.csproj`` file. Otherwise, the same error will occur. diff --git a/tutorials/scripting/scene_tree.rst b/tutorials/scripting/scene_tree.rst index a32bb5703..cce5c7155 100644 --- a/tutorials/scripting/scene_tree.rst +++ b/tutorials/scripting/scene_tree.rst @@ -174,6 +174,6 @@ function These are quick and useful ways to switch scenes but have the drawback that the game will stall until the new scene is loaded and running. At some point in the development of your game, it may be preferable to create proper loading -screens with progress bar, animated indicators or thread (background) -loading. This must be done manually using autoloads (see next chapter) +screens with progress bar, animated indicators or threaded (background) +loading. This must be done manually using :ref:`doc_singletons_autoload` and :ref:`doc_background_loading`. diff --git a/tutorials/shaders/your_first_shader/your_first_2d_shader.rst b/tutorials/shaders/your_first_shader/your_first_2d_shader.rst index 6339a2b7e..1a0a2a9c9 100644 --- a/tutorials/shaders/your_first_shader/your_first_2d_shader.rst +++ b/tutorials/shaders/your_first_shader/your_first_2d_shader.rst @@ -22,9 +22,9 @@ fragment functions. This tutorial targets absolute beginners to shaders. Setup ----- -:ref:`CanvasItem ` shaders are used to draw all 2D - objects in Godot, while :ref:`Spatial ` shaders are - used to draw all 3D objects. +:ref:`CanvasItem shaders ` are used to draw all 2D +objects in Godot, while :ref:`Spatial ` shaders are used +to draw all 3D objects. In order to use a shader it must be attached inside a :ref:`Material ` which must be attached to an object. Materials are a type of diff --git a/tutorials/shaders/your_first_shader/your_first_3d_shader.rst b/tutorials/shaders/your_first_shader/your_first_3d_shader.rst index 5a77d7f17..dfa8fcc08 100644 --- a/tutorials/shaders/your_first_shader/your_first_3d_shader.rst +++ b/tutorials/shaders/your_first_shader/your_first_3d_shader.rst @@ -87,9 +87,9 @@ and thus allow us to add more detail. .. image:: img/plane-sub.png :ref:`PrimitiveMeshes `, like PlaneMesh, only have one - surface, so instead of an array of materials there is only one. Click - beside "Material" where it says "[empty]" and select "New ShaderMaterial". - Then click the sphere that appears. +surface, so instead of an array of materials there is only one. Click +beside "Material" where it says "[empty]" and select "New ShaderMaterial". +Then click the sphere that appears. Now click beside "Shader" where it says "[empty]" and select "New Shader". @@ -181,8 +181,8 @@ Click beside it where it says "[empty]" and select "New NoiseTexture". Then in your NoiseTexture click beside where it says "Noise" and select "New OpenSimplexNoise". -:ref:`OpenSimplexNoise ` is used by the NoiseTexture to - generate a heightmap. +.. note:: :ref:`OpenSimplexNoise ` is used by the NoiseTexture to + generate a heightmap. Once you set it up and should look like this.