Removed :ref:s.

This commit is contained in:
Relintai 2023-01-12 19:29:11 +01:00
parent 3beb0ac5d1
commit d4b40dfad4
263 changed files with 1792 additions and 1792 deletions

View File

@ -71,7 +71,7 @@ Some games have a special menu (often in the settings) to display licenses.
Output log Output log
^^^^^^^^^^ ^^^^^^^^^^
Just printing the licensing text using the :ref:`print() <class_@GDScript_method_print>` Just printing the licensing text using the `print() <class_@GDScript_method_print>`
function may be enough on platforms where a global output log is readable. 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 and UWP).
@ -163,5 +163,5 @@ as the latest version of OpenSSL currently uses (as of April 2022).
.. note:: .. note::
If you exported your project using a If you exported your project using a
:ref:`custom build with specific modules disabled <doc_optimizing_for_size>`, `custom build with specific modules disabled <doc_optimizing_for_size>`,
you don't need to list the disabled modules' licenses in your exported project. you don't need to list the disabled modules' licenses in your exported project.

View File

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

View File

@ -38,7 +38,7 @@ Which platforms are supported by Godot?
* Windows * Windows
* macOS * macOS
* X11 (Linux, \*BSD) * X11 (Linux, \*BSD)
* :ref:`Web <doc_using_the_web_editor>` * `Web <doc_using_the_web_editor>`
* Android (experimental) * Android (experimental)
**For exporting your games:** **For exporting your games:**
@ -60,15 +60,15 @@ Additionally, there is some unofficial third-party work being done on building
for some consoles. However, none of this is included in the default build for some consoles. However, none of this is included in the default build
scripts or export templates at this time. scripts or export templates at this time.
For more on this, see the sections on :ref:`exporting <toc-learn-workflow-export>` For more on this, see the sections on `exporting <toc-learn-workflow-export>`
and :ref:`compiling Godot yourself <toc-devel-compiling>`. and `compiling Godot yourself <toc-devel-compiling>`.
Which programming languages are supported in Godot? Which programming languages are supported in Godot?
--------------------------------------------------- ---------------------------------------------------
The officially supported languages for Godot are GDScript, Visual Scripting, The officially supported languages for Godot are GDScript, Visual Scripting,
C#, and C++. See the subcategories for each language in the C#, and C++. See the subcategories for each language in the
:ref:`scripting <toc-learn-scripting>` section. `scripting <toc-learn-scripting>` section.
If you are just starting out with either Godot or game development in general, If you are just starting out with either Godot or game development in general,
GDScript is the recommended language to learn and use since it is native to Godot. GDScript is the recommended language to learn and use since it is native to Godot.
@ -99,7 +99,7 @@ up to maximize Godot's potential in the least amount of code, affording both nov
and expert developers alike to capitalize on Godot's strengths as fast as possible. and expert developers alike to capitalize on Godot's strengths as fast as possible.
If you've ever written anything in a language like Python before then you'll feel If you've ever written anything in a language like Python before then you'll feel
right at home. For examples, history, and a complete overview of the power GDScript right at home. For examples, history, and a complete overview of the power GDScript
offers you, check out the :ref:`GDScript scripting guide <doc_gdscript>`. offers you, check out the `GDScript scripting guide <doc_gdscript>`.
There are several reasons to use GDScript--especially when you are prototyping, in There are several reasons to use GDScript--especially when you are prototyping, in
alpha/beta stages of your project, or are not creating the next AAA title--but the alpha/beta stages of your project, or are not creating the next AAA title--but the
@ -123,7 +123,7 @@ once you see how powerful it is and rapid your development becomes, we think GDS
will grow on you. will grow on you.
More information about getting comfortable with GDScript or dynamically typed More information about getting comfortable with GDScript or dynamically typed
languages can be found in the :ref:`doc_gdscript_more_efficiently` tutorial. languages can be found in the `doc_gdscript_more_efficiently` tutorial.
What were the motivations behind creating GDScript? What were the motivations behind creating GDScript?
--------------------------------------------------- ---------------------------------------------------
@ -225,7 +225,7 @@ Linux
This is typically ``/usr/local/bin/godot`` or ``/usr/bin/godot``. This is typically ``/usr/local/bin/godot`` or ``/usr/bin/godot``.
Doing this requires administrator privileges, Doing this requires administrator privileges,
but this also allows you to but this also allows you to
:ref:`run the Godot editor from a terminal <doc_command_line_tutorial>` by entering ``godot``. `run the Godot editor from a terminal <doc_command_line_tutorial>` by entering ``godot``.
- If you cannot move the Godot editor binary to a protected location, you can - If you cannot move the Godot editor binary to a protected location, you can
keep the binary somewhere in your home directory, and modify the ``Path=`` keep the binary somewhere in your home directory, and modify the ``Path=``
@ -247,10 +247,10 @@ administrator privileges.
However, configuration files will be written to the user-wide configuration or However, configuration files will be written to the user-wide configuration or
data directory. This is usually a good approach, but this means configuration files data directory. This is usually a good approach, but this means configuration files
will not carry across machines if you copy the folder containing the Godot executable. will not carry across machines if you copy the folder containing the Godot executable.
See :ref:`doc_data_paths` for more information. See `doc_data_paths` for more information.
If *true* portable operation is desired (e.g. for use on an USB stick), If *true* portable operation is desired (e.g. for use on an USB stick),
follow the steps in :ref:`doc_data_paths_self_contained_mode`. follow the steps in `doc_data_paths_self_contained_mode`.
Why does Godot use Vulkan or OpenGL instead of Direct3D? Why does Godot use Vulkan or OpenGL instead of Direct3D?
-------------------------------------------------------- --------------------------------------------------------
@ -309,7 +309,7 @@ functionality in Godot. This is why we are aiming to move some core
functionality to officially supported add-ons in future versions of Godot. In functionality to officially supported add-ons in future versions of Godot. In
terms of binary size, this also has the advantage of making you pay only for what terms of binary size, this also has the advantage of making you pay only for what
you actually use in your project. (In the meantime, you can you actually use in your project. (In the meantime, you can
:ref:`compile custom export templates with unused features disabled <doc_optimizing_for_size>` `compile custom export templates with unused features disabled <doc_optimizing_for_size>`
to optimize the distribution size of your project.) to optimize the distribution size of your project.)
How should assets be created to handle multiple resolutions and aspect ratios? How should assets be created to handle multiple resolutions and aspect ratios?
@ -336,15 +336,15 @@ This is mostly needed for 2D, as in 3D it's just a matter of Camera XFov or YFov
and the longer the time it will take for loading. and the longer the time it will take for loading.
2. Use the stretch options in Godot; 2D stretching while keeping aspect 2. Use the stretch options in Godot; 2D stretching while keeping aspect
ratios works best. Check the :ref:`doc_multiple_resolutions` tutorial ratios works best. Check the `doc_multiple_resolutions` tutorial
on how to achieve this. on how to achieve this.
3. Determine a minimum resolution and then decide if you want your game 3. Determine a minimum resolution and then decide if you want your game
to stretch vertically or horizontally for different aspect ratios, or to stretch vertically or horizontally for different aspect ratios, or
if there is one aspect ratio and you want black bars to appear if there is one aspect ratio and you want black bars to appear
instead. This is also explained in :ref:`doc_multiple_resolutions`. instead. This is also explained in `doc_multiple_resolutions`.
4. For user interfaces, use the :ref:`anchoring <doc_size_and_anchors>` 4. For user interfaces, use the `anchoring <doc_size_and_anchors>`
to determine where controls should stay and move. If UIs are more to determine where controls should stay and move. If UIs are more
complex, consider learning about Containers. complex, consider learning about Containers.
@ -359,7 +359,7 @@ How can I extend Godot?
----------------------- -----------------------
For extending Godot, like creating Godot Editor plugins or adding support For extending Godot, like creating Godot Editor plugins or adding support
for additional languages, take a look at :ref:`EditorPlugins <doc_making_plugins>` for additional languages, take a look at `EditorPlugins <doc_making_plugins>`
and tool scripts. and tool scripts.
Also, see the official blog posts on these topics: Also, see the official blog posts on these topics:
@ -375,7 +375,7 @@ integrates with Godot.
When is the next release of Godot out? When is the next release of Godot out?
-------------------------------------- --------------------------------------
When it's ready! See :ref:`doc_release_policy_when_is_next_release_out` for more When it's ready! See `doc_release_policy_when_is_next_release_out` for more
information. information.
I would like to contribute! How can I get started? I would like to contribute! How can I get started?
@ -433,7 +433,7 @@ Yes! Godot features an extensive built-in UI system, and its small distribution
size can make it a suitable alternative to frameworks like Electron or Qt. size can make it a suitable alternative to frameworks like Electron or Qt.
When creating a non-game application, make sure to enable When creating a non-game application, make sure to enable
:ref:`low-processor mode <class_ProjectSettings_property_application/run/low_processor_mode>` `low-processor mode <class_ProjectSettings_property_application/run/low_processor_mode>`
in the Project Settings to decrease CPU and GPU usage. in the Project Settings to decrease CPU and GPU usage.
That said, we wouldn't recommend using Godot to create a *mobile* application That said, we wouldn't recommend using Godot to create a *mobile* application
@ -474,9 +474,9 @@ have to deal with the LGPL licensing caveats that come with GTK or Qt. Lastly,
this means Godot is "eating its own dog food" since the editor itself is one of this means Godot is "eating its own dog food" since the editor itself is one of
the most complex users of Godot's UI system. the most complex users of Godot's UI system.
This custom UI toolkit :ref:`can't be used as a library <doc_faq_use_godot_as_library>`, This custom UI toolkit `can't be used as a library <doc_faq_use_godot_as_library>`,
but you can still but you can still
:ref:`use Godot to create non-game applications by using the editor <doc_faq_non_game_applications>`. `use Godot to create non-game applications by using the editor <doc_faq_non_game_applications>`.
.. _doc_faq_why_not_stl: .. _doc_faq_why_not_stl:
@ -535,7 +535,7 @@ performance parts and GDScript (or C#) for the rest of the game.
How can I support Godot development or contribute? How can I support Godot development or contribute?
-------------------------------------------------- --------------------------------------------------
See :ref:`doc_ways_to_contribute`. See `doc_ways_to_contribute`.
Who is working on Godot? How can I contact you? Who is working on Godot? How can I contact you?
----------------------------------------------- -----------------------------------------------

View File

@ -20,12 +20,12 @@ where to look if you need info on a specific feature.
Before you start Before you start
---------------- ----------------
The :ref:`Tutorials and resources <doc_community_tutorials>` page lists The `Tutorials and resources <doc_community_tutorials>` page lists
video tutorials contributed by the community. If you prefer video to text, video tutorials contributed by the community. If you prefer video to text,
those may be worth a look. those may be worth a look.
In case you have trouble with one of the tutorials or your project, In case you have trouble with one of the tutorials or your project,
you can find help on the various :ref:`Community channels <doc_community_channels>`, you can find help on the various `Community channels <doc_community_channels>`,
especially the Godot Discord community, Q&A, and IRC. especially the Godot Discord community, Q&A, and IRC.
About Godot Engine About Godot Engine
@ -50,7 +50,7 @@ if you need a quick writeup about Godot Engine.
Freedom Conservancy <https://sfconservancy.org>`_ not-for-profit. Freedom Conservancy <https://sfconservancy.org>`_ not-for-profit.
For a more in-depth view of the engine, you are encouraged to read this For a more in-depth view of the engine, you are encouraged to read this
documentation further, especially the :ref:`Step by step documentation further, especially the `Step by step
<toc-learn-step_by_step>` tutorial. <toc-learn-step_by_step>` tutorial.
About the documentation About the documentation
@ -80,29 +80,29 @@ This documentation is organized in five sections with an impressively
unbalanced distribution of contents but the way it is split up should be unbalanced distribution of contents but the way it is split up should be
relatively intuitive: relatively intuitive:
- The :ref:`sec-general` section contains this introduction as well as - The `sec-general` section contains this introduction as well as
information about the engine, its history, its licensing, authors, etc. It information about the engine, its history, its licensing, authors, etc. It
also contains the :ref:`doc_faq`. also contains the `doc_faq`.
- The :ref:`sec-learn` section is the *raison d'être* of this - The `sec-learn` section is the *raison d'être* of this
documentation, as it contains all the necessary information on using the documentation, as it contains all the necessary information on using the
engine to make games. It starts with the :ref:`Step by step engine to make games. It starts with the `Step by step
<toc-learn-step_by_step>` tutorial which should be the entry point for all <toc-learn-step_by_step>` tutorial which should be the entry point for all
new users. new users.
- The :ref:`sec-tutorials` section can be read as needed, - The `sec-tutorials` section can be read as needed,
in any order. It contains feature-specific tutorials and documentation. in any order. It contains feature-specific tutorials and documentation.
- The :ref:`sec-devel` section is intended for advanced users and contributors - The `sec-devel` section is intended for advanced users and contributors
to the engine development, with information on compiling the engine, to the engine development, with information on compiling the engine,
developing C++ modules or editor plugins. developing C++ modules or editor plugins.
- The :ref:`sec-community` section gives information related to contributing to - The `sec-community` section gives information related to contributing to
engine development and the life of its community, e.g. how to report bugs, engine development and the life of its community, e.g. how to report bugs,
help with the documentation, etc. It also points to various community channels help with the documentation, etc. It also points to various community channels
like IRC and Discord and contains a list of recommended third-party tutorials like IRC and Discord and contains a list of recommended third-party tutorials
outside of this documentation. outside of this documentation.
- Finally, the :ref:`sec-class-ref` is the documentation of the Godot API, - Finally, the `sec-class-ref` is the documentation of the Godot API,
which is also available directly within the engine's script editor. It is which is also available directly within the engine's script editor. It is
generated automatically from a file in the main source repository, therefore generated automatically from a file in the main source repository, therefore
the generated files of the documentation are not meant to be modified. See the generated files of the documentation are not meant to be modified. See
:ref:`doc_updating_the_class_reference` for details. `doc_updating_the_class_reference` for details.
In addition to this documentation you may also want to take a look at the In addition to this documentation you may also want to take a look at the
various `Godot demo projects <https://github.com/godotengine/godot-demo-projects>`_. various `Godot demo projects <https://github.com/godotengine/godot-demo-projects>`_.

View File

@ -33,8 +33,8 @@ Platforms
- Android 4.4 and later. - Android 4.4 and later.
- iOS 10.0 and later. - iOS 10.0 and later.
- :ref:`Consoles <doc_consoles>`. - `Consoles <doc_consoles>`.
- :ref:`Headless Linux and macOS servers <doc_exporting_for_dedicated_servers>`. - `Headless Linux and macOS servers <doc_exporting_for_dedicated_servers>`.
Godot aims to be as platform-independent as possible and can be ported to new Godot aims to be as platform-independent as possible and can be ported to new
platforms with relative ease. platforms with relative ease.
@ -46,9 +46,9 @@ Editor
- Scene tree editor. - Scene tree editor.
- Built-in script editor. - Built-in script editor.
- Support for :ref:`external script editors <doc_external_editor>` such as - Support for `external script editors <doc_external_editor>` such as
Visual Studio Code or Vim. Visual Studio Code or Vim.
- GDScript :ref:`debugger <doc_debugger_panel>`. - GDScript `debugger <doc_debugger_panel>`.
- No support for debugging in threads yet. - No support for debugging in threads yet.
- Performance monitoring tools. - Performance monitoring tools.
@ -71,10 +71,10 @@ Editor
**Plugins:** **Plugins:**
- Editor plugins can be downloaded from the - Editor plugins can be downloaded from the
:ref:`asset library <doc_what_is_assetlib>` to extend editor functionality. `asset library <doc_what_is_assetlib>` to extend editor functionality.
- :ref:`Create your own plugins <doc_making_plugins>` using GDScript to add new - `Create your own plugins <doc_making_plugins>` using GDScript to add new
features or speed up your workflow. features or speed up your workflow.
- :ref:`Download projects from the asset library <doc_using_assetlib_editor>` - `Download projects from the asset library <doc_using_assetlib_editor>`
in the project manager and import them directly. in the project manager and import them directly.
2D graphics 2D graphics
@ -275,7 +275,7 @@ Editor
**Performance:** **Performance:**
- Occlusion culling with :ref:`rooms and portals <doc_rooms_and_portals>`. - Occlusion culling with `rooms and portals <doc_rooms_and_portals>`.
Supports gameplay notifications with primary and secondary visibility to Supports gameplay notifications with primary and secondary visibility to
disable AI/physics processing for nodes that don't need it. disable AI/physics processing for nodes that don't need it.
- Real-time occluder shapes (sphere and polygon). Not as effective as rooms and portals - Real-time occluder shapes (sphere and polygon). Not as effective as rooms and portals
@ -291,8 +291,8 @@ Editor
^^^^^^^^ ^^^^^^^^
- Built-in meshes: cube, cylinder/cone, (hemi)sphere, prism, plane, quad. - Built-in meshes: cube, cylinder/cone, (hemi)sphere, prism, plane, quad.
- Tools for :ref:`procedural geometry generation <doc_procedural_geometry>`. - Tools for `procedural geometry generation <doc_procedural_geometry>`.
- :ref:`Constructive solid geometry <doc_csg_tools>` (intended for prototyping). - `Constructive solid geometry <doc_csg_tools>` (intended for prototyping).
- Path3D node to represent a path in 3D space. - Path3D node to represent a path in 3D space.
- Can be drawn in the editor or generated procedurally. - Can be drawn in the editor or generated procedurally.
@ -326,7 +326,7 @@ Shaders
- *2D:* Custom vertex, fragment, and light shaders. - *2D:* Custom vertex, fragment, and light shaders.
- *3D:* Custom vertex, fragment, light, and sky shaders. - *3D:* Custom vertex, fragment, light, and sky shaders.
- Text-based shaders using a :ref:`shader language inspired by GLSL <doc_shading_language>`. - Text-based shaders using a `shader language inspired by GLSL <doc_shading_language>`.
- Visual shader editor. - Visual shader editor.
- Support for visual shader plugins. - Support for visual shader plugins.
@ -338,19 +338,19 @@ Scripting
- Object-oriented design pattern with scripts extending nodes. - Object-oriented design pattern with scripts extending nodes.
- Signals and groups for communicating between scripts. - Signals and groups for communicating between scripts.
- Support for :ref:`cross-language scripting <doc_cross_language_scripting>`. - Support for `cross-language scripting <doc_cross_language_scripting>`.
- Many 2D and 3D linear algebra data types such as vectors and transforms. - Many 2D and 3D linear algebra data types such as vectors and transforms.
:ref:`GDScript: <toc-learn-scripting-gdscript>` `GDScript: <toc-learn-scripting-gdscript>`
- :ref:`High-level interpreted language <doc_gdscript>` with - `High-level interpreted language <doc_gdscript>` with
:ref:`optional static typing <doc_gdscript_static_typing>`. `optional static typing <doc_gdscript_static_typing>`.
- Syntax inspired by Python. - Syntax inspired by Python.
- Syntax highlighting is provided on GitHub. - Syntax highlighting is provided on GitHub.
- :ref:`Use threads <doc_using_multiple_threads>` to perform asynchronous actions - `Use threads <doc_using_multiple_threads>` to perform asynchronous actions
or make use of multiple processor cores. or make use of multiple processor cores.
:ref:`C#: <toc-learn-scripting-C#>` `C#: <toc-learn-scripting-C#>`
- Packaged in a separate binary to keep file sizes and dependencies down. - Packaged in a separate binary to keep file sizes and dependencies down.
- Uses Mono 6.x. - Uses Mono 6.x.
@ -360,9 +360,9 @@ Scripting
- Supports all platforms. - Supports all platforms.
- Using an external editor is recommended to benefit from IDE functionality. - Using an external editor is recommended to benefit from IDE functionality.
:ref:`VisualScript: <toc-learn-scripting-visual_script>` `VisualScript: <toc-learn-scripting-visual_script>`
- :ref:`Graph-based visual scripting language <doc_what_is_visual_script>`. - `Graph-based visual scripting language <doc_what_is_visual_script>`.
- Works best when used for specific purposes (such as level-specific logic) - Works best when used for specific purposes (such as level-specific logic)
rather than as a language to create entire projects. rather than as a language to create entire projects.
@ -386,7 +386,7 @@ Scripting
Future Godot 4.x releases may have VisualScript reimplemented as an extension. Future Godot 4.x releases may have VisualScript reimplemented as an extension.
While Godot 3.x will keep VisualScript supported, we recommend While Godot 3.x will keep VisualScript supported, we recommend
:ref:`trying out GDScript <toc-learn-scripting-gdscript>` instead, `trying out GDScript <toc-learn-scripting-gdscript>` instead,
especially if you intend to migrate your project to Godot 4. especially if you intend to migrate your project to Godot 4.
Audio Audio
@ -399,7 +399,7 @@ Audio
- Optional Doppler effect in 2D and 3D. - Optional Doppler effect in 2D and 3D.
- Support for re-routable :ref:`audio buses <doc_audio_buses>` and effects - Support for re-routable `audio buses <doc_audio_buses>` and effects
with dozens of effects included. with dozens of effects included.
- Listener2D and Listener3D nodes to listen from a position different than the camera. - Listener2D and Listener3D nodes to listen from a position different than the camera.
- Audio input to record microphones with real-time access using the AudioEffectCapture class. - Audio input to record microphones with real-time access using the AudioEffectCapture class.
@ -416,11 +416,11 @@ Audio
Import Import
^^^^^^ ^^^^^^
- Support for :ref:`custom import plugins <doc_import_plugins>`. - Support for `custom import plugins <doc_import_plugins>`.
**Formats:** **Formats:**
- *Images:* See :ref:`doc_import_images`. - *Images:* See `doc_import_images`.
- *Audio:* - *Audio:*
- WAV with optional IMA-ADPCM compression. - WAV with optional IMA-ADPCM compression.
@ -492,8 +492,8 @@ Internationalization
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
- Full support for Unicode including emoji. - Full support for Unicode including emoji.
- Store localization strings using :ref:`CSV <doc_internationalizing_games>` - Store localization strings using `CSV <doc_internationalizing_games>`
or :ref:`gettext <doc_localization_using_gettext>`. or `gettext <doc_localization_using_gettext>`.
- Use localized strings in your project automatically in GUI elements or by - Use localized strings in your project automatically in GUI elements or by
using the ``tr()`` function. using the ``tr()`` function.
- Support for right-to-left typesetting and text shaping planned in Godot 4.0. - Support for right-to-left typesetting and text shaping planned in Godot 4.0.
@ -516,10 +516,10 @@ Windowing and OS integration
- Execute commands in a blocking or non-blocking manner. - Execute commands in a blocking or non-blocking manner.
- Open file paths and URLs using default or custom protocol handlers (if registered on the system). - Open file paths and URLs using default or custom protocol handlers (if registered on the system).
- Parse custom command line arguments. - Parse custom command line arguments.
- :ref:`Headless/server binaries <doc_exporting_for_dedicated_servers>` can be - `Headless/server binaries <doc_exporting_for_dedicated_servers>` can be
downloaded for Linux and :ref:`compiled for macOS <doc_compiling_for_osx>`. downloaded for Linux and `compiled for macOS <doc_compiling_for_osx>`.
Any binary can be used without a window using the ``--no-window`` Any binary can be used without a window using the ``--no-window``
:ref:`command line argument <doc_command_line_tutorial>`. `command line argument <doc_command_line_tutorial>`.
Mobile Mobile
^^^^^^ ^^^^^^
@ -552,7 +552,7 @@ The editor UI can easily be extended in many ways using add-ons.
- Dropdown menus using PopupMenu and OptionButton. - Dropdown menus using PopupMenu and OptionButton.
- Scrollbars. - Scrollbars.
- Labels. - Labels.
- RichTextLabel for :ref:`text formatted using BBCode <doc_bbcode_in_richtextlabel>`. - RichTextLabel for `text formatted using BBCode <doc_bbcode_in_richtextlabel>`.
- Trees (can also be used to represent tables). - Trees (can also be used to represent tables).
- Color picker with RGB and HSV modes. - Color picker with RGB and HSV modes.
- Containers (horizontal, vertical, grid, flow, center, margin, aspect ratio, draggable splitter, ...). - Containers (horizontal, vertical, grid, flow, center, margin, aspect ratio, draggable splitter, ...).
@ -563,11 +563,11 @@ The editor UI can easily be extended in many ways using add-ons.
- Anchors to keep GUI elements in a specific corner, edge or centered. - Anchors to keep GUI elements in a specific corner, edge or centered.
- Containers to place GUI elements automatically following certain rules. - Containers to place GUI elements automatically following certain rules.
- :ref:`Stack <class_BoxContainer>` layouts. - `Stack <class_BoxContainer>` layouts.
- :ref:`Grid <class_GridContainer>` layouts. - `Grid <class_GridContainer>` layouts.
- :ref:`Margin <class_MarginContainer>` and :ref:`centered <class_CenterContainer>` - `Margin <class_MarginContainer>` and `centered <class_CenterContainer>`
layouts. layouts.
- :ref:`Draggable splitter <class_SplitContainer>` layouts. - `Draggable splitter <class_SplitContainer>` layouts.
- Scale to multiple resolutions using the ``2d`` or ``viewport`` stretch modes. - Scale to multiple resolutions using the ``2d`` or ``viewport`` stretch modes.
- Support any aspect ratio using anchors and the ``expand`` stretch aspect. - Support any aspect ratio using anchors and the ``expand`` stretch aspect.
@ -578,11 +578,11 @@ The editor UI can easily be extended in many ways using add-ons.
- Generate a theme based on the current editor theme settings. - Generate a theme based on the current editor theme settings.
- Procedural vector-based theming using :ref:`class_StyleBoxFlat`. - Procedural vector-based theming using `class_StyleBoxFlat`.
- Supports rounded/beveled corners, drop shadows, per-border widths and antialiasing. - Supports rounded/beveled corners, drop shadows, per-border widths and antialiasing.
- Texture-based theming using :ref:`class_StyleBoxTexture`. - Texture-based theming using `class_StyleBoxTexture`.
Godot's small distribution size can make it a suitable alternative to frameworks Godot's small distribution size can make it a suitable alternative to frameworks
like Electron or Qt. like Electron or Qt.
@ -591,7 +591,7 @@ Animation
^^^^^^^^^ ^^^^^^^^^
- Direct kinematics and inverse kinematics. - Direct kinematics and inverse kinematics.
- :ref:`Tween <class_Tween>` node to easily perform procedural animations by code. - `Tween <class_Tween>` node to easily perform procedural animations by code.
- Support for animating any property with customizable interpolation. - Support for animating any property with customizable interpolation.
- Support for calling methods in animation tracks. - Support for calling methods in animation tracks.
- Support for playing sounds in animation tracks. - Support for playing sounds in animation tracks.
@ -600,42 +600,42 @@ Animation
File formats File formats
^^^^^^^^^^^^ ^^^^^^^^^^^^
- Scenes and resources can be saved in :ref:`text-based <doc_tscn_file_format>` or binary formats. - Scenes and resources can be saved in `text-based <doc_tscn_file_format>` or binary formats.
- Text-based formats are human-readable and more friendly to version control. - Text-based formats are human-readable and more friendly to version control.
- Binary formats are faster to save/load for large scenes/resources. - Binary formats are faster to save/load for large scenes/resources.
- Read and write text or binary files using :ref:`class_File`. - Read and write text or binary files using `class_File`.
- Can optionally be compressed or encrypted. - Can optionally be compressed or encrypted.
- Read and write :ref:`class_JSON` files. - Read and write `class_JSON` files.
- Read and write INI-style configuration files using :ref:`class_ConfigFile`. - Read and write INI-style configuration files using `class_ConfigFile`.
- Can (de)serialize any Godot datatype, including Vector2/3, Color, ... - Can (de)serialize any Godot datatype, including Vector2/3, Color, ...
- Read XML files using :ref:`class_XMLParser`. - Read XML files using `class_XMLParser`.
- Pack game data into a PCK file (custom format optimized for fast seeking), - Pack game data into a PCK file (custom format optimized for fast seeking),
into a ZIP archive, or directly into the executable for single-file distribution. into a ZIP archive, or directly into the executable for single-file distribution.
- :ref:`Export additional PCK files<doc_exporting_pcks>` that can be read - `Export additional PCK files<doc_exporting_pcks>` that can be read
by the engine to support mods and DLCs. by the engine to support mods and DLCs.
Miscellaneous Miscellaneous
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
- :ref:`Low-level access to servers <doc_using_servers>` which allows bypassing - `Low-level access to servers <doc_using_servers>` which allows bypassing
the scene tree's overhead when needed. the scene tree's overhead when needed.
- :ref:`Command line interface <doc_command_line_tutorial>` for automation. - `Command line interface <doc_command_line_tutorial>` for automation.
- Export and deploy projects using continuous integration platforms. - Export and deploy projects using continuous integration platforms.
- `Shell completion scripts <https://github.com/godotengine/godot/tree/master/misc/dist/shell>`__ - `Shell completion scripts <https://github.com/godotengine/godot/tree/master/misc/dist/shell>`__
are available for Bash, zsh and fish. are available for Bash, zsh and fish.
- Support for :ref:`C++ modules <doc_custom_modules_in_c++>` statically linked - Support for `C++ modules <doc_custom_modules_in_c++>` statically linked
into the engine binary. into the engine binary.
- Engine and editor written in C++03. - Engine and editor written in C++03.
- Can be :ref:`compiled <doc_introduction_to_the_buildsystem>` using GCC, - Can be `compiled <doc_introduction_to_the_buildsystem>` using GCC,
Clang and MSVC. MinGW is also supported. Clang and MSVC. MinGW is also supported.
- Friendly towards packagers. In most cases, system libraries can be used - Friendly towards packagers. In most cases, system libraries can be used
instead of the ones provided by Godot. The build system doesn't download anything. instead of the ones provided by Godot. The build system doesn't download anything.
@ -644,7 +644,7 @@ Miscellaneous
- Licensed under the permissive MIT license. - Licensed under the permissive MIT license.
- Open developement process with :ref:`contributions welcome <doc_ways_to_contribute>`. - Open developement process with `contributions welcome <doc_ways_to_contribute>`.
.. seealso:: .. seealso::

View File

@ -7,7 +7,7 @@ This page lists common issues encountered when using Godot and possible solution
.. seealso:: .. seealso::
See :ref:`doc_using_the_web_editor` for caveats specific to the HTML5 version See `doc_using_the_web_editor` for caveats specific to the HTML5 version
of the Godot editor. of the Godot editor.
Everything I do in the editor or project manager appears delayed by one frame. Everything I do in the editor or project manager appears delayed by one frame.
@ -81,7 +81,7 @@ done to improve performance, especially on integrated graphics, where rendering
To resolve this, open **Project > Project Settings** and enable **Display > To resolve this, open **Project > Project Settings** and enable **Display >
Window > Dpi > Allow Hidpi**. On top of that, make sure your project is Window > Dpi > Allow Hidpi**. On top of that, make sure your project is
configured to support :ref:`multiple resolutions <doc_multiple_resolutions>`. configured to support `multiple resolutions <doc_multiple_resolutions>`.
The project window doesn't appear centered when I run the project. The project window doesn't appear centered when I run the project.
------------------------------------------------------------------ ------------------------------------------------------------------
@ -89,7 +89,7 @@ The project window doesn't appear centered when I run the project.
This is a `known bug <https://github.com/godotengine/godot/issues/13017>`__. To This is a `known bug <https://github.com/godotengine/godot/issues/13017>`__. To
resolve this, open **Project > Project Settings** and enable **Display > Window resolve this, open **Project > Project Settings** and enable **Display > Window
> Dpi > Allow Hidpi**. On top of that, make sure your project is configured to > Dpi > Allow Hidpi**. On top of that, make sure your project is configured to
support :ref:`multiple resolutions <doc_multiple_resolutions>`. support `multiple resolutions <doc_multiple_resolutions>`.
The project works when run from the editor, but fails to load some files when running from an exported copy. The project works when run from the editor, but fails to load some files when running from an exported copy.
------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------
@ -99,9 +99,9 @@ in the Export dialog. By default, Godot will only include actual *resources*
into the PCK file. Some files commonly used, such as JSON files, are not into the PCK file. Some files commonly used, such as JSON files, are not
considered resources. For example, if you load ``test.json`` in the exported considered resources. For example, if you load ``test.json`` in the exported
project, you need to specify ``*.json`` in the non-resource export filter. See project, you need to specify ``*.json`` in the non-resource export filter. See
:ref:`doc_exporting_projects_export_mode` for more information. `doc_exporting_projects_export_mode` for more information.
On Windows, this can also be due to :ref:`case sensitivity On Windows, this can also be due to `case sensitivity
<doc_project_organization_case_sensitivity>` issues. If you reference a resource <doc_project_organization_case_sensitivity>` issues. If you reference a resource
in your script with a different case than on the filesystem, loading will fail in your script with a different case than on the filesystem, loading will fail
once you export the project. This is because the virtual PCK filesystem is once you export the project. This is because the virtual PCK filesystem is

View File

@ -60,7 +60,7 @@ reproduce the bug.
Before bisecting a regression, you need to set up a build environment to Before bisecting a regression, you need to set up a build environment to
compile Godot from source. To do so, read the compile Godot from source. To do so, read the
:ref:`Compiling <toc-devel-compiling>` page for your target platform. `Compiling <toc-devel-compiling>` page for your target platform.
(Compiling Godot from source doesn't require C++ programming knowledge.) (Compiling Godot from source doesn't require C++ programming knowledge.)
Note that compiling Godot can take a while on slow hardware (up an hour for Note that compiling Godot can take a while on slow hardware (up an hour for
@ -89,7 +89,7 @@ following commit hashes depending on the version:
To refer to the latest state of the master branch, you can use ``master`` To refer to the latest state of the master branch, you can use ``master``
instead of a commit hash. instead of a commit hash.
:ref:`Get Godot's source code using Git <doc_getting_source>`. Once this `Get Godot's source code using Git <doc_getting_source>`. Once this
is done, in the terminal window, use ``cd`` to reach the Godot repository is done, in the terminal window, use ``cd`` to reach the Godot repository
folder and enter the following command: folder and enter the following command:

View File

@ -10,7 +10,7 @@ built-in node types.
.. seealso:: .. seealso::
To learn to submit your changes to the Godot project using the Git version To learn to submit your changes to the Godot project using the Git version
control system, see :ref:`doc_updating_the_class_reference`. control system, see `doc_updating_the_class_reference`.
The reference for each class is contained in an XML file like the one below: The reference for each class is contained in an XML file like the one below:
@ -79,7 +79,7 @@ their documentation by completing or improving the text in these tags:
- `<signal>` (in its `<description>` tag; arguments don't take separate documentation strings) - `<signal>` (in its `<description>` tag; arguments don't take separate documentation strings)
- `<constant>` - `<constant>`
Write in a clear and simple language. Always follow the :ref:`writing guidelines Write in a clear and simple language. Always follow the `writing guidelines
<doc_docs_writing_guidelines>` to keep your descriptions short and easy to read. <doc_docs_writing_guidelines>` to keep your descriptions short and easy to read.
**Do not leave empty lines** in the descriptions: each line in the XML file will **Do not leave empty lines** in the descriptions: each line in the XML file will
result in a new paragraph, even if it is empty. result in a new paragraph, even if it is empty.
@ -107,7 +107,7 @@ This will convert the XML files to the online documentation's format and output
errors if anything's wrong. errors if anything's wrong.
Alternatively, you can build Godot and open the modified page in the built-in Alternatively, you can build Godot and open the modified page in the built-in
code reference. To learn how to compile the engine, read the :ref:`compilation code reference. To learn how to compile the engine, read the `compilation
guide <toc-devel-compiling>`. guide <toc-devel-compiling>`.
We recommend using a code editor that supports XML files like Vim, Atom, Visual Studio Code, We recommend using a code editor that supports XML files like Vim, Atom, Visual Studio Code,
@ -125,19 +125,19 @@ the text. Here's the list of available tags:
+----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+
| Tag | Effect | Usage | Result | | Tag | Effect | Usage | Result |
+============================+======================================+===================================+===================================================+ +============================+======================================+===================================+===================================================+
| [Class] | Link a class | Move the [Sprite]. | Move the :ref:`class_Sprite`. | | [Class] | Link a class | Move the [Sprite]. | Move the `class_Sprite`. |
+----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+
| [method methodname] | Link to a method in this class | Call [method hide]. | Call :ref:`hide <class_Spatial_method_hide>`. | | [method methodname] | Link to a method in this class | Call [method hide]. | Call `hide <class_Spatial_method_hide>`. |
+----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+
| [method Class.methodname] | Link to another class's method | Call [method Spatial.hide]. | Call :ref:`hide <class_Spatial_method_hide>`. | | [method Class.methodname] | Link to another class's method | Call [method Spatial.hide]. | Call `hide <class_Spatial_method_hide>`. |
+----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+
| [member membername] | Link to a member in this class | Get [member scale]. | Get :ref:`scale <class_Node2D_property_scale>`. | | [member membername] | Link to a member in this class | Get [member scale]. | Get `scale <class_Node2D_property_scale>`. |
+----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+
| [member Class.membername] | Link to another class's member | Get [member Node2D.scale]. | Get :ref:`scale <class_Node2D_property_scale>`. | | [member Class.membername] | Link to another class's member | Get [member Node2D.scale]. | Get `scale <class_Node2D_property_scale>`. |
+----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+
| [signal signalname] | Link to a signal in this class | Emit [signal renamed]. | Emit :ref:`renamed <class_Node_signal_renamed>`. | | [signal signalname] | Link to a signal in this class | Emit [signal renamed]. | Emit `renamed <class_Node_signal_renamed>`. |
+----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+
| [signal Class.signalname] | Link to another class's signal | Emit [signal Node.renamed]. | Emit :ref:`renamed <class_Node_signal_renamed>`. | | [signal Class.signalname] | Link to another class's signal | Emit [signal Node.renamed]. | Emit `renamed <class_Node_signal_renamed>`. |
+----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+
| [b] [/b] | Bold | Some [b]bold[/b] text. | Some **bold** text. | | [b] [/b] | Bold | Some [b]bold[/b] text. | Some **bold** text. |
+----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+

View File

@ -50,7 +50,7 @@ setup clang-format locally to check and automatically fix all your commits.
.. seealso:: .. seealso::
These guidelines only cover code formatting. See :ref:`doc_cpp_usage_guidelines` These guidelines only cover code formatting. See `doc_cpp_usage_guidelines`
for a list of language features that are permitted in pull requests. for a list of language features that are permitted in pull requests.
Using clang-format locally Using clang-format locally
@ -345,7 +345,7 @@ Don't repeat what the code says in a comment. Explain the *why* rather than *how
You can use Javadoc-style comments above function or macro definitions. It's You can use Javadoc-style comments above function or macro definitions. It's
recommended to use Javadoc-style comments *only* for methods which are not recommended to use Javadoc-style comments *only* for methods which are not
exposed to scripting. This is because exposed methods should be documented in exposed to scripting. This is because exposed methods should be documented in
the :ref:`class reference XML <doc_updating_the_class_reference>` the `class reference XML <doc_updating_the_class_reference>`
instead. instead.
**Example:** **Example:**

View File

@ -9,7 +9,7 @@ writing or reviewing pages.
.. seealso:: .. seealso::
If you want to translate pages or the class reference from English to other If you want to translate pages or the class reference from English to other
languages, read :ref:`doc_editor_and_docs_localization`. languages, read `doc_editor_and_docs_localization`.
Getting started Getting started
--------------- ---------------
@ -20,16 +20,16 @@ files in the `godot-docs GitHub repository
request triggers a rebuild of the online documentation upon merging. request triggers a rebuild of the online documentation upon merging.
.. seealso:: For details on Git usage and the pull request workflow, please .. seealso:: For details on Git usage and the pull request workflow, please
refer to the :ref:`doc_pr_workflow` page. Most of what it describes refer to the `doc_pr_workflow` page. Most of what it describes
regarding the main godotengine/godot repository is also valid for regarding the main godotengine/godot repository is also valid for
the docs repository. the docs repository.
.. warning:: The class reference's source files are in the `Godot engine .. warning:: The class reference's source files are in the `Godot engine
repository <https://github.com/godotengine/godot>`_. We generate repository <https://github.com/godotengine/godot>`_. We generate
the :ref:`Godot API <toc-class-ref>` section of this documentation the `Godot API <toc-class-ref>` section of this documentation
from them. If you want to update the description of a class, its from them. If you want to update the description of a class, its
methods, or properties, read methods, or properties, read
:ref:`doc_updating_the_class_reference`. `doc_updating_the_class_reference`.
What is the Godot documentation What is the Godot documentation
------------------------------- -------------------------------
@ -41,7 +41,7 @@ two game creation tutorials in the Getting Started section.
We strive to write factual content in an accessible and well-written language. To We strive to write factual content in an accessible and well-written language. To
contribute, you should also read: contribute, you should also read:
1. The :ref:`doc_docs_writing_guidelines`. There, you will find rules and 1. The `doc_docs_writing_guidelines`. There, you will find rules and
recommendations to write in a way that everyone understands. recommendations to write in a way that everyone understands.
2. The content guidelines. They explain the principles we follow to write the 2. The content guidelines. They explain the principles we follow to write the
documentation and the kind of content we accept. documentation and the kind of content we accept.
@ -65,10 +65,10 @@ favorite text editor. You can then commit the changes, push them to your fork,
and make a pull request. **Note that the pages in** ``classes/`` **should not be and make a pull request. **Note that the pages in** ``classes/`` **should not be
edited here.** They are automatically generated from Godots `XML class edited here.** They are automatically generated from Godots `XML class
reference <https://github.com/godotengine/godot/tree/master/doc/classes>`__. reference <https://github.com/godotengine/godot/tree/master/doc/classes>`__.
See :ref:`doc_updating_the_class_reference` for details. See `doc_updating_the_class_reference` for details.
.. seealso:: To build the manual and test changes on your computer, see .. seealso:: To build the manual and test changes on your computer, see
:ref:`doc_building_the_manual`. `doc_building_the_manual`.
Editing pages online Editing pages online
-------------------- --------------------
@ -107,7 +107,7 @@ Before adding a new page, please ensure that it fits in the documentation:
<https://github.com/godotengine/godot-docs/issues>`_ or open a new one to see <https://github.com/godotengine/godot-docs/issues>`_ or open a new one to see
if the page is necessary. if the page is necessary.
2. Ensure there isn't a page that already covers the topic. 2. Ensure there isn't a page that already covers the topic.
3. Read our :ref:`doc_content_guidelines`. 3. Read our `doc_content_guidelines`.
To add a new page, create a ``.rst`` file with a meaningful name in the section you To add a new page, create a ``.rst`` file with a meaningful name in the section you
want to add a file to, e.g. ``tutorials/3d/light_baking.rst``. want to add a file to, e.g. ``tutorials/3d/light_baking.rst``.
@ -130,8 +130,8 @@ Always begin pages with their title and a Sphinx reference name:
The reference ``_doc_insert_your_title_here`` and the title should match. The reference ``_doc_insert_your_title_here`` and the title should match.
The reference allows linking to this page using the ``:ref:`` format, e.g. The reference allows linking to this page using the ```` format, e.g.
``:ref:`doc_insert_your_title_here``` would link to the above example page (note ```doc_insert_your_title_here``` would link to the above example page (note
the lack of leading underscore in the reference). the lack of leading underscore in the reference).
Write your titles like plain sentences, without capitalizing each word: Write your titles like plain sentences, without capitalizing each word:

View File

@ -31,11 +31,11 @@ modules or GDNative scripts.
The guidelines below don't apply to third-party dependencies, although we The guidelines below don't apply to third-party dependencies, although we
generally favor small libraries instead of larger solutions. See also generally favor small libraries instead of larger solutions. See also
:ref:`doc_best_practices_for_engine_contributors`. `doc_best_practices_for_engine_contributors`.
.. seealso:: .. seealso::
See :ref:`doc_code_style_guidelines` for formatting guidelines. See `doc_code_style_guidelines` for formatting guidelines.
Disallowed features Disallowed features
------------------- -------------------
@ -50,7 +50,7 @@ Standard Template Library
We don't allow using the `STL <https://en.wikipedia.org/wiki/Standard_Template_Library>`__ We don't allow using the `STL <https://en.wikipedia.org/wiki/Standard_Template_Library>`__
as Godot provides its own data types (among other things). as Godot provides its own data types (among other things).
See :ref:`doc_faq_why_not_stl` for more information. See `doc_faq_why_not_stl` for more information.
This means that pull requests should **not** use ``std::string``, This means that pull requests should **not** use ``std::string``,
``std::vector`` and the like. Instead, use Godot's datatypes as described below: ``std::vector`` and the like. Instead, use Godot's datatypes as described below:
@ -102,5 +102,5 @@ guards instead of ``#pragma once`` in new files.
.. seealso:: .. seealso::
See :ref:`doc_code_style_guidelines_header_includes` for guidelines on sorting See `doc_code_style_guidelines_header_includes` for guidelines on sorting
includes in C++ and Objective-C files. includes in C++ and Objective-C files.

View File

@ -34,7 +34,7 @@ There are 3 rules to describe classes:
.. seealso:: .. seealso::
See the :ref:`content guidelines <doc_content_guidelines>` for information See the `content guidelines <doc_content_guidelines>` for information
on the types of documentation you can write in the official documentation. on the types of documentation you can write in the official documentation.
7 rules for clear English 7 rules for clear English

View File

@ -21,22 +21,22 @@ in a pull request and getting it merged will trigger a rebuild of the online
documentation. documentation.
.. seealso:: For details on Git usage and the pull request workflow, please .. seealso:: For details on Git usage and the pull request workflow, please
refer to the :ref:`doc_pr_workflow` page. Most of what it refer to the `doc_pr_workflow` page. Most of what it
describes regarding the main godotengine/godot repository is describes regarding the main godotengine/godot repository is
also valid for the docs repository. also valid for the docs repository.
.. warning:: The class reference's source files are in the `Godot engine repository .. warning:: The class reference's source files are in the `Godot engine repository
<https://github.com/godotengine/godot>`_. We generate the :ref:`Godot API <https://github.com/godotengine/godot>`_. We generate the `Godot API
<toc-class-ref>` section of this documentation from them. If you want to update the <toc-class-ref>` section of this documentation from them. If you want to update the
description of a class, its methods, or properties, read description of a class, its methods, or properties, read
:ref:`doc_updating_the_class_reference`. `doc_updating_the_class_reference`.
.. warning:: If you want to edit the **API reference**, please note that it .. warning:: If you want to edit the **API reference**, please note that it
should *not* be done in the godot-docs repository. Instead, you should *not* be done in the godot-docs repository. Instead, you
should edit the ``doc/classes/*`` XML files of Godot's should edit the ``doc/classes/*`` XML files of Godot's
main repository. These files are then later used to generate the main repository. These files are then later used to generate the
in-editor documentation as well as the API reference of the in-editor documentation as well as the API reference of the
online docs. Read more here: :ref:`doc_updating_the_class_reference`. online docs. Read more here: `doc_updating_the_class_reference`.
The 'Edit on GitHub' link The 'Edit on GitHub' link
------------------------- -------------------------
@ -70,7 +70,7 @@ What makes good documentation?
Documentation should be well written in plain English, using well-formed Documentation should be well written in plain English, using well-formed
sentences and various levels of sections and subsections. It should be clear sentences and various levels of sections and subsections. It should be clear
and objective. Also, have a look at the :ref:`doc_docs_writing_guidelines`. and objective. Also, have a look at the `doc_docs_writing_guidelines`.
We differentiate tutorial pages from other documentation pages by these We differentiate tutorial pages from other documentation pages by these
definitions: definitions:
@ -98,8 +98,8 @@ Always begin pages with their title and a Sphinx reference name:
Insert your title here Insert your title here
====================== ======================
The reference allows linking to this page using the ``:ref:`` format, e.g. The reference allows linking to this page using the ```` format, e.g.
``:ref:`doc_insert_your_title_here``` would link to the above example page ```doc_insert_your_title_here``` would link to the above example page
(note the lack of leading underscore in the reference). (note the lack of leading underscore in the reference).
Also, avoid American CamelCase titles: title's first word should begin Also, avoid American CamelCase titles: title's first word should begin

View File

@ -172,14 +172,14 @@ translating.
same source string location while comparing with the online version of that same source string location while comparing with the online version of that
page in English. An example of source string location could be page in English. An example of source string location could be
``getting_started/step_by_step/nodes_and_scenes.rst`` for the ``getting_started/step_by_step/nodes_and_scenes.rst`` for the
page :ref:`doc_nodes_and_scenes`. page `doc_nodes_and_scenes`.
- The class reference's translation template is generated from the source XML - The class reference's translation template is generated from the source XML
files in **alphabetical order**, which is also the same as the order of the files in **alphabetical order**, which is also the same as the order of the
table of contents for the online version. You can therefore locate the source table of contents for the online version. You can therefore locate the source
string corresponding to the brief description of a given class to find the string corresponding to the brief description of a given class to find the
first string to translate and all other descriptions from that class should be first string to translate and all other descriptions from that class should be
in the subsequent strings on Weblate. For example, the descriptions for the in the subsequent strings on Weblate. For example, the descriptions for the
:ref:`class_Node2D` class would have the source string location `class_Node2D` class would have the source string location
``doc/classes/Node2D.xml``. ``doc/classes/Node2D.xml``.
A handy tool to locate specific pages/classes is to use Weblate's advanced A handy tool to locate specific pages/classes is to use Weblate's advanced
@ -272,16 +272,16 @@ external links, etc. Here are some examples::
|supported| Backwards-compatible new features (backported from the ``master`` |supported| Backwards-compatible new features (backported from the ``master``
branch) as well as bug, security, and platform support fixes. branch) as well as bug, security, and platform support fixes.
# The :ref: Sphinx "role" is used for internal references to other pages of # The Sphinx "role" is used for internal references to other pages of
# the documentation. # the documentation.
# It can be used with only the reference name of a page (which should not be # It can be used with only the reference name of a page (which should not be
# changed), in which case the title of that page will be displayed: # changed), in which case the title of that page will be displayed:
See :ref:`doc_ways_to_contribute`. See `doc_ways_to_contribute`.
# Or it can be used with an optional custom title, which should thus be translated: # Or it can be used with an optional custom title, which should thus be translated:
See :ref:`how to contribute <doc_ways_to_contribute>`. See `how to contribute <doc_ways_to_contribute>`.
# You may encounter other Sphinx roles, such as :kbd: used for shortcut keys. # You may encounter other Sphinx roles, such as :kbd: used for shortcut keys.
# You can translate the content between backticks to match the usual key names, # You can translate the content between backticks to match the usual key names,
@ -327,7 +327,7 @@ breaks if they are not part of the original translation.
.. seealso:: .. seealso::
See our documentation for class reference writers for the :ref:`list of See our documentation for class reference writers for the `list of
BBCode-like tags <doc_class_reference_writing_guidelines_bbcode>` which are used BBCode-like tags <doc_class_reference_writing_guidelines_bbcode>` which are used
throughout the class reference. throughout the class reference.
@ -357,7 +357,7 @@ upload mode.
version. version.
If you want to test changes locally (especially for the editor translation), you If you want to test changes locally (especially for the editor translation), you
can use the downloaded PO file and :ref:`compile Godot from source <toc-devel-compiling>`. can use the downloaded PO file and `compile Godot from source <toc-devel-compiling>`.
Rename the editor translation PO file to ``<lang>.po`` (e.g. ``eo.po`` for Rename the editor translation PO file to ``<lang>.po`` (e.g. ``eo.po`` for
Esperanto) and place it in the ``editor/translations/`` folder Esperanto) and place it in the ``editor/translations/`` folder
@ -386,7 +386,7 @@ documentation translations are synced from Weblate.
To translate an image, you should first locate it in the original English To translate an image, you should first locate it in the original English
documentation. To do so, browse the relevant page in the docs, e.g. documentation. To do so, browse the relevant page in the docs, e.g.
:ref:`doc_intro_to_the_editor_interface`. Click the "Edit on GitHub" link in the `doc_intro_to_the_editor_interface`. Click the "Edit on GitHub" link in the
top right corner: top right corner:
.. image:: img/l10n_08_edit_on_github.png .. image:: img/l10n_08_edit_on_github.png
@ -413,4 +413,4 @@ original image in the ``images`` subfolder
and place your translated image there. In our example, the end result should be and place your translated image there. In our example, the end result should be
``images/getting_started/step_by_step/img/project_manager_first_open.fr.png``. ``images/getting_started/step_by_step/img/project_manager_first_open.fr.png``.
Repeat this for other images and :ref:`make a Pull Request <doc_pr_workflow>`. Repeat this for other images and `make a Pull Request <doc_pr_workflow>`.

View File

@ -236,7 +236,7 @@ You will then be back to the original state of your branch before calling
If you have already created a merge commit without using ``rebase``, or If you have already created a merge commit without using ``rebase``, or
have made any other changes that have resulted in undesired history, the best option have made any other changes that have resulted in undesired history, the best option
is to use an *interactive rebase* on the upstream branch. See the :ref:`dedicated is to use an *interactive rebase* on the upstream branch. See the `dedicated
section <doc_pr_workflow_rebase>` for instructions. section <doc_pr_workflow_rebase>` for instructions.
.. tip:: If at any time you want to *reset* a local branch to a given commit or branch, .. tip:: If at any time you want to *reset* a local branch to a given commit or branch,

View File

@ -23,7 +23,7 @@ depending on whether you have a GitHub account or not.
Due to a GitHub Actions limitation, builds are only available for 90 days Due to a GitHub Actions limitation, builds are only available for 90 days
after the pull request was last updated. If you still wish to try a after the pull request was last updated. If you still wish to try a
pull request locally, you can pull request locally, you can
:ref:`compile the pull request branch from source <doc_testing_pull_requests_compile>` `compile the pull request branch from source <doc_testing_pull_requests_compile>`
instead. instead.
If you have a GitHub account If you have a GitHub account
@ -100,5 +100,5 @@ by Godot's GitHub Actions setup.
.. image:: img/testing_pull_requests_fork_zip.png .. image:: img/testing_pull_requests_fork_zip.png
- Extract the ZIP archive and follow the :ref:`compiling <toc-devel-compiling>` instructions - Extract the ZIP archive and follow the `compiling <toc-devel-compiling>` instructions
for your operating system. for your operating system.

View File

@ -5,7 +5,7 @@ Contributing to the class reference
.. highlight:: shell .. highlight:: shell
The class reference is available online in the :ref:`classes <toc-class-ref>` The class reference is available online in the `classes <toc-class-ref>`
section of the documentation and in the Godot editor, from the help menu. section of the documentation and in the Godot editor, from the help menu.
In the class reference, some methods, variables, and signals lack descriptions. In the class reference, some methods, variables, and signals lack descriptions.
@ -20,13 +20,13 @@ taking care of a given class.
.. seealso:: .. seealso::
You can find the writing guidelines for the class reference :ref:`here <doc_class_reference_writing_guidelines>`. You can find the writing guidelines for the class reference `here <doc_class_reference_writing_guidelines>`.
For details on Git usage and the pull request workflow, please For details on Git usage and the pull request workflow, please
refer to the :ref:`doc_pr_workflow` page. refer to the `doc_pr_workflow` page.
If you want to translate the class reference from English to another If you want to translate the class reference from English to another
language, see :ref:`doc_editor_and_docs_localization`. language, see `doc_editor_and_docs_localization`.
This guide is also available as a `video tutorial on YouTube This guide is also available as a `video tutorial on YouTube
<https://www.youtube.com/watch?v=5jeHXxeX-JY>`_. <https://www.youtube.com/watch?v=5jeHXxeX-JY>`_.
@ -44,7 +44,7 @@ repository: `doc/classes/
files in the ``modules/<module_name>/doc_classes/`` directory instead. files in the ``modules/<module_name>/doc_classes/`` directory instead.
.. warning:: Always edit the API reference through these source XML files. Do .. warning:: Always edit the API reference through these source XML files. Do
not edit the generated ``.rst`` files :ref:`in the online documentation not edit the generated ``.rst`` files `in the online documentation
<toc-class-ref>`, hosted in the `godot-docs <toc-class-ref>`, hosted in the `godot-docs
<https://github.com/godotengine/godot-docs>`_ repository. <https://github.com/godotengine/godot-docs>`_ repository.
@ -56,7 +56,7 @@ repository: `doc/classes/
Also, it doesn't allow you to test your changes in the engine or with validation Also, it doesn't allow you to test your changes in the engine or with validation
scripts as described in scripts as described in
:ref:`doc_class_reference_writing_guidelines_editing_xml`. `doc_class_reference_writing_guidelines_editing_xml`.
Updating the documentation template Updating the documentation template
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -64,7 +64,7 @@ Updating the documentation template
When you create a new class or modify the engine's API, you need to re-generate the XML files in ``doc/classes/``. When you create a new class or modify the engine's API, you need to re-generate the XML files in ``doc/classes/``.
To do so, you first need to compile Godot. See the To do so, you first need to compile Godot. See the
:ref:`doc_introduction_to_the_buildsystem` page to learn how. Then, execute the `doc_introduction_to_the_buildsystem` page to learn how. Then, execute the
compiled Godot binary from the Godot root directory with the ``--doctool`` option. compiled Godot binary from the Godot root directory with the ``--doctool`` option.
For example, if you're on 64-bit Linux, the command is:: For example, if you're on 64-bit Linux, the command is::

View File

@ -89,11 +89,11 @@ A good place to start is by searching for issues tagged as
on GitHub. on GitHub.
.. seealso:: Technical details about the PR workflow are outlined in a .. seealso:: Technical details about the PR workflow are outlined in a
specific section, :ref:`doc_pr_workflow`. specific section, `doc_pr_workflow`.
Details about the code style guidelines and the ``clang-format`` Details about the code style guidelines and the ``clang-format``
tool used to enforce them are outlined in tool used to enforce them are outlined in
:ref:`doc_code_style_guidelines`. `doc_code_style_guidelines`.
All pull requests must go through a review process before being accepted. All pull requests must go through a review process before being accepted.
Depending on the scope of the changes, it may take some time for a maintainer Depending on the scope of the changes, it may take some time for a maintainer
@ -125,7 +125,7 @@ Testing development versions
To help with the testing, you have several possibilities: To help with the testing, you have several possibilities:
- Compile the engine from source yourself, following the instructions of the - Compile the engine from source yourself, following the instructions of the
:ref:`Compiling <toc-devel-compiling>` page for your platform. `Compiling <toc-devel-compiling>` page for your platform.
- Test official pre-release binaries when they are announced (usually on the - Test official pre-release binaries when they are announced (usually on the
blog and other community platforms), such as alpha, beta and release candidate (RC) builds. blog and other community platforms), such as alpha, beta and release candidate (RC) builds.
@ -196,18 +196,18 @@ There are two separate resources referred to as "documentation" in Godot:
- **The class reference.** This is the documentation for the complete Godot API - **The class reference.** This is the documentation for the complete Godot API
as exposed to GDScript and the other scripting languages. It can be consulted as exposed to GDScript and the other scripting languages. It can be consulted
offline, directly in Godot's code editor, or online at :ref:`Godot API offline, directly in Godot's code editor, or online at `Godot API
<toc-class-ref>`. To contribute to the class reference, you have to edit the <toc-class-ref>`. To contribute to the class reference, you have to edit the
XML file corresponding to the class and make a pull request. XML file corresponding to the class and make a pull request.
See :ref:`doc_updating_the_class_reference` and See `doc_updating_the_class_reference` and
:ref:`doc_class_reference_writing_guidelines` for more details. `doc_class_reference_writing_guidelines` for more details.
- **The tutorials and engine documentation and its translations.** - **The tutorials and engine documentation and its translations.**
This is the part you are reading now, which is distributed in the HTML format. This is the part you are reading now, which is distributed in the HTML format.
Its contents are generated from plain text files in the reStructured Text Its contents are generated from plain text files in the reStructured Text
(rst) format, to which you can contribute via pull requests on the (rst) format, to which you can contribute via pull requests on the
`godot-docs <https://github.com/godotengine/godot-docs>`_ GitHub repository. `godot-docs <https://github.com/godotengine/godot-docs>`_ GitHub repository.
See :ref:`doc_contributing_to_the_documentation` for more details. See `doc_contributing_to_the_documentation` for more details.
Contributing translations Contributing translations
------------------------- -------------------------
@ -216,4 +216,4 @@ To make Godot accessible to everyone, including users who may prefer resources
in their native language instead of English, our community helps translate both in their native language instead of English, our community helps translate both
the Godot editor and its documentation in many languages. the Godot editor and its documentation in many languages.
See :ref:`doc_editor_and_docs_localization` for more details. See `doc_editor_and_docs_localization` for more details.

View File

@ -8,7 +8,7 @@ Compiling for Android
.. seealso:: .. seealso::
This page describes how to compile Android export template binaries from source. This page describes how to compile Android export template binaries from source.
If you're looking to export your project to Android instead, read :ref:`doc_exporting_for_android`. If you're looking to export your project to Android instead, read `doc_exporting_for_android`.
Note Note
---- ----
@ -18,7 +18,7 @@ enough. Compiling the Android APK manually is mostly useful for custom
builds or custom packages for the deployer. builds or custom packages for the deployer.
Also, you still need to follow the steps mentioned in the Also, you still need to follow the steps mentioned in the
:ref:`doc_exporting_for_android` tutorial before attempting to build `doc_exporting_for_android` tutorial before attempting to build
a custom export template. a custom export template.
Requirements Requirements
@ -41,10 +41,10 @@ For compiling under Windows, Linux or macOS, the following is required:
- You can download a build from `ojdkbuild <https://github.com/ojdkbuild/ojdkbuild>`_. - You can download a build from `ojdkbuild <https://github.com/ojdkbuild/ojdkbuild>`_.
.. seealso:: To get the Godot source code for compiling, see .. seealso:: To get the Godot source code for compiling, see
:ref:`doc_getting_source`. `doc_getting_source`.
For a general overview of SCons usage for Godot, see For a general overview of SCons usage for Godot, see
:ref:`doc_introduction_to_the_buildsystem`. `doc_introduction_to_the_buildsystem`.
.. _doc_android_setting_up_the_buildsystem: .. _doc_android_setting_up_the_buildsystem:
@ -209,7 +209,7 @@ Platform doesn't appear in SCons
Double-check that you've set the ``ANDROID_SDK_ROOT`` Double-check that you've set the ``ANDROID_SDK_ROOT``
environment variable. This is required for the platform to appear in SCons' environment variable. This is required for the platform to appear in SCons'
list of detected platforms. list of detected platforms.
See :ref:`Setting up the buildsystem <doc_android_setting_up_the_buildsystem>` See `Setting up the buildsystem <doc_android_setting_up_the_buildsystem>`
for more information. for more information.
Application not installed Application not installed

View File

@ -8,7 +8,7 @@ Compiling for iOS
.. seealso:: .. seealso::
This page describes how to compile iOS export template binaries from source. This page describes how to compile iOS export template binaries from source.
If you're looking to export your project to iOS instead, read :ref:`doc_exporting_for_ios`. If you're looking to export your project to iOS instead, read `doc_exporting_for_ios`.
Requirements Requirements
------------ ------------
@ -19,10 +19,10 @@ Requirements
- Xcode 10.0 (or later) with the iOS (10.0) SDK and the command line tools. - Xcode 10.0 (or later) with the iOS (10.0) SDK and the command line tools.
.. seealso:: To get the Godot source code for compiling, see .. seealso:: To get the Godot source code for compiling, see
:ref:`doc_getting_source`. `doc_getting_source`.
For a general overview of SCons usage for Godot, see For a general overview of SCons usage for Godot, see
:ref:`doc_introduction_to_the_buildsystem`. `doc_introduction_to_the_buildsystem`.
Compiling Compiling
--------- ---------
@ -79,7 +79,7 @@ Run
--- ---
To run on a device or simulator, follow these instructions: To run on a device or simulator, follow these instructions:
:ref:`doc_exporting_for_ios`. `doc_exporting_for_ios`.
Replace or add your executable to the Xcode project, and change the Replace or add your executable to the Xcode project, and change the
"executable name" property on Info.plist accordingly if you use an "executable name" property on Info.plist accordingly if you use an

View File

@ -8,7 +8,7 @@ Compiling for macOS
.. note:: .. note::
This page describes how to compile macOS editor and export template binaries from source. This page describes how to compile macOS editor and export template binaries from source.
If you're looking to export your project to macOS instead, read :ref:`doc_exporting_for_macos`. If you're looking to export your project to macOS instead, read `doc_exporting_for_macos`.
Requirements Requirements
------------ ------------
@ -36,10 +36,10 @@ For compiling under macOS, the following is required:
sudo port install scons yasm sudo port install scons yasm
.. seealso:: To get the Godot source code for compiling, see .. seealso:: To get the Godot source code for compiling, see
:ref:`doc_getting_source`. `doc_getting_source`.
For a general overview of SCons usage for Godot, see For a general overview of SCons usage for Godot, see
:ref:`doc_introduction_to_the_buildsystem`. `doc_introduction_to_the_buildsystem`.
Compiling Compiling
--------- ---------
@ -65,7 +65,7 @@ manager.
.. note:: If you want to use separate editor settings for your own Godot builds .. note:: If you want to use separate editor settings for your own Godot builds
and official releases, you can enable and official releases, you can enable
:ref:`doc_data_paths_self_contained_mode` by creating a file called `doc_data_paths_self_contained_mode` by creating a file called
``._sc_`` or ``_sc_`` in the ``bin/`` folder. ``._sc_`` or ``_sc_`` in the ``bin/`` folder.
To create an ``.app`` bundle like in the official builds, you need to use the To create an ``.app`` bundle like in the official builds, you need to use the
@ -86,7 +86,7 @@ projects in an automated manner, use::
scons platform=server tools=yes target=release_debug --jobs=$(sysctl -n hw.logicalcpu) scons platform=server tools=yes target=release_debug --jobs=$(sysctl -n hw.logicalcpu)
To compile a debug *server* build which can be used with To compile a debug *server* build which can be used with
:ref:`remote debugging tools <doc_command_line_tutorial>`, use:: `remote debugging tools <doc_command_line_tutorial>`, use::
scons platform=server tools=no target=release_debug --jobs=$(sysctl -n hw.logicalcpu) scons platform=server tools=no target=release_debug --jobs=$(sysctl -n hw.logicalcpu)

View File

@ -8,13 +8,13 @@ Compiling for Universal Windows Platform
.. seealso:: .. seealso::
This page describes how to compile UWP export template binaries from source. This page describes how to compile UWP export template binaries from source.
If you're looking to export your project to UWP instead, read :ref:`doc_exporting_for_uwp`. If you're looking to export your project to UWP instead, read `doc_exporting_for_uwp`.
Requirements Requirements
------------ ------------
- SCons 3.0+ (see :ref:`doc_compiling_for_windows` for more details). - SCons 3.0+ (see `doc_compiling_for_windows` for more details).
- Visual Studio 2017 or later. See :ref:`doc_compiling_for_windows` about the - Visual Studio 2017 or later. See `doc_compiling_for_windows` about the
caveats of installing it and the various prompts. caveats of installing it and the various prompts.
- Windows 10 SDK (can be selected in Visual Studio installation). - Windows 10 SDK (can be selected in Visual Studio installation).
- `ANGLE source <https://github.com/Microsoft/angle>`__. Use the - `ANGLE source <https://github.com/Microsoft/angle>`__. Use the
@ -32,16 +32,16 @@ Requirements
the new build instructions. the new build instructions.
.. seealso:: To get the Godot source code for compiling, see .. seealso:: To get the Godot source code for compiling, see
:ref:`doc_getting_source`. `doc_getting_source`.
For a general overview of SCons usage for Godot, see For a general overview of SCons usage for Godot, see
:ref:`doc_introduction_to_the_buildsystem`. `doc_introduction_to_the_buildsystem`.
Compiling Compiling
--------- ---------
You need to open a proper Visual Studio prompt for the target architecture You need to open a proper Visual Studio prompt for the target architecture
you want to build. Check :ref:`doc_compiling_for_windows` to see how these you want to build. Check `doc_compiling_for_windows` to see how these
prompts work. prompts work.
There are three target architectures for UWP: x86 (32-bits), x64 (64-bits) There are three target architectures for UWP: x86 (32-bits), x64 (64-bits)

View File

@ -6,7 +6,7 @@ Compiling for the Web
.. seealso:: .. seealso::
This page describes how to compile HTML5 editor and export template binaries from source. This page describes how to compile HTML5 editor and export template binaries from source.
If you're looking to export your project to HTML5 instead, read :ref:`doc_exporting_for_web`. If you're looking to export your project to HTML5 instead, read `doc_exporting_for_web`.
.. highlight:: shell .. highlight:: shell
@ -20,10 +20,10 @@ To compile export templates for the Web, the following is required:
- `SCons 3.0+ <https://www.scons.org>`__ build system. - `SCons 3.0+ <https://www.scons.org>`__ build system.
.. seealso:: To get the Godot source code for compiling, see .. seealso:: To get the Godot source code for compiling, see
:ref:`doc_getting_source`. `doc_getting_source`.
For a general overview of SCons usage for Godot, see For a general overview of SCons usage for Godot, see
:ref:`doc_introduction_to_the_buildsystem`. `doc_introduction_to_the_buildsystem`.
Building export templates Building export templates
------------------------- -------------------------
@ -39,7 +39,7 @@ either ``release`` for a release build or ``release_debug`` for a debug build::
scons platform=javascript tools=no target=release scons platform=javascript tools=no target=release
scons platform=javascript tools=no target=release_debug scons platform=javascript tools=no target=release_debug
By default, the :ref:`JavaScript singleton <doc_javascript_eval>` will be built By default, the `JavaScript singleton <doc_javascript_eval>` will be built
into the engine. Official export templates also have the JavaScript singleton into the engine. Official export templates also have the JavaScript singleton
enabled. Since ``eval()`` calls can be a security concern, the enabled. Since ``eval()`` calls can be a security concern, the
``javascript_eval`` option can be used to build without the singleton:: ``javascript_eval`` option can be used to build without the singleton::
@ -66,7 +66,7 @@ Threads and GDNative
The default export templates do not include threads and GDNative support for The default export templates do not include threads and GDNative support for
performance and compatibility reasons. See the performance and compatibility reasons. See the
:ref:`export page <doc_javascript_export_options>` for more info. `export page <doc_javascript_export_options>` for more info.
You can build the export templates using the option ``threads_enabled=yes`` or You can build the export templates using the option ``threads_enabled=yes`` or
``gdnative_enabled=yes`` to enable threads or GDNative support:: ``gdnative_enabled=yes`` to enable threads or GDNative support::
@ -105,5 +105,5 @@ Once finished, the resulting file will be placed in the ``bin`` subdirectory.
Its name will be ``godot.javascript.opt.tools.threads.zip``. You can upload the Its name will be ``godot.javascript.opt.tools.threads.zip``. You can upload the
zip content to your web server and visit it with your browser to use the editor. zip content to your web server and visit it with your browser to use the editor.
Refer to the :ref:`export page <doc_javascript_export_options>` for the web Refer to the `export page <doc_javascript_export_options>` for the web
server requirements. server requirements.

View File

@ -8,7 +8,7 @@ Compiling for Windows
.. seealso:: .. seealso::
This page describes how to compile Windows editor and export template binaries from source. This page describes how to compile Windows editor and export template binaries from source.
If you're looking to export your project to Windows instead, read :ref:`doc_exporting_for_windows`. If you're looking to export your project to Windows instead, read `doc_exporting_for_windows`.
Requirements Requirements
------------ ------------
@ -41,10 +41,10 @@ For compiling under Windows, the following is required:
`pip3 install scons` in its shell. `pip3 install scons` in its shell.
.. seealso:: To get the Godot source code for compiling, see .. seealso:: To get the Godot source code for compiling, see
:ref:`doc_getting_source`. `doc_getting_source`.
For a general overview of SCons usage for Godot, see For a general overview of SCons usage for Godot, see
:ref:`doc_introduction_to_the_buildsystem`. `doc_introduction_to_the_buildsystem`.
Setting up SCons Setting up SCons
---------------- ----------------
@ -91,7 +91,7 @@ a **Repair** option, which won't let you install C++ tools.
Downloading Godot's source Downloading Godot's source
-------------------------- --------------------------
Refer to :ref:`doc_getting_source` for detailed instructions. Refer to `doc_getting_source` for detailed instructions.
The tutorial will assume from now on that you placed the source code in The tutorial will assume from now on that you placed the source code in
``C:\godot``. ``C:\godot``.
@ -165,7 +165,7 @@ dependencies. Running it will bring up the Project Manager.
.. note:: If you want to use separate editor settings for your own Godot builds .. note:: If you want to use separate editor settings for your own Godot builds
and official releases, you can enable and official releases, you can enable
:ref:`doc_data_paths_self_contained_mode` by creating a file called `doc_data_paths_self_contained_mode` by creating a file called
``._sc_`` or ``_sc_`` in the ``bin/`` folder. ``._sc_`` or ``_sc_`` in the ``bin/`` folder.
Development in Visual Studio Development in Visual Studio
@ -186,7 +186,7 @@ the ``vsproj=yes`` parameter, like this::
You will be able to open Godot's source in a Visual Studio solution now, You will be able to open Godot's source in a Visual Studio solution now,
and able to build Godot using Visual Studio's **Build** button. and able to build Godot using Visual Studio's **Build** button.
.. seealso:: See :ref:`doc_configuring_an_ide_vs` for further details. .. seealso:: See `doc_configuring_an_ide_vs` for further details.
Cross-compiling for Windows from other operating systems Cross-compiling for Windows from other operating systems
-------------------------------------------------------- --------------------------------------------------------

View File

@ -8,7 +8,7 @@ Compiling for X11 (Linux, \*BSD)
.. seealso:: .. seealso::
This page describes how to compile Linux editor and export template binaries from source. This page describes how to compile Linux editor and export template binaries from source.
If you're looking to export your project to Linux instead, read :ref:`doc_exporting_for_linux`. If you're looking to export your project to Linux instead, read `doc_exporting_for_linux`.
Requirements Requirements
------------ ------------
@ -32,10 +32,10 @@ required:
- *Optional* - yasm (for WebM SIMD optimizations). - *Optional* - yasm (for WebM SIMD optimizations).
.. seealso:: To get the Godot source code for compiling, see .. seealso:: To get the Godot source code for compiling, see
:ref:`doc_getting_source`. `doc_getting_source`.
For a general overview of SCons usage for Godot, see For a general overview of SCons usage for Godot, see
:ref:`doc_introduction_to_the_buildsystem`. `doc_introduction_to_the_buildsystem`.
Distro-specific one-liners Distro-specific one-liners
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -139,7 +139,7 @@ manager.
.. note:: If you want to use separate editor settings for your own Godot builds .. note:: If you want to use separate editor settings for your own Godot builds
and official releases, you can enable and official releases, you can enable
:ref:`doc_data_paths_self_contained_mode` by creating a file called `doc_data_paths_self_contained_mode` by creating a file called
``._sc_`` or ``_sc_`` in the ``bin/`` folder. ``._sc_`` or ``_sc_`` in the ``bin/`` folder.
Compiling a headless/server build Compiling a headless/server build
@ -151,7 +151,7 @@ projects in an automated manner, use::
scons -j8 platform=server tools=yes target=release_debug scons -j8 platform=server tools=yes target=release_debug
To compile a debug *server* build which can be used with To compile a debug *server* build which can be used with
:ref:`remote debugging tools <doc_command_line_tutorial>`, use:: `remote debugging tools <doc_command_line_tutorial>`, use::
scons -j8 platform=server tools=no target=release_debug scons -j8 platform=server tools=no target=release_debug

View File

@ -118,7 +118,7 @@ the following files in the ``bin`` directory:
for the editor and for export templates. This directory is important for for the editor and for export templates. This directory is important for
proper functioning and must be distributed together with Godot. proper functioning and must be distributed together with Godot.
More details about this directory in More details about this directory in
:ref:`Data directory<compiling_with_mono_data_directory>`. `Data directory<compiling_with_mono_data_directory>`.
Examples Examples
-------- --------
@ -249,7 +249,7 @@ to the Gradle project.
Once you've built Mono, you can proceed to build Godot with the instructions Once you've built Mono, you can proceed to build Godot with the instructions
described in this page and the described in this page and the
:ref:`Compiling for Android<doc_compiling_for_android>` page. `Compiling for Android<doc_compiling_for_android>` page.
Make sure to let SCons know about the location of the Mono runtime you've just built, e.g.: Make sure to let SCons know about the location of the Mono runtime you've just built, e.g.:
``scons [...] mono_prefix="$HOME/mono-installs/android-armeabi-v7a-release"`` ``scons [...] mono_prefix="$HOME/mono-installs/android-armeabi-v7a-release"``
(This path may be different on your system). (This path may be different on your system).
@ -259,7 +259,7 @@ Targeting iOS
Once you've built Mono, you can proceed to build Godot with the instructions Once you've built Mono, you can proceed to build Godot with the instructions
described in this page and the described in this page and the
:ref:`Compiling for iOS<doc_compiling_for_ios>` page. `Compiling for iOS<doc_compiling_for_ios>` page.
Make sure to let SCons know about the location of the Mono runtime you've just built, e.g.: Make sure to let SCons know about the location of the Mono runtime you've just built, e.g.:
``scons [...] mono_prefix="$HOME/mono-installs/ios-arm64-release"`` ``scons [...] mono_prefix="$HOME/mono-installs/ios-arm64-release"``
(This path may be different on your system). (This path may be different on your system).
@ -308,7 +308,7 @@ Building for WebAssembly currently involves the same process regardless of wheth
Once you've built Mono, you can proceed to build Godot with the instructions Once you've built Mono, you can proceed to build Godot with the instructions
described in this page and the described in this page and the
:ref:`Compiling for the Web<doc_compiling_for_web>` page. `Compiling for the Web<doc_compiling_for_web>` page.
Make sure to let SCons know about the location of the Mono runtime you've just built, e.g.: Make sure to let SCons know about the location of the Mono runtime you've just built, e.g.:
``scons [...] mono_prefix="$HOME/mono-installs/wasm-runtime-release"`` ``scons [...] mono_prefix="$HOME/mono-installs/wasm-runtime-release"``
(This path may be different on your system). (This path may be different on your system).

View File

@ -8,7 +8,7 @@ Getting the source
Downloading the Godot source code Downloading the Godot source code
--------------------------------- ---------------------------------
Before :ref:`getting into the SCons build system <doc_introduction_to_the_buildsystem>` Before `getting into the SCons build system <doc_introduction_to_the_buildsystem>`
and compiling Godot, you need to actually download the Godot source code. and compiling Godot, you need to actually download the Godot source code.
The source code is available on `GitHub <https://github.com/godotengine/godot>`__ The source code is available on `GitHub <https://github.com/godotengine/godot>`__
@ -16,7 +16,7 @@ and while you can manually download it via the website, in general you want to
do it via the ``git`` version control system. do it via the ``git`` version control system.
If you are compiling in order to make contributions or pull requests, you should If you are compiling in order to make contributions or pull requests, you should
follow the instructions from the :ref:`Pull Request workflow <doc_pr_workflow>`. follow the instructions from the `Pull Request workflow <doc_pr_workflow>`.
If you don't know much about ``git`` yet, there are a great number of If you don't know much about ``git`` yet, there are a great number of
`tutorials <https://git-scm.com/book>`__ available on various websites. `tutorials <https://git-scm.com/book>`__ available on various websites.
@ -51,4 +51,4 @@ after the ``--branch`` (or just ``-b``) argument::
There are also generally branches besides ``master`` for each major version. There are also generally branches besides ``master`` for each major version.
After downloading the Godot source code, After downloading the Godot source code,
you can :ref:`continue to compiling Godot <doc_introduction_to_the_buildsystem>`. you can `continue to compiling Godot <doc_introduction_to_the_buildsystem>`.

View File

@ -39,10 +39,10 @@ if you are planning to build Godot yourself.
Setup Setup
----- -----
Please refer to the documentation for :ref:`doc_compiling_for_android`, Please refer to the documentation for `doc_compiling_for_android`,
:ref:`doc_compiling_for_ios`, :ref:`doc_compiling_for_osx`, `doc_compiling_for_ios`, `doc_compiling_for_osx`,
:ref:`doc_compiling_for_uwp`, :ref:`doc_compiling_for_web`, `doc_compiling_for_uwp`, `doc_compiling_for_web`,
:ref:`doc_compiling_for_windows` and :ref:`doc_compiling_for_x11`. `doc_compiling_for_windows` and `doc_compiling_for_x11`.
Note that for **Windows/Visual Studio**, you need to use ``x86_x64 Cross Tools Note that for **Windows/Visual Studio**, you need to use ``x86_x64 Cross Tools
Command Prompt for VS 2017`` or similar, depending on your install, instead of Command Prompt for VS 2017`` or similar, depending on your install, instead of
@ -210,7 +210,7 @@ directory paths containing such modules:
.. seealso:: .. seealso::
:ref:`doc_custom_modules_in_c++` `doc_custom_modules_in_c++`
Cleaning generated files Cleaning generated files
------------------------ ------------------------
@ -255,7 +255,7 @@ source to initialize any SCons build options passed via the command line:
extra_suffix = "game_title" extra_suffix = "game_title"
You can also disable some of the builtin modules before compiling, saving some You can also disable some of the builtin modules before compiling, saving some
time it takes to build the engine. See :ref:`doc_optimizing_for_size` page for more details. time it takes to build the engine. See `doc_optimizing_for_size` page for more details.
.. seealso:: .. seealso::

View File

@ -40,7 +40,7 @@ On Windows, ``strip.exe`` is included in most MinGW toolchain setups.
This will reduce the size of compiled binaries by a factor between 5× and 10×. This will reduce the size of compiled binaries by a factor between 5× and 10×.
The downside is that crash backtraces will no longer provide accurate information The downside is that crash backtraces will no longer provide accurate information
(which is useful for troubleshooting the cause of a crash). (which is useful for troubleshooting the cause of a crash).
:ref:`C++ profilers <doc_using_cpp_profilers>` will also no longer be able to display `C++ profilers <doc_using_cpp_profilers>` will also no longer be able to display
function names (this does not affect the built-in GDScript profiler). function names (this does not affect the built-in GDScript profiler).
.. note:: .. note::
@ -215,4 +215,4 @@ following:
.. seealso:: .. seealso::
:ref:`doc_overriding_build_options`. `doc_overriding_build_options`.

View File

@ -6,7 +6,7 @@ Binding to external libraries
Modules Modules
------- -------
The Summator example in :ref:`doc_custom_modules_in_c++` is great for small, The Summator example in `doc_custom_modules_in_c++` is great for small,
custom modules, but what if you want to use a larger, external library? custom modules, but what if you want to use a larger, external library?
Let's look at an example using `Festival <http://www.cstr.ed.ac.uk/projects/festival/>`_, Let's look at an example using `Festival <http://www.cstr.ed.ac.uk/projects/festival/>`_,
a speech synthesis (text-to-speech) library written in C++. a speech synthesis (text-to-speech) library written in C++.

View File

@ -34,7 +34,7 @@ described below.
Format a string Format a string
--------------- ---------------
The ``vformat()`` function returns a formatted :ref:`class_String`. It behaves The ``vformat()`` function returns a formatted `class_String`. It behaves
in a way similar to C's ``sprintf()``: in a way similar to C's ``sprintf()``:
.. code-block:: cpp .. code-block:: cpp

View File

@ -22,7 +22,7 @@ Importing the project
- Navigate to ``<Godot root directory>/platform/android/java`` and select the ``settings.gradle`` file. - Navigate to ``<Godot root directory>/platform/android/java`` and select the ``settings.gradle`` file.
- Android Studio will import and index the project. - Android Studio will import and index the project.
- To build the project, follow the :ref:`compiling instructions <toc-devel-compiling>`. - To build the project, follow the `compiling instructions <toc-devel-compiling>`.
If you run into any issues, ask for help in one of If you run into any issues, ask for help in one of
`Godot's community channels <https://godotengine.org/community>`__. `Godot's community channels <https://godotengine.org/community>`__.

View File

@ -11,7 +11,7 @@ Importing the project
CLion requires a ``CMakeLists.txt`` file as a project file, which is problematic CLion requires a ``CMakeLists.txt`` file as a project file, which is problematic
for Godot because it uses the SCons buildsystem instead of CMake. However, for Godot because it uses the SCons buildsystem instead of CMake. However,
there is a ``CMakeLists.txt`` configuration for :ref:`Android Studio <doc_configuring_an_ide_android_studio>` there is a ``CMakeLists.txt`` configuration for `Android Studio <doc_configuring_an_ide_android_studio>`
which can also be used by CLion. which can also be used by CLion.
- From the CLion's welcome window choose the option to import an existing - From the CLion's welcome window choose the option to import an existing

View File

@ -61,7 +61,7 @@ The next step is to change the build options. Right-click on the new project and
:figclass: figure-w480 :figclass: figure-w480
:align: center :align: center
Select the **"Make" commands** tab and remove all the existing commands for all the build targets. For each build target enter the **SCons** command for creating the desired build in the **Build project/target** field. The minimum is ``scons``. For details on the **SCons** build options, see :ref:`doc_introduction_to_the_buildsystem`. It's also useful to add the ``scons --clean`` command in the **Clean project/target** field to the project's default commmands. Select the **"Make" commands** tab and remove all the existing commands for all the build targets. For each build target enter the **SCons** command for creating the desired build in the **Build project/target** field. The minimum is ``scons``. For details on the **SCons** build options, see `doc_introduction_to_the_buildsystem`. It's also useful to add the ``scons --clean`` command in the **Clean project/target** field to the project's default commmands.
If you're using Windows, all the commands need to be preceded with ``cmd /c`` to iniitalize the command interpreter. If you're using Windows, all the commands need to be preceded with ``cmd /c`` to iniitalize the command interpreter.
@ -114,7 +114,7 @@ It should automatically select the project folder; so simply click **Open**. By
Code style configuration Code style configuration
------------------------ ------------------------
Before editing any files, remember that all code needs to comply with the :ref:`doc_code_style_guidelines`. One important difference with Godot is the use of tabs for indents. Therefore, the key default editor setting that needs to be changed in Code::Blocks is to enable tabs for indents. This setting can be found by selecting **Settings > Editor**. Before editing any files, remember that all code needs to comply with the `doc_code_style_guidelines`. One important difference with Godot is the use of tabs for indents. Therefore, the key default editor setting that needs to be changed in Code::Blocks is to enable tabs for indents. This setting can be found by selecting **Settings > Editor**.
.. figure:: img/code_blocks_update_editor_settings.png .. figure:: img/code_blocks_update_editor_settings.png
:figclass: figure-w480 :figclass: figure-w480

View File

@ -2,7 +2,7 @@ Configuring an IDE
================== ==================
We assume that you have already `cloned <https://github.com/godotengine/godot>`_ We assume that you have already `cloned <https://github.com/godotengine/godot>`_
and :ref:`compiled <toc-devel-compiling>` Godot. and `compiled <toc-devel-compiling>` Godot.
You can easily develop Godot with any text editor and by invoking ``scons`` You can easily develop Godot with any text editor and by invoking ``scons``
on the command line, but if you want to work with an IDE (Integrated on the command line, but if you want to work with an IDE (Integrated

View File

@ -56,7 +56,7 @@ Importing the project
+-----------------+------------------------------------------------------------------------------+ +-----------------+------------------------------------------------------------------------------+
| Executable | **scons** | | Executable | **scons** |
+-----------------+------------------------------------------------------------------------------+ +-----------------+------------------------------------------------------------------------------+
| Arguments | See :ref:`doc_introduction_to_the_buildsystem` for a full list of arguments. | | Arguments | See `doc_introduction_to_the_buildsystem` for a full list of arguments. |
+-----------------+------------------------------------------------------------------------------+ +-----------------+------------------------------------------------------------------------------+
.. figure:: img/kdevelop_buildconfig.png .. figure:: img/kdevelop_buildconfig.png

View File

@ -58,7 +58,7 @@ Importing the project
+-----------+------------------------------------------------------------------------------+ +-----------+------------------------------------------------------------------------------+
| Command | **scons** | | Command | **scons** |
+-----------+------------------------------------------------------------------------------+ +-----------+------------------------------------------------------------------------------+
| Arguments | See :ref:`doc_introduction_to_the_buildsystem` for a full list of arguments. | | Arguments | See `doc_introduction_to_the_buildsystem` for a full list of arguments. |
+-----------+------------------------------------------------------------------------------+ +-----------+------------------------------------------------------------------------------+
.. figure:: img/qtcreator-set-scons-command.png .. figure:: img/qtcreator-set-scons-command.png
@ -85,12 +85,12 @@ Debugging the project
:align: center :align: center
To learn more about command line arguments, refer to the To learn more about command line arguments, refer to the
:ref:`command line tutorial <doc_command_line_tutorial>`. `command line tutorial <doc_command_line_tutorial>`.
Code style configuration Code style configuration
------------------------ ------------------------
Developers must follow the project's :ref:`code style <doc_code_style_guidelines>` Developers must follow the project's `code style <doc_code_style_guidelines>`
and the IDE should help them follow it. By default, Qt Creator uses spaces and the IDE should help them follow it. By default, Qt Creator uses spaces
for indentation which doesn't match the Godot code style guidelines. You can for indentation which doesn't match the Godot code style guidelines. You can
change this behavior by changing the **Code Style** in **Tools > Options > C++**. change this behavior by changing the **Code Style** in **Tools > Options > C++**.

View File

@ -53,7 +53,7 @@ project manager opens a project, the initial process is terminated and the debug
:align: center :align: center
To learn more about command line arguments, refer to the To learn more about command line arguments, refer to the
:ref:`command line tutorial <doc_command_line_tutorial>`. `command line tutorial <doc_command_line_tutorial>`.
Even if you start the project without a debugger attached it can still be connected to the running Even if you start the project without a debugger attached it can still be connected to the running
process using **Debug > Attach to Process...** menu. process using **Debug > Attach to Process...** menu.

View File

@ -4,7 +4,7 @@ Visual Studio Code
================== ==================
`Visual Studio Code <https://code.visualstudio.com>`_ is a free cross-platform code editor `Visual Studio Code <https://code.visualstudio.com>`_ is a free cross-platform code editor
by `Microsoft <https://microsoft.com>`_ (not to be confused with :ref:`doc_configuring_an_ide_vs`). by `Microsoft <https://microsoft.com>`_ (not to be confused with `doc_configuring_an_ide_vs`).
Importing the project Importing the project
--------------------- ---------------------
@ -73,7 +73,7 @@ js Windows
An example of a filled out ``tasks.json``. An example of a filled out ``tasks.json``.
Arguments can be different based on your own setup and needs. See Arguments can be different based on your own setup and needs. See
:ref:`doc_introduction_to_the_buildsystem` for a full list of arguments. `doc_introduction_to_the_buildsystem` for a full list of arguments.
Debugging the project Debugging the project
--------------------- ---------------------
@ -174,7 +174,7 @@ js Windows
If you encounter issues with lldb, you may consider using gdb (see the X11_gdb configuration). If you encounter issues with lldb, you may consider using gdb (see the X11_gdb configuration).
Do note that lldb may work better with llvm-based builds. See :ref:`doc_compiling_for_x11` for further information. Do note that lldb may work better with llvm-based builds. See `doc_compiling_for_x11` for further information.
The name under ``program`` depends on your build configuration, The name under ``program`` depends on your build configuration,
e.g. ``godot.x11.tools.64`` for 64-bit X11 platform with ``tools`` enabled. e.g. ``godot.x11.tools.64`` for 64-bit X11 platform with ``tools`` enabled.

View File

@ -21,7 +21,7 @@ Importing the project
+------------+------------------------------------------------------------------------------+ +------------+------------------------------------------------------------------------------+
| Build Tool | A full path to the **scons** executable, e.g. **/usr/local/bin/scons** | | Build Tool | A full path to the **scons** executable, e.g. **/usr/local/bin/scons** |
+------------+------------------------------------------------------------------------------+ +------------+------------------------------------------------------------------------------+
| Arguments | See :ref:`doc_introduction_to_the_buildsystem` for a full list of arguments. | | Arguments | See `doc_introduction_to_the_buildsystem` for a full list of arguments. |
+------------+------------------------------------------------------------------------------+ +------------+------------------------------------------------------------------------------+
| Directory | A full path to the Godot root folder | | Directory | A full path to the Godot root folder |
+------------+------------------------------------------------------------------------------+ +------------+------------------------------------------------------------------------------+

View File

@ -17,7 +17,7 @@ its own internal custom AudioStreamPlayback which translates
AudioStream into PCM data. AudioStream into PCM data.
This guide assumes the reader knows how to create C++ modules. If not, refer to this guide This guide assumes the reader knows how to create C++ modules. If not, refer to this guide
:ref:`doc_custom_modules_in_c++`. `doc_custom_modules_in_c++`.
References: References:
~~~~~~~~~~~ ~~~~~~~~~~~

View File

@ -13,7 +13,7 @@ engine and other modules. In addition, the server claims ownership for
its RID allocations. its RID allocations.
This guide assumes the reader knows how to create C++ modules and Godot This guide assumes the reader knows how to create C++ modules and Godot
data types. If not, refer to :ref:`doc_custom_modules_in_c++`. data types. If not, refer to `doc_custom_modules_in_c++`.
References References
~~~~~~~~~~~ ~~~~~~~~~~~
@ -315,7 +315,7 @@ object-oriented C code.
References References
~~~~~~~~~~~ ~~~~~~~~~~~
- :ref:`RID<class_rid>` - `RID<class_rid>`
- `core/rid.h <https://github.com/godotengine/godot/blob/3.x/core/rid.h>`__ - `core/rid.h <https://github.com/godotengine/godot/blob/3.x/core/rid.h>`__
Registering the class in GDScript Registering the class in GDScript

View File

@ -34,7 +34,7 @@ instead. Adding C++ modules can be useful in the following scenarios:
Creating a new module Creating a new module
--------------------- ---------------------
Before creating a module, make sure to :ref:`download the source code of Godot Before creating a module, make sure to `download the source code of Godot
and compile it <toc-devel-compiling>`. and compile it <toc-devel-compiling>`.
To create a new module, the first step is creating a directory inside To create a new module, the first step is creating a directory inside
@ -243,7 +243,7 @@ The output will be ``60``.
.. seealso:: The previous Summator example is great for small, custom modules, .. seealso:: The previous Summator example is great for small, custom modules,
but what if you want to use a larger, external library? Refer to but what if you want to use a larger, external library? Refer to
:ref:`doc_binding_to_external_libraries` for details about binding to `doc_binding_to_external_libraries` for details about binding to
external libraries. external libraries.
.. warning:: If your module is meant to be accessed from the running project .. warning:: If your module is meant to be accessed from the running project
@ -251,7 +251,7 @@ The output will be ``60``.
template you plan to use, then specify the path to the custom template you plan to use, then specify the path to the custom
template in each export preset. Otherwise, you'll get errors when template in each export preset. Otherwise, you'll get errors when
running the project as the module isn't compiled in the export running the project as the module isn't compiled in the export
template. See the :ref:`Compiling <toc-devel-compiling>` pages template. See the `Compiling <toc-devel-compiling>` pages
for more information. for more information.
Compiling a module externally Compiling a module externally
@ -303,7 +303,7 @@ and compile them accordingly, including our "summator" module.
.. seealso:: .. seealso::
:ref:`Introduction to the buildsystem - Custom modules build option <doc_buildsystem_custom_modules>`. `Introduction to the buildsystem - Custom modules build option <doc_buildsystem_custom_modules>`.
Improving the build system for development Improving the build system for development
------------------------------------------ ------------------------------------------
@ -312,7 +312,7 @@ Improving the build system for development
This shared library support is not designed to support distributing a module This shared library support is not designed to support distributing a module
to other users without recompiling the engine. For that purpose, use to other users without recompiling the engine. For that purpose, use
:ref:`GDNative <doc_what_is_gdnative>` instead. `GDNative <doc_what_is_gdnative>` instead.
So far, we defined a clean SCsub that allows us to add the sources So far, we defined a clean SCsub that allows us to add the sources
of our new module as part of the Godot binary. of our new module as part of the Godot binary.
@ -494,7 +494,7 @@ 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 that it contains a ``Summator.xml`` file, or any other classes, that you referenced
in your ``get_doc_classes`` function. in your ``get_doc_classes`` function.
Edit the file(s) following :ref:`doc_updating_the_class_reference` and recompile the engine. Edit the file(s) following `doc_updating_the_class_reference` and recompile the engine.
Once the compilation process is finished, the docs will become accessible within Once the compilation process is finished, the docs will become accessible within
the engine's built-in documentation system. the engine's built-in documentation system.
@ -525,7 +525,7 @@ Similarly to how you can write self-contained documentation within a module,
you can also create your own custom icons for classes to appear in the editor. you can also create your own custom icons for classes to appear in the editor.
For the actual process of creating editor icons to be integrated within the engine, For the actual process of creating editor icons to be integrated within the engine,
please refer to :ref:`doc_editor_icons` first. please refer to `doc_editor_icons` first.
Once you've created your icon(s), proceed with the following steps: Once you've created your icon(s), proceed with the following steps:
@ -557,10 +557,10 @@ Remember to:
But this is not all, depending what you do, you will be greeted with But this is not all, depending what you do, you will be greeted with
some (hopefully positive) surprises. some (hopefully positive) surprises.
- If you inherit from :ref:`class_Node` (or any derived node type, such as - If you inherit from `class_Node` (or any derived node type, such as
Sprite), your new class will appear in the editor, in the inheritance Sprite), your new class will appear in the editor, in the inheritance
tree in the "Add Node" dialog. tree in the "Add Node" dialog.
- If you inherit from :ref:`class_Resource`, it will appear in the resource - If you inherit from `class_Resource`, it will appear in the resource
list, and all the exposed properties can be serialized when list, and all the exposed properties can be serialized when
saved/loaded. saved/loaded.
- By this same logic, you can extend the Editor and almost any area of - By this same logic, you can extend the Editor and almost any area of

View File

@ -12,12 +12,12 @@ path again, the previous loaded Resource will be referenced. Naturally,
loaded resources must be stateless. loaded resources must be stateless.
This guide assumes the reader knows how to create C++ modules and Godot This guide assumes the reader knows how to create C++ modules and Godot
data types. If not, refer to this guide :ref:`doc_custom_modules_in_c++`. data types. If not, refer to this guide `doc_custom_modules_in_c++`.
References References
~~~~~~~~~~ ~~~~~~~~~~
- :ref:`ResourceLoader<class_resourceloader>` - `ResourceLoader<class_resourceloader>`
- `core/io/resource_loader.cpp <https://github.com/godotengine/godot/blob/master/core/io/resource_loader.cpp>`_ - `core/io/resource_loader.cpp <https://github.com/godotengine/godot/blob/master/core/io/resource_loader.cpp>`_
What for? What for?
@ -157,7 +157,7 @@ If you'd like to be able to edit and save a resource, you can implement a
Creating custom data types Creating custom data types
-------------------------- --------------------------
Godot may not have a proper substitute within its :ref:`doc_core_types` Godot may not have a proper substitute within its `doc_core_types`
or managed resources. Godot needs a new registered data type to or managed resources. Godot needs a new registered data type to
understand additional binary formats such as machine learning models. understand additional binary formats such as machine learning models.

View File

@ -6,12 +6,12 @@ Object class
.. seealso:: .. seealso::
This page describes the C++ implementation of objects in Godot. This page describes the C++ implementation of objects in Godot.
Looking for the Object class reference? :ref:`Have a look here. <class_Object>` Looking for the Object class reference? `Have a look here. <class_Object>`
General definition General definition
------------------ ------------------
:ref:`Object <class_object>` is the base class for almost everything. Most classes in Godot `Object <class_object>` is the base class for almost everything. Most classes in Godot
inherit directly or indirectly from it. Objects provide reflection and inherit directly or indirectly from it. Objects provide reflection and
editable properties, and declaring them is a matter of using a single editable properties, and declaring them is a matter of using a single
macro like this. macro like this.
@ -240,14 +240,14 @@ Adding signals to a class is done in ``_bind_methods``, using the
Notifications Notifications
------------- -------------
All objects in Godot have a :ref:`_notification <class_Object_method__notification>` All objects in Godot have a `_notification <class_Object_method__notification>`
method that allows it to respond to engine level callbacks that may relate to it. method that allows it to respond to engine level callbacks that may relate to it.
More information can be found on the :ref:`doc_godot_notifications` page. More information can be found on the `doc_godot_notifications` page.
References References
---------- ----------
:ref:`Reference <class_reference>` inherits from Object and holds a `Reference <class_reference>` inherits from Object and holds a
reference count. It is the base for reference counted object types. reference count. It is the base for reference counted object types.
Declaring them must be done using Ref<> template. For example: Declaring them must be done using Ref<> template. For example:
@ -270,7 +270,7 @@ References:
Resources: Resources:
---------- ----------
:ref:`Resource <class_resource>` inherits from Reference, so all resources `Resource <class_resource>` inherits from Reference, so all resources
are reference counted. Resources can optionally contain a path, which are reference counted. Resources can optionally contain a path, which
reference a file on disk. This can be set with ``resource.set_path(path)``. reference a file on disk. This can be set with ``resource.set_path(path)``.
This is normally done by the resource loader though. No two different This is normally done by the resource loader though. No two different

View File

@ -57,7 +57,7 @@ The ``--quit`` option works with ``--editor``, ``--project-manager`` or
.. seealso:: .. seealso::
See :ref:`doc_command_line_tutorial` for more command line arguments See `doc_command_line_tutorial` for more command line arguments
supported by Godot. supported by Godot.
Profiler-specific instructions Profiler-specific instructions

View File

@ -86,7 +86,7 @@ make a separate pull request for your icons to be available within the editor
as they can be self-contained. as they can be self-contained.
For specific instructions on how to create module icons, refer to For specific instructions on how to create module icons, refer to
:ref:`Creating custom module icons<doc_custom_module_icons>`. `Creating custom module icons<doc_custom_module_icons>`.
Troubleshooting Troubleshooting
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~

View File

@ -28,7 +28,7 @@ Writing style
.. seealso:: .. seealso::
Try to follow the :ref:`doc_docs_writing_guidelines` in addition to the Try to follow the `doc_docs_writing_guidelines` in addition to the
guidelines outlined above. guidelines outlined above.
Button and menu texts Button and menu texts
@ -52,7 +52,7 @@ contain few items make it difficult to navigate the inspector, while missing the
benefits of using sections such as folding. benefits of using sections such as folding.
There are some valid exceptions for this, such as material features in There are some valid exceptions for this, such as material features in
:ref:`class_SpatialMaterial`. `class_SpatialMaterial`.
This advice also applies to the Project Settings and Editor Settings. This advice also applies to the Project Settings and Editor Settings.

View File

@ -9,12 +9,12 @@ On this page, you will learn:
- How to work efficiently on the Godot editor's C++ code. - How to work efficiently on the Godot editor's C++ code.
This guide is aimed at current or future engine contributors. This guide is aimed at current or future engine contributors.
To create editor plugins in GDScript, see :ref:`doc_making_plugins` instead. To create editor plugins in GDScript, see `doc_making_plugins` instead.
.. seealso:: .. seealso::
If you are new to Godot, we recommended you to read If you are new to Godot, we recommended you to read
:ref:`doc_godot_design_philosophy` before continuing. Since the Godot editor `doc_godot_design_philosophy` before continuing. Since the Godot editor
is a Godot project written in C++, much of the engine's philosophy applies is a Godot project written in C++, much of the engine's philosophy applies
to the editor. to the editor.
@ -22,7 +22,7 @@ Technical choices
----------------- -----------------
The Godot editor is drawn using Godot's renderer and The Godot editor is drawn using Godot's renderer and
:ref:`UI system <toc-gui-basics>`. It does *not* rely on a toolkit `UI system <toc-gui-basics>`. It does *not* rely on a toolkit
such as GTK or Qt. This is similar in spirit to software like Blender. such as GTK or Qt. This is similar in spirit to software like Blender.
While using toolkits makes it easier to achieve a "native" appearance, they are While using toolkits makes it easier to achieve a "native" appearance, they are
also quite heavy and their licensing is not compatible with Godot's. also quite heavy and their licensing is not compatible with Godot's.
@ -37,7 +37,7 @@ The editor's code is fully self-contained in the
of the Godot source repository. of the Godot source repository.
Some editor functionality is also implemented via Some editor functionality is also implemented via
:ref:`modules <doc_custom_modules_in_c++>`. Some of these are only enabled in `modules <doc_custom_modules_in_c++>`. Some of these are only enabled in
editor builds to decrease the binary size of export templates. See the editor builds to decrease the binary size of export templates. See the
`modules/ <https://github.com/godotengine/godot/tree/master/modules>`__ folder `modules/ <https://github.com/godotengine/godot/tree/master/modules>`__ folder
in the Godot source repository. in the Godot source repository.
@ -83,6 +83,6 @@ Development tips
---------------- ----------------
To iterate quickly on the editor, we recommend to set up a test project and To iterate quickly on the editor, we recommend to set up a test project and
:ref:`open it from the command line <doc_command_line_tutorial>` after compiling `open it from the command line <doc_command_line_tutorial>` after compiling
the editor. This way, you don't have to go through the project manager every the editor. This way, you don't have to go through the project manager every
time you start Godot. time you start Godot.

View File

@ -15,7 +15,7 @@ Node structure
To begin, we need to choose a root node for the player object. As a general To begin, we need to choose a root node for the player object. As a general
rule, a scene's root node should reflect the object's desired functionality - rule, a scene's root node should reflect the object's desired functionality -
what the object *is*. Click the "Other Node" button and add an :ref:`Area2D what the object *is*. Click the "Other Node" button and add an `Area2D
<class_Area2D>` node to the scene. <class_Area2D>` node to the scene.
.. image:: img/add_node.png .. image:: img/add_node.png
@ -42,21 +42,21 @@ or :kbd:`Cmd + S` on macOS.
- **GDScript**: Classes (nodes) use PascalCase, variables and - **GDScript**: Classes (nodes) use PascalCase, variables and
functions use snake_case, and constants use ALL_CAPS (See functions use snake_case, and constants use ALL_CAPS (See
:ref:`doc_gdscript_styleguide`). `doc_gdscript_styleguide`).
- **C#**: Classes, export variables and methods use PascalCase, - **C#**: Classes, export variables and methods use PascalCase,
private fields use _camelCase, local variables and parameters use private fields use _camelCase, local variables and parameters use
camelCase (See :ref:`doc_c_sharp_styleguide`). Be careful to type camelCase (See `doc_c_sharp_styleguide`). Be careful to type
the method names precisely when connecting signals. the method names precisely when connecting signals.
Sprite animation Sprite animation
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
Click on the ``Player`` node and add an :ref:`AnimatedSprite Click on the ``Player`` node and add an `AnimatedSprite
<class_AnimatedSprite>` node as a child. The ``AnimatedSprite`` will handle the <class_AnimatedSprite>` node as a child. The ``AnimatedSprite`` will handle the
appearance and animations for our player. Notice that there is a warning symbol appearance and animations for our player. Notice that there is a warning symbol
next to the node. An ``AnimatedSprite`` requires a :ref:`SpriteFrames next to the node. An ``AnimatedSprite`` requires a `SpriteFrames
<class_SpriteFrames>` resource, which is a list of the animations it can <class_SpriteFrames>` resource, which is a list of the animations it can
display. To create one, find the ``Frames`` property in the Inspector and click display. To create one, find the ``Frames`` property in the Inspector and click
"[empty]" -> "New SpriteFrames". Click again to open the "SpriteFrames" panel: "[empty]" -> "New SpriteFrames". Click again to open the "SpriteFrames" panel:
@ -80,7 +80,7 @@ heading.
.. image:: img/player_scale.png .. image:: img/player_scale.png
Finally, add a :ref:`CollisionShape2D <class_CollisionShape2D>` as a child of Finally, add a `CollisionShape2D <class_CollisionShape2D>` as a child of
``Player``. This will determine the player's "hitbox", or the bounds of its ``Player``. This will determine the player's "hitbox", or the bounds of its
collision area. For this character, a ``CapsuleShape2D`` node gives the best collision area. For this character, a ``CapsuleShape2D`` node gives the best
fit, so next to "Shape" in the Inspector, click "[empty]"" -> "New fit, so next to "Shape" in the Inspector, click "[empty]"" -> "New

View File

@ -21,7 +21,7 @@ click "Create":
.. image:: img/attach_node_window.png .. image:: img/attach_node_window.png
.. note:: If this is your first time encountering GDScript, please read .. note:: If this is your first time encountering GDScript, please read
:ref:`doc_scripting` before continuing. `doc_scripting` before continuing.
Start by declaring the member variables this object will need: Start by declaring the member variables this object will need:
@ -130,7 +130,7 @@ We can prevent that if we *normalize* the velocity, which means we set its
diagonal movement. diagonal movement.
.. tip:: If you've never used vector math before, or need a refresher, you can .. tip:: If you've never used vector math before, or need a refresher, you can
see an explanation of vector usage in Godot at :ref:`doc_vector_math`. see an explanation of vector usage in Godot at `doc_vector_math`.
It's good to know but won't be necessary for the rest of this tutorial. It's good to know but won't be necessary for the rest of this tutorial.
We also check whether the player is moving so we can call ``play()`` or We also check whether the player is moving so we can call ``play()`` or

View File

@ -15,23 +15,23 @@ Node setup
Click Scene -> New Scene and add the following nodes: Click Scene -> New Scene and add the following nodes:
- :ref:`RigidBody2D <class_RigidBody2D>` (named ``Mob``) - `RigidBody2D <class_RigidBody2D>` (named ``Mob``)
- :ref:`AnimatedSprite <class_AnimatedSprite>` - `AnimatedSprite <class_AnimatedSprite>`
- :ref:`CollisionShape2D <class_CollisionShape2D>` - `CollisionShape2D <class_CollisionShape2D>`
- :ref:`VisibilityNotifier2D <class_VisibilityNotifier2D>` - `VisibilityNotifier2D <class_VisibilityNotifier2D>`
Don't forget to set the children so they can't be selected, like you did with Don't forget to set the children so they can't be selected, like you did with
the Player scene. the Player scene.
In the :ref:`RigidBody2D <class_RigidBody2D>` properties, set ``Gravity Scale`` In the `RigidBody2D <class_RigidBody2D>` properties, set ``Gravity Scale``
to ``0``, so the mob will not fall downward. In addition, under the to ``0``, so the mob will not fall downward. In addition, under the
:ref:`CollisionObject2D <class_CollisionObject2D>` section, click the ``Mask`` property and uncheck the first `CollisionObject2D <class_CollisionObject2D>` section, click the ``Mask`` property and uncheck the first
box. This will ensure the mobs do not collide with each other. box. This will ensure the mobs do not collide with each other.
.. image:: img/set_collision_mask.png .. image:: img/set_collision_mask.png
Set up the :ref:`AnimatedSprite <class_AnimatedSprite>` like you did for the Set up the `AnimatedSprite <class_AnimatedSprite>` like you did for the
player. This time, we have 3 animations: ``fly``, ``swim``, and ``walk``. There player. This time, we have 3 animations: ``fly``, ``swim``, and ``walk``. There
are two images for each animation in the art folder. are two images for each animation in the art folder.

View File

@ -5,7 +5,7 @@ The main game scene
Now it's time to bring everything we did together into a playable game scene. Now it's time to bring everything we did together into a playable game scene.
Create a new scene and add a :ref:`Node <class_Node>` named ``Main``. Create a new scene and add a `Node <class_Node>` named ``Main``.
(The reason we are using Node instead of Node2D is because this node will (The reason we are using Node instead of Node2D is because this node will
be a container for handling game logic. It does not require 2D functionality itself.) be a container for handling game logic. It does not require 2D functionality itself.)
@ -17,13 +17,13 @@ Click the **Instance** button (represented by a chain link icon) and select your
Now, add the following nodes as children of ``Main``, and name them as shown Now, add the following nodes as children of ``Main``, and name them as shown
(values are in seconds): (values are in seconds):
- :ref:`Timer <class_Timer>` (named ``MobTimer``) - to control how often mobs - `Timer <class_Timer>` (named ``MobTimer``) - to control how often mobs
spawn spawn
- :ref:`Timer <class_Timer>` (named ``ScoreTimer``) - to increment the score - `Timer <class_Timer>` (named ``ScoreTimer``) - to increment the score
every second every second
- :ref:`Timer <class_Timer>` (named ``StartTimer``) - to give a delay before - `Timer <class_Timer>` (named ``StartTimer``) - to give a delay before
starting starting
- :ref:`Position2D <class_Position2D>` (named ``StartPosition``) - to indicate - `Position2D <class_Position2D>` (named ``StartPosition``) - to indicate
the player's start position the player's start position
Set the ``Wait Time`` property of each of the ``Timer`` nodes as follows: Set the ``Wait Time`` property of each of the ``Timer`` nodes as follows:
@ -39,7 +39,7 @@ Spawning mobs
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
The Main node will be spawning new mobs, and we want them to appear at a random The Main node will be spawning new mobs, and we want them to appear at a random
location on the edge of the screen. Add a :ref:`Path2D <class_Path2D>` node location on the edge of the screen. Add a `Path2D <class_Path2D>` node
named ``MobPath`` as a child of ``Main``. When you select ``Path2D``, you will named ``MobPath`` as a child of ``Main``. When you select ``Path2D``, you will
see some new buttons at the top of the editor: see some new buttons at the top of the editor:
@ -61,7 +61,7 @@ intersecting lines, respectively.
After placing point ``4`` in the image, click the "Close Curve" button and your After placing point ``4`` in the image, click the "Close Curve" button and your
curve will be complete. curve will be complete.
Now that the path is defined, add a :ref:`PathFollow2D <class_PathFollow2D>` Now that the path is defined, add a `PathFollow2D <class_PathFollow2D>`
node as a child of ``MobPath`` and name it ``MobSpawnLocation``. This node will node as a child of ``MobPath`` and name it ``MobSpawnLocation``. This node will
automatically rotate and follow the path as it moves, so we can use it to select automatically rotate and follow the path as it moves, so we can use it to select
a random position and direction along the path. a random position and direction along the path.

View File

@ -6,11 +6,11 @@ Heads up display
The final piece our game needs is a User Interface (UI) to display things like The final piece our game needs is a User Interface (UI) to display things like
score, a "game over" message, and a restart button. score, a "game over" message, and a restart button.
Create a new scene, and add a :ref:`CanvasLayer <class_CanvasLayer>` node named Create a new scene, and add a `CanvasLayer <class_CanvasLayer>` node named
``HUD``. "HUD" stands for "heads-up display", an informational display that ``HUD``. "HUD" stands for "heads-up display", an informational display that
appears as an overlay on top of the game view. appears as an overlay on top of the game view.
The :ref:`CanvasLayer <class_CanvasLayer>` node lets us draw our UI elements on The `CanvasLayer <class_CanvasLayer>` node lets us draw our UI elements on
a layer above the rest of the game, so that the information it displays isn't a layer above the rest of the game, so that the information it displays isn't
covered up by any game elements like the player or mobs. covered up by any game elements like the player or mobs.
@ -20,16 +20,16 @@ The HUD needs to display the following information:
- A message, such as "Game Over" or "Get Ready!" - A message, such as "Game Over" or "Get Ready!"
- A "Start" button to begin the game. - A "Start" button to begin the game.
The basic node for UI elements is :ref:`Control <class_Control>`. To create our The basic node for UI elements is `Control <class_Control>`. To create our
UI, we'll use two types of :ref:`Control <class_Control>` nodes: :ref:`Label UI, we'll use two types of `Control <class_Control>` nodes: `Label
<class_Label>` and :ref:`Button <class_Button>`. <class_Label>` and `Button <class_Button>`.
Create the following as children of the ``HUD`` node: Create the following as children of the ``HUD`` node:
- :ref:`Label <class_Label>` named ``ScoreLabel``. - `Label <class_Label>` named ``ScoreLabel``.
- :ref:`Label <class_Label>` named ``Message``. - `Label <class_Label>` named ``Message``.
- :ref:`Button <class_Button>` named ``StartButton``. - `Button <class_Button>` named ``StartButton``.
- :ref:`Timer <class_Timer>` named ``MessageTimer``. - `Timer <class_Timer>` named ``MessageTimer``.
Click on the ``ScoreLabel`` and type a number into the ``Text`` field in the Click on the ``ScoreLabel`` and type a number into the ``Text`` field in the
Inspector. The default font for ``Control`` nodes is small and doesn't scale Inspector. The default font for ``Control`` nodes is small and doesn't scale

View File

@ -12,7 +12,7 @@ Background
~~~~~~~~~~ ~~~~~~~~~~
The default gray background is not very appealing, so let's change its color. The default gray background is not very appealing, so let's change its color.
One way to do this is to use a :ref:`ColorRect <class_ColorRect>` node. Make it One way to do this is to use a `ColorRect <class_ColorRect>` node. Make it
the first node under ``Main`` so that it will be drawn behind the other nodes. the first node under ``Main`` so that it will be drawn behind the other nodes.
``ColorRect`` only has one property: ``Color``. Choose a color you like and ``ColorRect`` only has one property: ``Color``. Choose a color you like and
select "Layout" -> "Full Rect" so that it covers the screen. select "Layout" -> "Full Rect" so that it covers the screen.
@ -28,7 +28,7 @@ experience. In your game assets folder, you have two sound files: "House In a
Forest Loop.ogg" for background music, and "gameover.wav" for when the player Forest Loop.ogg" for background music, and "gameover.wav" for when the player
loses. loses.
Add two :ref:`AudioStreamPlayer <class_AudioStreamPlayer>` nodes as children of Add two `AudioStreamPlayer <class_AudioStreamPlayer>` nodes as children of
``Main``. Name one of them ``Music`` and the other ``DeathSound``. On each one, ``Main``. Name one of them ``Music`` and the other ``DeathSound``. On each one,
click on the ``Stream`` property, select "Load", and choose the corresponding click on the ``Stream`` property, select "Load", and choose the corresponding
audio file. audio file.
@ -75,5 +75,5 @@ interface, sounds, and more. Congratulations!
There's still much to learn, but you can take a moment to appreciate what you There's still much to learn, but you can take a moment to appreciate what you
achieved. achieved.
And when you're ready, you can move on to :ref:`doc_your_first_3d_game` to learn And when you're ready, you can move on to `doc_your_first_3d_game` to learn
to create a complete 3D game from scratch, in Godot. to create a complete 3D game from scratch, in Godot.

View File

@ -14,7 +14,7 @@ a 2D game.
.. note:: This project is an introduction to the Godot engine. It assumes that .. note:: This project is an introduction to the Godot engine. It assumes that
you have some programming experience already. If you're new to you have some programming experience already. If you're new to
programming entirely, you should start here: :ref:`doc_scripting`. programming entirely, you should start here: `doc_scripting`.
The game is called "Dodge the Creeps!". Your character must move and avoid the The game is called "Dodge the Creeps!". Your character must move and avoid the
enemies for as long as possible. enemies for as long as possible.
@ -45,7 +45,7 @@ Prerequisites
------------- -------------
This step-by-step tutorial is intended for beginners who followed the complete This step-by-step tutorial is intended for beginners who followed the complete
:ref:`Getting Started <toc-learn-step_by_step>`. `Getting Started <toc-learn-step_by_step>`.
If you're an experienced programmer, you can find the complete demo's source If you're an experienced programmer, you can find the complete demo's source
code here: `Godot demo projects code here: `Godot demo projects

View File

@ -24,7 +24,7 @@ the jump and squash mechanics.
.. seealso:: .. seealso::
To learn more about the different physics node types, see the To learn more about the different physics node types, see the
:ref:`doc_physics_introduction`. `doc_physics_introduction`.
For now, we're going to create a basic rig for our character's 3D model. This For now, we're going to create a basic rig for our character's 3D model. This
will allow us to rotate the model later via code while it plays an animation. will allow us to rotate the model later via code while it plays an animation.

View File

@ -71,7 +71,7 @@ kinematic or rigid body.
.. seealso:: .. seealso::
To learn more about the difference between ``_process()`` and To learn more about the difference between ``_process()`` and
``_physics_process()``, see :ref:`doc_idle_and_physics_processing`. ``_physics_process()``, see `doc_idle_and_physics_processing`.
We start by initializing a ``direction`` variable to ``Vector3.ZERO``. Then, we We start by initializing a ``direction`` variable to ``Vector3.ZERO``. Then, we
check if the player is pressing one or more of the ``move_*`` inputs and update check if the player is pressing one or more of the ``move_*`` inputs and update

View File

@ -69,7 +69,7 @@ Godot has a node that detects when objects leave the screen,
reason to use pools is to avoid freezes with garbage-collected languages reason to use pools is to avoid freezes with garbage-collected languages
like C# or Lua. GDScript uses a different technique to manage memory, like C# or Lua. GDScript uses a different technique to manage memory,
reference counting, which doesn't have that caveat. You can learn more reference counting, which doesn't have that caveat. You can learn more
about that here :ref:`doc_gdscript_basics_memory_management`. about that here `doc_gdscript_basics_memory_management`.
Select the *Mob* node and add a *VisibilityNotifier* as a child of it. Another Select the *Mob* node and add a *VisibilityNotifier* as a child of it. Another
box, pink this time, appears. When this box completely leaves the screen, the box, pink this time, appears. When this box completely leaves the screen, the
@ -124,7 +124,7 @@ You may see a warning in GDScript that the return value from
warning or, if you want to hide it entirely, add the comment warning or, if you want to hide it entirely, add the comment
``# warning-ignore:return_value_discarded`` just above the ``# warning-ignore:return_value_discarded`` just above the
``move_and_slide(velocity)`` line. To read more about the GDScript warning ``move_and_slide(velocity)`` line. To read more about the GDScript warning
system, see :ref:`doc_gdscript_warning_system`. system, see `doc_gdscript_warning_system`.
We need to define another function to calculate the start velocity. This We need to define another function to calculate the start velocity. This
function will turn the monster towards the player and randomize both its angle function will turn the monster towards the player and randomize both its angle

View File

@ -7,7 +7,7 @@ In this part, we'll add the ability to jump, to squash the monsters. In the next
lesson, we'll make the player die when a monster hits them on the ground. lesson, we'll make the player die when a monster hits them on the ground.
First, we have to change a few settings related to physics interactions. Enter First, we have to change a few settings related to physics interactions. Enter
the world of :ref:`physics layers the world of `physics layers
<doc_physics_introduction_collision_layers_and_masks>`. <doc_physics_introduction_collision_layers_and_masks>`.
Controlling physics interactions Controlling physics interactions
@ -155,7 +155,7 @@ Let's add the squash mechanic next. We're going to make the character bounce
over monsters and kill them at the same time. over monsters and kill them at the same time.
We need to detect collisions with a monster and to differentiate them from We need to detect collisions with a monster and to differentiate them from
collisions with the floor. To do so, we can use Godot's :ref:`group collisions with the floor. To do so, we can use Godot's `group
<doc_groups>` tagging feature. <doc_groups>` tagging feature.
Open the scene ``Mob.tscn`` again and select the *Mob* node. Go to the *Node* Open the scene ``Mob.tscn`` again and select the *Mob* node. Go to the *Node*
@ -224,18 +224,18 @@ gdscript GDScript
That's a lot of new functions. Here's some more information about them. That's a lot of new functions. Here's some more information about them.
The functions ``get_slide_count()`` and ``get_slide_collision()`` both come from The functions ``get_slide_count()`` and ``get_slide_collision()`` both come from
the :ref:`KinematicBody<class_KinematicBody>` class and are related to the `KinematicBody<class_KinematicBody>` class and are related to
``move_and_slide()``. ``move_and_slide()``.
``get_slide_collision()`` returns a ``get_slide_collision()`` returns a
:ref:`KinematicCollision<class_KinematicCollision>` object that holds `KinematicCollision<class_KinematicCollision>` object that holds
information about where and how the collision occurred. For example, we use its information about where and how the collision occurred. For example, we use its
``collider`` property to check if we collided with a "mob" by calling ``collider`` property to check if we collided with a "mob" by calling
``is_in_group()`` on it: ``collision.collider.is_in_group("mob")``. ``is_in_group()`` on it: ``collision.collider.is_in_group("mob")``.
.. note:: .. note::
The method ``is_in_group()`` is available on every :ref:`Node<class_Node>`. The method ``is_in_group()`` is available on every `Node<class_Node>`.
To check that we are landing on the monster, we use the vector dot product: To check that we are landing on the monster, we use the vector dot product:
``Vector3.UP.dot(collision.normal) > 0.1``. The collision normal is a 3D vector ``Vector3.UP.dot(collision.normal) > 0.1``. The collision normal is a 3D vector

View File

@ -61,7 +61,7 @@ By default, a theme only has one property, the *Default Font*.
You can add more properties to the theme resource to design complex user You can add more properties to the theme resource to design complex user
interfaces, but that is beyond the scope of this series. To learn more about interfaces, but that is beyond the scope of this series. To learn more about
creating and editing themes, see :ref:`doc_gui_skinning`. creating and editing themes, see `doc_gui_skinning`.
Click the *Default Font* property and create a new *DynamicFont*. Click the *Default Font* property and create a new *DynamicFont*.
@ -153,7 +153,7 @@ function.
.. seealso:: .. seealso::
You can learn more about string formatting here: :ref:`doc_gdscript_printf`. You can learn more about string formatting here: `doc_gdscript_printf`.
You can now play the game and squash a few enemies to see the score You can now play the game and squash a few enemies to see the score
increase. increase.
@ -261,7 +261,7 @@ gdscript GDScript
get_tree().reload_current_scene() get_tree().reload_current_scene()
``` ```
The function ``get_tree()`` gives us access to the global :ref:`SceneTree The function ``get_tree()`` gives us access to the global `SceneTree
<class_SceneTree>` object, which allows us to reload and restart the current <class_SceneTree>` object, which allows us to reload and restart the current
scene. scene.
@ -269,7 +269,7 @@ Adding music
------------ ------------
To add music that plays continuously in the background, we're going to use To add music that plays continuously in the background, we're going to use
another feature in Godot: :ref:`autoloads <doc_singletons_autoload>`. another feature in Godot: `autoloads <doc_singletons_autoload>`.
To play audio, all you need to do is add an *AudioStreamPlayer* node to your To play audio, all you need to do is add an *AudioStreamPlayer* node to your
scene and attach an audio file to it. When you start the scene, it can play scene and attach an audio file to it. When you start the scene, it can play

View File

@ -29,11 +29,11 @@ information about 2D, 3D, physics, rendering and performance, and much more.
Here are the sections we recommend you to explore next: Here are the sections we recommend you to explore next:
1. Read the :ref:`Scripting section <toc-scripting-core-features>` to learn essential programming features youll use 1. Read the `Scripting section <toc-scripting-core-features>` to learn essential programming features youll use
in every project. in every project.
2. The :ref:`3D <toc-learn-features-3d>` and :ref:`Physics <toc-learn-features-physics>` sections will teach you more about 3D game creation in the 2. The `3D <toc-learn-features-3d>` and `Physics <toc-learn-features-physics>` sections will teach you more about 3D game creation in the
engine. engine.
3. :ref:`Inputs <toc-learn-features-inputs>` is another important one for any game project. 3. `Inputs <toc-learn-features-inputs>` is another important one for any game project.
You can start with these or, if you prefer, look at the sidebar menu on the left You can start with these or, if you prefer, look at the sidebar menu on the left
and pick your options. and pick your options.

View File

@ -9,7 +9,7 @@ project of your own like the animated gif below.
|image0| |image0|
The game we'll code here is similar to :ref:`doc_your_first_2d_game`, with a twist: The game we'll code here is similar to `doc_your_first_2d_game`, with a twist:
you can now jump and your goal is to squash the creeps. This way, you will both you can now jump and your goal is to squash the creeps. This way, you will both
**recognize patterns** you learned in the previous tutorial and **build upon **recognize patterns** you learned in the previous tutorial and **build upon
them** with new code and features. them** with new code and features.

View File

@ -13,7 +13,7 @@ This page will give you a brief overview of Godot's interface. We're going to
look at the different main screens and docks to help you situate yourself. look at the different main screens and docks to help you situate yourself.
.. seealso:: For a comprehensive breakdown of the editor's interface and how to .. seealso:: For a comprehensive breakdown of the editor's interface and how to
use it, see the :ref:`Editor manual <toc-learn-editor>`. use it, see the `Editor manual <toc-learn-editor>`.
The Project manager The Project manager
------------------- -------------------
@ -109,7 +109,7 @@ options related to the 3D view.
.. image:: img/editor_intro_3d_viewport_perspective.png .. image:: img/editor_intro_3d_viewport_perspective.png
.. note:: Read :ref:`doc_introduction_to_3d` for more detail about the **3D .. note:: Read `doc_introduction_to_3d` for more detail about the **3D
main screen**. main screen**.
The **Script screen** is a complete code editor with a debugger, rich The **Script screen** is a complete code editor with a debugger, rich
@ -123,7 +123,7 @@ and assets to use in your projects.
.. image:: img/editor_intro_workspace_assetlib.png .. image:: img/editor_intro_workspace_assetlib.png
.. seealso:: You can learn more about the asset library in .. seealso:: You can learn more about the asset library in
:ref:`doc_what_is_assetlib`. `doc_what_is_assetlib`.
Integrated class reference Integrated class reference
-------------------------- --------------------------

View File

@ -116,7 +116,7 @@ manage states and transitions visually.*
Future Godot 4.x releases may have VisualScript reimplemented as an extension. Future Godot 4.x releases may have VisualScript reimplemented as an extension.
While Godot 3.x will keep VisualScript supported, we recommend While Godot 3.x will keep VisualScript supported, we recommend
:ref:`trying out GDScript <toc-learn-scripting-gdscript>` instead, `trying out GDScript <toc-learn-scripting-gdscript>` instead,
especially if you intend to migrate your project to Godot 4. especially if you intend to migrate your project to Godot 4.
Open source Open source

View File

@ -24,7 +24,7 @@ programming skills or a developer to port the game for you.
.. note:: The Godot team can't provide an open-source console export due to the .. note:: The Godot team can't provide an open-source console export due to the
licensing terms imposed by console manufacturers. Regardless of the licensing terms imposed by console manufacturers. Regardless of the
engine you use, though, releasing games on consoles is always a lot of engine you use, though, releasing games on consoles is always a lot of
work. You can read more on that here: :ref:`doc_consoles`. work. You can read more on that here: `doc_consoles`.
What can the engine do? What can the engine do?
----------------------- -----------------------
@ -71,15 +71,15 @@ Programming languages
Let's talk about the available programming languages. Let's talk about the available programming languages.
You can code your games using :ref:`GDScript <toc-learn-scripting-gdscript>`, a You can code your games using `GDScript <toc-learn-scripting-gdscript>`, a
Godot-specific and tightly integrated language with a lightweight syntax, or Godot-specific and tightly integrated language with a lightweight syntax, or
:ref:`C# <toc-learn-scripting-C#>`, which is popular in the games industry. `C# <toc-learn-scripting-C#>`, which is popular in the games industry.
These are the two main scripting languages we support. These are the two main scripting languages we support.
Godot also supports a node-based visual programming language named Godot also supports a node-based visual programming language named
:ref:`VisualScript <toc-learn-scripting-visual_script>`. `VisualScript <toc-learn-scripting-visual_script>`.
With the :ref:`GDNative <toc-tutorials-gdnative>` technology, you can also write With the `GDNative <toc-tutorials-gdnative>` technology, you can also write
gameplay or high-performance algorithms in C or C++ without recompiling the gameplay or high-performance algorithms in C or C++ without recompiling the
engine. You can use this technology to integrate third-party libraries and other engine. You can use this technology to integrate third-party libraries and other
Software Development Kits (SDK) in the engine. Software Development Kits (SDK) in the engine.
@ -89,7 +89,7 @@ completely free and open-source.
.. seealso:: These are the five officially supported programming languages. The .. seealso:: These are the five officially supported programming languages. The
community maintains support for many more. For more information, community maintains support for many more. For more information,
see :ref:`GDNative third-party bindings see `GDNative third-party bindings
<doc_what_is_gdnative_third_party_bindings>`. <doc_what_is_gdnative_third_party_bindings>`.
What do I need to know to use Godot? What do I need to know to use Godot?
@ -113,7 +113,7 @@ countless hours and hurdles learning any game engine afterward.
skills you learn with one language transfer well to others. skills you learn with one language transfer well to others.
We will provide you with more Godot-specific learning resources in We will provide you with more Godot-specific learning resources in
:ref:`doc_learning_new_features`. `doc_learning_new_features`.
In the next part, you will get an overview of the engine's essential concepts. In the next part, you will get an overview of the engine's essential concepts.

View File

@ -33,7 +33,7 @@ from within the Godot editor. To do so, go to Help -> Search or press
.. image:: img/manual_class_reference_search.png .. image:: img/manual_class_reference_search.png
To browse it online, head to the manual's :ref:`Class Reference <toc-class-ref>` To browse it online, head to the manual's `Class Reference <toc-class-ref>`
section. section.
A class reference's page tells you: A class reference's page tells you:
@ -148,4 +148,4 @@ This manual aims to provide a comprehensive reference of Godot's features. Aside
from the 2D and 3D getting started series, it does not contain tutorials to from the 2D and 3D getting started series, it does not contain tutorials to
implement specific game genres. If you're looking for a tutorial about creating implement specific game genres. If you're looking for a tutorial about creating
a role-playing game, a platformer, or other, please see a role-playing game, a platformer, or other, please see
:ref:`doc_community_tutorials`, which lists content made by the Godot community. `doc_community_tutorials`, which lists content made by the Godot community.

View File

@ -1,12 +1,12 @@
Step by step Step by step
============ ============
This series builds upon the :ref:`Introduction to Godot This series builds upon the `Introduction to Godot
<toc-learn-introduction>` and will get you started with the editor and the <toc-learn-introduction>` and will get you started with the editor and the
engine. You will learn more about nodes and scenes, code your first classes with engine. You will learn more about nodes and scenes, code your first classes with
GDScript, use signals to make nodes communicate with one another, and more. GDScript, use signals to make nodes communicate with one another, and more.
The following lessons are here to prepare you for :ref:`doc_your_first_2d_game`, a The following lessons are here to prepare you for `doc_your_first_2d_game`, a
step-by-step tutorial where you will code a game from scratch. By the end of it, step-by-step tutorial where you will code a game from scratch. By the end of it,
you will have the necessary foundations to explore more features in other you will have the necessary foundations to explore more features in other
sections. We also included links to pages that cover a given topic in-depth sections. We also included links to pages that cover a given topic in-depth

View File

@ -13,10 +13,10 @@ You can create as many scenes as you'd like and save them as files with the
the previous lesson was an example. We call those files "Packed Scenes" as they the previous lesson was an example. We call those files "Packed Scenes" as they
pack information about your scene's content. pack information about your scene's content.
Here's an example of a ball. It's composed of a :ref:`RigidBody2D Here's an example of a ball. It's composed of a `RigidBody2D
<class_RigidBody2D>` node as its root named Ball, which allows the ball to fall <class_RigidBody2D>` node as its root named Ball, which allows the ball to fall
and bounce on walls, a :ref:`Sprite <class_Sprite>` node, and a and bounce on walls, a `Sprite <class_Sprite>` node, and a
:ref:`CollisionShape2D <class_CollisionShape2D>`. `CollisionShape2D <class_CollisionShape2D>`.
.. image:: img/instancing_ball_scene.png .. image:: img/instancing_ball_scene.png

View File

@ -5,7 +5,7 @@
Nodes and Scenes Nodes and Scenes
================ ================
In :ref:`doc_key_concepts_overview`, we saw that a Godot game is a tree of In `doc_key_concepts_overview`, we saw that a Godot game is a tree of
scenes and that each scene is a tree of nodes. In this lesson, we explain a bit scenes and that each scene is a tree of nodes. In this lesson, we explain a bit
more about them. You will also create your first scene. more about them. You will also create your first scene.
@ -147,7 +147,7 @@ button to save it as "Label.tscn".
allows you to save files inside the project. The ``res://`` path at allows you to save files inside the project. The ``res://`` path at
the top of the window represents the project's root directory and the top of the window represents the project's root directory and
stands for "resource path". For more information about file paths in stands for "resource path". For more information about file paths in
Godot, see :ref:`doc_filesystem`. Godot, see `doc_filesystem`.
The application should open in a new window and display the text "Hello World". The application should open in a new window and display the text "Hello World".

View File

@ -19,16 +19,16 @@ Creating your first script
========================== ==========================
In this lesson, you will code your first script to make the Godot icon turn in In this lesson, you will code your first script to make the Godot icon turn in
circles using GDScript. As we mentioned :ref:`in the introduction circles using GDScript. As we mentioned `in the introduction
<toc-learn-introduction>`, we assume you have programming foundations. <toc-learn-introduction>`, we assume you have programming foundations.
The equivalent C# code has been included in another tab for convenience. The equivalent C# code has been included in another tab for convenience.
.. image:: img/scripting_first_script_rotating_godot.gif .. image:: img/scripting_first_script_rotating_godot.gif
.. seealso:: To learn more about GDScript, its keywords, and its syntax, head to .. seealso:: To learn more about GDScript, its keywords, and its syntax, head to
the :ref:`GDScript reference<doc_gdscript>`. the `GDScript reference<doc_gdscript>`.
.. seealso:: To learn more about C#, head to the :ref:`C# basics <doc_c_sharp>` page. .. seealso:: To learn more about C#, head to the `C# basics <doc_c_sharp>` page.
Project setup Project setup
------------- -------------
@ -102,7 +102,7 @@ node, including classes it extends, like ``Node2D``, ``CanvasItem``, and
``Node``. ``Node``.
.. note:: In GDScript, if you omit the line with the ``extends`` keyword, your .. note:: In GDScript, if you omit the line with the ``extends`` keyword, your
class will implicitly extend :ref:`Reference <class_Reference>`, which class will implicitly extend `Reference <class_Reference>`, which
Godot uses to manage your application's memory. Godot uses to manage your application's memory.
Inherited properties include the ones you can see in the Inspector dock, like Inherited properties include the ones you can see in the Inspector dock, like
@ -253,7 +253,7 @@ is a vector pointing forward relative to our icon. Multiplied by our ``speed``
property, it gives us a velocity we can use to move the node forward. property, it gives us a velocity we can use to move the node forward.
We add ``velocity * delta`` to the node's ``position`` to move it. The position We add ``velocity * delta`` to the node's ``position`` to move it. The position
itself is of type :ref:`Vector2 <class_Vector2>`, a built-in type in Godot itself is of type `Vector2 <class_Vector2>`, a built-in type in Godot
representing a 2D vector. representing a 2D vector.
Run the scene to see the Godot head run in circles. Run the scene to see the Godot head run in circles.
@ -261,11 +261,11 @@ Run the scene to see the Godot head run in circles.
.. image:: img/scripting_first_script_rotating_godot.gif .. image:: img/scripting_first_script_rotating_godot.gif
.. note:: Moving a node like that does not take into account colliding with .. note:: Moving a node like that does not take into account colliding with
walls or the floor. In :ref:`doc_your_first_2d_game`, you will learn walls or the floor. In `doc_your_first_2d_game`, you will learn
another approach to moving objects while detecting collisions. another approach to moving objects while detecting collisions.
Our node currently moves by itself. In the next part Our node currently moves by itself. In the next part
:ref:`doc_scripting_player_input`, we'll use player input to control it. `doc_scripting_player_input`, we'll use player input to control it.
Complete script Complete script
--------------- ---------------

View File

@ -25,7 +25,7 @@ Available scripting languages
Godot offers **five gameplay programming languages**: GDScript, C#, Godot offers **five gameplay programming languages**: GDScript, C#,
VisualScript, and, via its GDNative technology, C and C++. There are more VisualScript, and, via its GDNative technology, C and C++. There are more
:ref:`community-supported languages <doc_what_is_gdnative_third_party_bindings>`, `community-supported languages <doc_what_is_gdnative_third_party_bindings>`,
but these are the official ones. but these are the official ones.
You can use multiple languages in a single project. For instance, in a team, you You can use multiple languages in a single project. For instance, in a team, you
@ -44,7 +44,7 @@ developers.
Future Godot 4.x releases may have VisualScript reimplemented as an extension. Future Godot 4.x releases may have VisualScript reimplemented as an extension.
While Godot 3.x will keep VisualScript supported, we recommend While Godot 3.x will keep VisualScript supported, we recommend
:ref:`trying out GDScript <toc-learn-scripting-gdscript>` instead, `trying out GDScript <toc-learn-scripting-gdscript>` instead,
especially if you intend to migrate your project to Godot 4. especially if you intend to migrate your project to Godot 4.
Which language should I use? Which language should I use?
@ -68,7 +68,7 @@ Let's look at each language's features, as well as its pros and cons.
GDScript GDScript
~~~~~~~~ ~~~~~~~~
:ref:`GDScript<doc_gdscript>` is an `GDScript<doc_gdscript>` is an
`object-oriented <https://en.wikipedia.org/wiki/Object-oriented_programming>`_ and `object-oriented <https://en.wikipedia.org/wiki/Object-oriented_programming>`_ and
`imperative <https://en.wikipedia.org/wiki/Imperative_programming>`_ `imperative <https://en.wikipedia.org/wiki/Imperative_programming>`_
programming language built for Godot. It's made by and for game developers programming language built for Godot. It's made by and for game developers
@ -146,10 +146,10 @@ VisualScript
Future Godot 4.x releases may have VisualScript reimplemented as an extension. Future Godot 4.x releases may have VisualScript reimplemented as an extension.
While Godot 3.x will keep VisualScript supported, we recommend While Godot 3.x will keep VisualScript supported, we recommend
:ref:`trying out GDScript <toc-learn-scripting-gdscript>` instead, `trying out GDScript <toc-learn-scripting-gdscript>` instead,
especially if you intend to migrate your project to Godot 4. especially if you intend to migrate your project to Godot 4.
:ref:`Visual Scripting<doc_what_is_visual_script>` is a graph-based visual `Visual Scripting<doc_what_is_visual_script>` is a graph-based visual
programming language where you connect blocks. It can be a great tool for programming language where you connect blocks. It can be a great tool for
non-programmers like game designers and artists. non-programmers like game designers and artists.
@ -166,7 +166,7 @@ is slow compared to using other programming languages.
.. seealso:: .. seealso::
For more information, see For more information, see
:ref:`Getting started with VisualScript <doc_getting_started_visual_script>`. `Getting started with VisualScript <doc_getting_started_visual_script>`.
C and C++ via GDNative C and C++ via GDNative
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~

View File

@ -7,7 +7,7 @@
Listening to player input Listening to player input
========================= =========================
Building upon the previous lesson :ref:`doc_scripting_first_script`, let's look Building upon the previous lesson `doc_scripting_first_script`, let's look
at another important feature of any game: giving control to the player. at another important feature of any game: giving control to the player.
To add this, we need to modify our ``Sprite.gd`` code. To add this, we need to modify our ``Sprite.gd`` code.
@ -19,7 +19,7 @@ You have two main tools to process the player's input in Godot:
``_process()``, it's a built-in virtual function that Godot calls every time ``_process()``, it's a built-in virtual function that Godot calls every time
the player presses a key. It's the tool you want to use to react to events the player presses a key. It's the tool you want to use to react to events
that don't happen every frame, like pressing :kbd:`Space` to jump. To learn that don't happen every frame, like pressing :kbd:`Space` to jump. To learn
more about input callbacks, see :ref:`doc_inputevent`. more about input callbacks, see `doc_inputevent`.
2. The ``Input`` singleton. A singleton is a globally accessible object. Godot 2. The ``Input`` singleton. A singleton is a globally accessible object. Godot
provides access to several in scripts. It's the right tool to check for input provides access to several in scripts. It's the right tool to check for input
every frame. every frame.
@ -144,5 +144,5 @@ button presses from the users. There are quite a few more.
The ``Input`` singleton allows you to react to the players' input anywhere in The ``Input`` singleton allows you to react to the players' input anywhere in
your code. In particular, you'll get to use it in the ``_process()`` loop. your code. In particular, you'll get to use it in the ``_process()`` loop.
In the next lesson :ref:`doc_signals`, we'll build upon the relationship between In the next lesson `doc_signals`, we'll build upon the relationship between
scripts and nodes by having our nodes trigger code in scripts. scripts and nodes by having our nodes trigger code in scripts.

View File

@ -30,7 +30,7 @@ the bar to reflect the change. To do so, in Godot, you would use signals.
https://gameprogrammingpatterns.com/observer.html https://gameprogrammingpatterns.com/observer.html
We will now use a signal to make our Godot icon from the previous lesson We will now use a signal to make our Godot icon from the previous lesson
(:ref:`doc_scripting_player_input`) move and stop by pressing a button. (`doc_scripting_player_input`) move and stop by pressing a button.
.. Example .. Example
@ -141,7 +141,7 @@ Let's replace the line with the ``pass`` keyword with code that'll toggle the
node's motion. node's motion.
Our Sprite moves thanks to code in the ``_process()`` function. Godot provides a Our Sprite moves thanks to code in the ``_process()`` function. Godot provides a
method to toggle processing on and off: :ref:`Node.set_process() method to toggle processing on and off: `Node.set_process()
<class_Node_method_set_process>`. Another method of the Node class, <class_Node_method_set_process>`. Another method of the Node class,
``is_processing()``, returns ``true`` if idle processing is active. We can use ``is_processing()``, returns ``true`` if idle processing is active. We can use
the ``not`` keyword to invert the value. the ``not`` keyword to invert the value.
@ -198,7 +198,7 @@ Connecting a signal via code
You can connect signals via code instead of using the editor. This is necessary You can connect signals via code instead of using the editor. This is necessary
when you create nodes or instantiate scenes inside of a script. when you create nodes or instantiate scenes inside of a script.
Let's use a different node here. Godot has a :ref:`Timer <class_Timer>` node Let's use a different node here. Godot has a `Timer <class_Timer>` node
that's useful to implement skill cooldown times, weapon reloading, and more. that's useful to implement skill cooldown times, weapon reloading, and more.
Head back to the 2D workspace. You can either click the "2D" text at the top of Head back to the 2D workspace. You can either click the "2D" text at the top of
@ -229,11 +229,11 @@ We need to do two operations to connect the nodes via code:
listen to the Timer's "timeout" signal. listen to the Timer's "timeout" signal.
We want to connect the signal when the scene is instantiated, and we can do that We want to connect the signal when the scene is instantiated, and we can do that
using the :ref:`Node._ready() <class_Node_method__ready>` built-in function, using the `Node._ready() <class_Node_method__ready>` built-in function,
which is called automatically by the engine when a node is fully instantiated. which is called automatically by the engine when a node is fully instantiated.
To get a reference to a node relative to the current one, we use the method To get a reference to a node relative to the current one, we use the method
:ref:`Node.get_node() <class_Node_method_get_node>`. We can store the reference `Node.get_node() <class_Node_method_get_node>`. We can store the reference
in a variable. in a variable.
gdscript GDScript gdscript GDScript
@ -393,9 +393,9 @@ Signals have many uses. With them, you can react to a node entering or exiting
the game world, to a collision, to a character entering or leaving an area, to the game world, to a collision, to a character entering or leaving an area, to
an element of the interface changing size, and much more. an element of the interface changing size, and much more.
For example, an :ref:`Area2D <class_Area2D>` representing a coin emits a For example, an `Area2D <class_Area2D>` representing a coin emits a
``body_entered`` signal whenever the player's physics body enters its collision ``body_entered`` signal whenever the player's physics body enters its collision
shape, allowing you to know when the player collected it. shape, allowing you to know when the player collected it.
In the next section, :ref:`doc_your_first_2d_game`, you'll create a complete 2D In the next section, `doc_your_first_2d_game`, you'll create a complete 2D
game and put everything you learned so far into practice. game and put everything you learned so far into practice.

View File

@ -31,7 +31,7 @@ Godot Docs *3.5* branch
Welcome to the official documentation of `Godot Engine <https://godotengine.org>`__, Welcome to the official documentation of `Godot Engine <https://godotengine.org>`__,
the free and open source community-driven 2D and 3D game engine! If you are new the free and open source community-driven 2D and 3D game engine! If you are new
to this documentation, we recommend that you read the to this documentation, we recommend that you read the
:ref:`introduction page <doc_about_intro>` to get an overview of what this `introduction page <doc_about_intro>` to get an overview of what this
documentation has to offer. documentation has to offer.
The table of contents below and in the sidebar should let you easily access the The table of contents below and in the sidebar should let you easily access the
@ -132,6 +132,6 @@ The main documentation for the site is organized into the following sections:
.. Indices and tables .. Indices and tables
.. ------------------ .. ------------------
.. ..
.. * :ref:`genindex` .. * `genindex`
.. * :ref:`modindex` .. * `modindex`
.. * :ref:`search` .. * `search`

View File

@ -46,33 +46,33 @@ Nodes
----- -----
The demo uses four different nodes: The demo uses four different nodes:
* :ref:`CanvasModulate <class_CanvasModulate>` * `CanvasModulate <class_CanvasModulate>`
* :ref:`Sprite <class_Sprite>` * `Sprite <class_Sprite>`
* :ref:`Light2D <class_Light2D>` * `Light2D <class_Light2D>`
* :ref:`LightOccluder2D <class_LightOccluder2D>` * `LightOccluder2D <class_LightOccluder2D>`
:ref:`CanvasModulate<class_CanvasModulate>` is used to darken the scene. `CanvasModulate<class_CanvasModulate>` is used to darken the scene.
:ref:`Sprites <class_Sprite>` are used to display the textures for the light blobs, the `Sprites <class_Sprite>` are used to display the textures for the light blobs, the
background, and for the shadow casters. background, and for the shadow casters.
:ref:`Light2Ds <class_Light2D>` are used to light the scene. The way a light typically works `Light2Ds <class_Light2D>` are used to light the scene. The way a light typically works
is by adding a selected texture over the rest of the scene to simulate lighting. But it can be is by adding a selected texture over the rest of the scene to simulate lighting. But it can be
used in other ways, for example masking out parts of the scene. used in other ways, for example masking out parts of the scene.
:ref:`LightOccluder2Ds <class_LightOccluder2D>` are used to tell the shader which parts of `LightOccluder2Ds <class_LightOccluder2D>` are used to tell the shader which parts of
the scene cast shadows. The shadows appear only on areas covered by the :ref:`Light2D <class_Light2D>` and the scene cast shadows. The shadows appear only on areas covered by the `Light2D <class_Light2D>` and
their direction is based on the center of the :ref:`Light <class_Light2D>`. their direction is based on the center of the `Light <class_Light2D>`.
Lights Lights
------ ------
:ref:`Lights <class_Light2D>` cover the entire extent of their respective Texture. They use additive `Lights <class_Light2D>` cover the entire extent of their respective Texture. They use additive
blending to add the color of their texture to the scene. blending to add the color of their texture to the scene.
.. image:: img/light_shadow_light.png .. image:: img/light_shadow_light.png
:ref:`Lights <class_Light2D>` have four ``Modes``: ``Add``, ``Sub``, ``Mix``, and ``Mask``. `Lights <class_Light2D>` have four ``Modes``: ``Add``, ``Sub``, ``Mix``, and ``Mask``.
``Add`` adds the color of the light texture to the scene. It brightens the area under the light. ``Add`` adds the color of the light texture to the scene. It brightens the area under the light.
@ -84,24 +84,24 @@ halfway between the color of the light and the color underneath.
``Mask`` is used to mask out areas that are covered by the light. Masked out areas are hidden or revealed based on ``Mask`` is used to mask out areas that are covered by the light. Masked out areas are hidden or revealed based on
the color of the light. the color of the light.
For the demo the lights have two components, the :ref:`Light <class_Light2D>` itself (which For the demo the lights have two components, the `Light <class_Light2D>` itself (which
is the effect of the light), and a :ref:`Sprite <class_Sprite>` blob which is an image showing the is the effect of the light), and a `Sprite <class_Sprite>` blob which is an image showing the
location of the light source. A child :ref:`Sprite <class_Sprite>` is not necessary to make a location of the light source. A child `Sprite <class_Sprite>` is not necessary to make a
:ref:`Light <class_Light2D>` work. `Light <class_Light2D>` work.
.. image:: img/light_shadow_light_blob.png .. image:: img/light_shadow_light_blob.png
Shadows Shadows
------- -------
Shadows are made by intersecting a :ref:`Light <class_Light2D>` with a :ref:`LightOccluder2D <class_LightOccluder2D>`. Shadows are made by intersecting a `Light <class_Light2D>` with a `LightOccluder2D <class_LightOccluder2D>`.
By default shadows are turned off. To turn them on click on the :ref:`Light <class_Light2D>` By default shadows are turned off. To turn them on click on the `Light <class_Light2D>`
and under the Shadows section check ``Enabled``. and under the Shadows section check ``Enabled``.
In the demo we are using a :ref:`Sprite <class_Sprite>` with a Texture on it to make the "Shadow Casters", In the demo we are using a `Sprite <class_Sprite>` with a Texture on it to make the "Shadow Casters",
but in reality all you need is a couple of :ref:`LightOccluder2Ds <class_LightOccluder2D>`. By itself but in reality all you need is a couple of `LightOccluder2Ds <class_LightOccluder2D>`. By itself
the :ref:`LightOccluder2D <class_LightOccluder2D>` looks like a dark spot and in this demo the :ref:`Sprite <class_Sprite>` is the `LightOccluder2D <class_LightOccluder2D>` looks like a dark spot and in this demo the `Sprite <class_Sprite>` is
just a black square. just a black square.
Step by step Step by step
@ -110,54 +110,54 @@ Step by step
Now that we have covered the basics of the nodes being used, we can now walk step by step through Now that we have covered the basics of the nodes being used, we can now walk step by step through
the process of making a scene like the one found in the demo. the process of making a scene like the one found in the demo.
First add a :ref:`Sprite <class_Sprite>` and set its texture to the `background image <https://raw.githubusercontent.com/godotengine/godot-demo-projects/master/2d/lights_and_shadows/background.png>`_. For your game this can be any First add a `Sprite <class_Sprite>` and set its texture to the `background image <https://raw.githubusercontent.com/godotengine/godot-demo-projects/master/2d/lights_and_shadows/background.png>`_. For your game this can be any
background you choose. For this style of shadow it is most likely to be a floor texture. background you choose. For this style of shadow it is most likely to be a floor texture.
.. image:: img/light_shadow_background.png .. image:: img/light_shadow_background.png
Next create three :ref:`Light2D's <class_Light2D>` and set their textures to the `light image <https://raw.githubusercontent.com/godotengine/godot-demo-projects/master/2d/lights_and_shadows/light.png>`_. You can alter their Next create three `Light2D's <class_Light2D>` and set their textures to the `light image <https://raw.githubusercontent.com/godotengine/godot-demo-projects/master/2d/lights_and_shadows/light.png>`_. You can alter their
color in the top section. By default shadows are turned off and the ``mode`` is set to ``add``. This color in the top section. By default shadows are turned off and the ``mode`` is set to ``add``. This
means that each light adds its own color to whatever is underneath. means that each light adds its own color to whatever is underneath.
.. image:: img/light_shadow_all_lights_no_blob.png .. image:: img/light_shadow_all_lights_no_blob.png
Next add a child :ref:`Sprite <class_Sprite>` to each of the :ref:`Light <class_Light2D>` nodes, and set Next add a child `Sprite <class_Sprite>` to each of the `Light <class_Light2D>` nodes, and set
the :ref:`Sprite's <class_Sprite>` texture to the `blob image <https://raw.githubusercontent.com/godotengine/godot-demo-projects/master/2d/lights_and_shadows/spot.png>`_. Each of these the `Sprite's <class_Sprite>` texture to the `blob image <https://raw.githubusercontent.com/godotengine/godot-demo-projects/master/2d/lights_and_shadows/spot.png>`_. Each of these
should stay centered on the :ref:`Light <class_Light2D>` node. The blob is the image of the light should stay centered on the `Light <class_Light2D>` node. The blob is the image of the light
itself while the :ref:`Light <class_Light2D>` shows the effect that the light has on the scene. The itself while the `Light <class_Light2D>` shows the effect that the light has on the scene. The
:ref:`LightOccluder2D's <class_LightOccluder2D>` will treat the position of the light as the center of the :ref:`Light <class_Light2D>` `LightOccluder2D's <class_LightOccluder2D>` will treat the position of the light as the center of the `Light <class_Light2D>`
node, which is why we want the blob to be centered on its parent :ref:`Light <class_Light2D>`. node, which is why we want the blob to be centered on its parent `Light <class_Light2D>`.
.. image:: img/light_shadow_all_lights.png .. image:: img/light_shadow_all_lights.png
.. note:: The animations in the demo will not be covered here. See :ref:`doc_introduction_animation` .. note:: The animations in the demo will not be covered here. See `doc_introduction_animation`
for information on creating animations. for information on creating animations.
Right now the scene should look too bright. This is because all three lights are adding color to the scene. Right now the scene should look too bright. This is because all three lights are adding color to the scene.
This is why the demo uses a :ref:`CanvasModulate <class_CanvasModulate>` in the scene. The This is why the demo uses a `CanvasModulate <class_CanvasModulate>` in the scene. The
:ref:`CanvasModulate <class_CanvasModulate>` multiples the entire viewport by a specific color. `CanvasModulate <class_CanvasModulate>` multiples the entire viewport by a specific color.
Add a :ref:`CanvasModulate <class_CanvasModulate>` to the scene and set its color to ``rgb(70, 70, 70)``. Add a `CanvasModulate <class_CanvasModulate>` to the scene and set its color to ``rgb(70, 70, 70)``.
This will make the scene sufficiently dark to see the effects of the lights distinctly. This will make the scene sufficiently dark to see the effects of the lights distinctly.
.. image:: img/light_shadow_ambient.png .. image:: img/light_shadow_ambient.png
Now we add the shadow casters. Now we add the shadow casters.
The demo uses a :ref:`Node <class_Node2D>` named "casters" to organize the shadow casters. Add a The demo uses a `Node <class_Node2D>` named "casters" to organize the shadow casters. Add a
:ref:`Node2D <class_Node2D>` to the scene. It will be used to group all the shadow casters together. `Node2D <class_Node2D>` to the scene. It will be used to group all the shadow casters together.
This way we can show and hide them all at the same time. This way we can show and hide them all at the same time.
Each shadow caster is made of a :ref:`Sprite <class_Sprite>`, with a :ref:`LightOccluder2D <class_LightOccluder2D>` Each shadow caster is made of a `Sprite <class_Sprite>`, with a `LightOccluder2D <class_LightOccluder2D>`
child. For the demo the :ref:`Sprite <class_Sprite>` has a texture child. For the demo the `Sprite <class_Sprite>` has a texture
set to the `caster image <https://raw.githubusercontent.com/godotengine/godot-demo-projects/master/2d/lights_and_shadows/caster.png>`_ and nothing else. The child :ref:`LightOccluder2D <class_LightOccluder2D>` is where all the magic happens. In a set to the `caster image <https://raw.githubusercontent.com/godotengine/godot-demo-projects/master/2d/lights_and_shadows/caster.png>`_ and nothing else. The child `LightOccluder2D <class_LightOccluder2D>` is where all the magic happens. In a
game the :ref:`Sprite <class_Sprite>` could be more than a black box; it could be an image of whatever object is casting game the `Sprite <class_Sprite>` could be more than a black box; it could be an image of whatever object is casting
the shadow: a wall, a magical chest, or anything else. the shadow: a wall, a magical chest, or anything else.
.. image:: img/light_shadow_sprites.png .. image:: img/light_shadow_sprites.png
:ref:`LightOccluder2Ds <class_LightOccluder2D>` tell the game what shape the occluder has. They hold `LightOccluder2Ds <class_LightOccluder2D>` tell the game what shape the occluder has. They hold
an :ref:`OccluderPolygon2D <class_OccluderPolygon2D>`, which is a container an `OccluderPolygon2D <class_OccluderPolygon2D>`, which is a container
for a polygon and some other information. For this demo, since our wall is a square, we for a polygon and some other information. For this demo, since our wall is a square, we
set ``Polygon`` to a square. The other default settings are fine. set ``Polygon`` to a square. The other default settings are fine.
@ -169,8 +169,8 @@ will cast a shadow no matter which side the light is on. The other two settings
``Counter-Clockwise`` refer to the winding order of the vertices of the polygon. The winding order ``Counter-Clockwise`` refer to the winding order of the vertices of the polygon. The winding order
is used to determine which side of the line is inside the polygon. Only outward facing lines cast shadows. is used to determine which side of the line is inside the polygon. Only outward facing lines cast shadows.
To illustrate the difference, here is an image of a :ref:`LightOccluder2D <class_LightOccluder2D>` with ``Closed`` To illustrate the difference, here is an image of a `LightOccluder2D <class_LightOccluder2D>` with ``Closed``
set to ``off`` in the corresponding :ref:`OccluderPolygon2D <class_OccluderPolygon2D>`, so that the set to ``off`` in the corresponding `OccluderPolygon2D <class_OccluderPolygon2D>`, so that the
lines of the polygon can be seen: lines of the polygon can be seen:
.. image:: img/light_shadow_cull_disabled.png .. image:: img/light_shadow_cull_disabled.png
@ -187,8 +187,8 @@ lines of the polygon can be seen:
If ``Closed`` was set to ``on`` there would be an additional vertical line on the If ``Closed`` was set to ``on`` there would be an additional vertical line on the
left which would cast a shadow as well. left which would cast a shadow as well.
When you have added the :ref:`LightOccluder2Ds <class_LightOccluder2D>` the shadows still won't When you have added the `LightOccluder2Ds <class_LightOccluder2D>` the shadows still won't
appear. You need to go back into the :ref:`Light2Ds <class_Light2D>` and under the Shadow appear. You need to go back into the `Light2Ds <class_Light2D>` and under the Shadow
section set ``Enable`` to ``on``. This turns on shadows with hard edges like in the image below. section set ``Enable`` to ``on``. This turns on shadows with hard edges like in the image below.
.. image:: img/light_shadow_filter0_pcf0.png .. image:: img/light_shadow_filter0_pcf0.png
@ -219,7 +219,7 @@ forming between the samples.
.. note:: ``filter smooth`` is set to ``30``. .. note:: ``filter smooth`` is set to ``30``.
The different :ref:`Light <class_Light2D>` nodes in the demo use different values for filter smooth. The different `Light <class_Light2D>` nodes in the demo use different values for filter smooth.
Play around with it and see what you like. Play around with it and see what you like.
.. image:: img/light_shadow_filter0.png .. image:: img/light_shadow_filter0.png

View File

@ -10,7 +10,7 @@ In 3D, meshes are used to display the world. In 2D, they are rare as images are
Godot's 2D engine is a pure two-dimensional engine, so it can't really display 3D meshes directly (although it can be done Godot's 2D engine is a pure two-dimensional engine, so it can't really display 3D meshes directly (although it can be done
via ``Viewport`` and ``ViewportTexture``). via ``Viewport`` and ``ViewportTexture``).
.. seealso:: If you are interested in displaying 3D meshes on a 2D viewport, see the :ref:`doc_viewport_as_texture` tutorial. .. seealso:: If you are interested in displaying 3D meshes on a 2D viewport, see the `doc_viewport_as_texture` tutorial.
2D meshes are meshes that contain two-dimensional geometry (Z can be omitted or ignored) instead of 3D. 2D meshes are meshes that contain two-dimensional geometry (Z can be omitted or ignored) instead of 3D.
You can experiment creating them yourself using ``SurfaceTool`` from code and displaying them in a ``MeshInstance2D`` node. You can experiment creating them yourself using ``SurfaceTool`` from code and displaying them in a ``MeshInstance2D`` node.

View File

@ -10,7 +10,7 @@ Every beginner has been there: "How do I move my character?" Depending on the
style of game you're making, you may have special requirements, but in general style of game you're making, you may have special requirements, but in general
the movement in most 2D games is based on a small number of designs. the movement in most 2D games is based on a small number of designs.
We'll use :ref:`KinematicBody2D <class_KinematicBody2D>` for these examples, We'll use `KinematicBody2D <class_KinematicBody2D>` for these examples,
but the principles will apply to other node types (Area2D, RigidBody2D) as well. but the principles will apply to other node types (Area2D, RigidBody2D) as well.
.. _doc_2d_movement_setup: .. _doc_2d_movement_setup:
@ -23,7 +23,7 @@ children: ``Sprite`` and ``CollisionShape2D``. You can use the Godot icon ("icon
for the Sprite's texture or use any other 2D image you have. for the Sprite's texture or use any other 2D image you have.
Open ``Project -> Project Settings`` and select the "Input Map" tab. Add the following Open ``Project -> Project Settings`` and select the "Input Map" tab. Add the following
input actions (see :ref:`InputEvent <doc_inputevent>` for details): input actions (see `InputEvent <doc_inputevent>` for details):
.. image:: img/movement_inputs.png .. image:: img/movement_inputs.png
@ -73,13 +73,13 @@ We can prevent that if we *normalize* the velocity, which means we set
its *length* to ``1``, and multiply by the desired speed. its *length* to ``1``, and multiply by the desired speed.
.. tip:: If you've never used vector math before, or need a refresher, .. tip:: If you've never used vector math before, or need a refresher,
you can see an explanation of vector usage in Godot at :ref:`doc_vector_math`. you can see an explanation of vector usage in Godot at `doc_vector_math`.
.. note:: .. note::
If the code above does nothing when you press the keys, double-check that If the code above does nothing when you press the keys, double-check that
you've set up input actions correctly as described in the you've set up input actions correctly as described in the
:ref:`doc_2d_movement_setup` part of this tutorial. `doc_2d_movement_setup` part of this tutorial.
Rotation + movement Rotation + movement
------------------- -------------------
@ -159,7 +159,7 @@ gdscript GDScript
velocity = move_and_slide(velocity) velocity = move_and_slide(velocity)
``` ```
Here we're using the :ref:`Node2D <class_Node2D>` ``look_at()`` method to Here we're using the `Node2D <class_Node2D>` ``look_at()`` method to
point the player towards a given position. Without this function, you point the player towards a given position. Without this function, you
could get the same effect by setting the angle like this: could get the same effect by setting the angle like this:

View File

@ -11,10 +11,10 @@ characters with the AnimatedSprite class and the AnimationPlayer. Typically, whe
will come in one of two ways: as individual images or as a single sprite sheet will come in one of two ways: as individual images or as a single sprite sheet
containing all the animation's frames. Both can be animated in Godot with the AnimatedSprite class. containing all the animation's frames. Both can be animated in Godot with the AnimatedSprite class.
First, we'll use :ref:`AnimatedSprite <class_AnimatedSprite>` to First, we'll use `AnimatedSprite <class_AnimatedSprite>` to
animate a collection of individual images. Then we will animate a sprite sheet using this class. Finally, we will learn another way to animate a sprite sheet animate a collection of individual images. Then we will animate a sprite sheet using this class. Finally, we will learn another way to animate a sprite sheet
with :ref:`AnimationPlayer <class_AnimationPlayer>` and the *Animation* with `AnimationPlayer <class_AnimationPlayer>` and the *Animation*
property of :ref:`Sprite <class_Sprite>`. property of `Sprite <class_Sprite>`.
.. note:: Art for the following examples by https://opengameart.org/users/ansimuz and by .. note:: Art for the following examples by https://opengameart.org/users/ansimuz and by
https://opengameart.org/users/tgfcoder https://opengameart.org/users/tgfcoder
@ -36,11 +36,11 @@ with the following nodes:
.. image:: img/2d_animation_tree1.png .. image:: img/2d_animation_tree1.png
.. note:: The root node could also be :ref:`Area2D <class_Area2D>` or .. note:: The root node could also be `Area2D <class_Area2D>` or
:ref:`RigidBody2D <class_RigidBody2D>`. The animation will still be `RigidBody2D <class_RigidBody2D>`. The animation will still be
made in the same way. Once the animation is completed, you can made in the same way. Once the animation is completed, you can
assign a shape to the CollisionShape2D. See assign a shape to the CollisionShape2D. See
:ref:`Physics Introduction <doc_physics_introduction>` for more `Physics Introduction <doc_physics_introduction>` for more
information. information.
Now select the ``AnimatedSprite`` and in its *SpriteFrames* property, select Now select the ``AnimatedSprite`` and in its *SpriteFrames* property, select
@ -128,8 +128,8 @@ Sprite sheet with AnimationPlayer
--------------------------------- ---------------------------------
Another way that you can animate when using a sprite sheet is to use a standard Another way that you can animate when using a sprite sheet is to use a standard
:ref:`Sprite <class_Sprite>` node to display the texture, and then animating the `Sprite <class_Sprite>` node to display the texture, and then animating the
change from texture to texture with :ref:`AnimationPlayer <class_AnimationPlayer>`. change from texture to texture with `AnimationPlayer <class_AnimationPlayer>`.
Consider this sprite sheet, which contains 6 frames of animation: Consider this sprite sheet, which contains 6 frames of animation:
@ -143,11 +143,11 @@ setting up your scene tree:
.. image:: img/2d_animation_tree2.png .. image:: img/2d_animation_tree2.png
.. note:: The root node could also be :ref:`Area2D <class_Area2D>` or .. note:: The root node could also be `Area2D <class_Area2D>` or
:ref:`RigidBody2D <class_RigidBody2D>`. The animation will still be `RigidBody2D <class_RigidBody2D>`. The animation will still be
made in the same way. Once the animation is completed, you can made in the same way. Once the animation is completed, you can
assign a shape to the CollisionShape2D. See assign a shape to the CollisionShape2D. See
:ref:`Physics Introduction <doc_physics_introduction>` for more `Physics Introduction <doc_physics_introduction>` for more
information. information.
Drag the spritesheet into the Sprite's *Texture* property, and you'll see the Drag the spritesheet into the Sprite's *Texture* property, and you'll see the
@ -208,7 +208,7 @@ gdscript GDScript
(for example, a platformer may update the sprite's ``h_flip``/``v_flip`` (for example, a platformer may update the sprite's ``h_flip``/``v_flip``
properties when a character turns while starting a 'turning' animation), properties when a character turns while starting a 'turning' animation),
it's important to keep in mind that ``play()`` isn't applied instantly. it's important to keep in mind that ``play()`` isn't applied instantly.
Instead, it's applied the next time the :ref:`AnimationPlayer <class_AnimationPlayer>` is processed. Instead, it's applied the next time the `AnimationPlayer <class_AnimationPlayer>` is processed.
This may end up being on the next frame, causing a 'glitch' frame, This may end up being on the next frame, causing a 'glitch' frame,
where the property change was applied but the animation was not. where the property change was applied but the animation was not.
If this turns out to be a problem, after calling ``play()``, you can call ``advance(0)`` If this turns out to be a problem, after calling ``play()``, you can call ``advance(0)``

View File

@ -13,21 +13,21 @@ the screen. This overview discusses very low level details of the engine.
Canvas transform Canvas transform
---------------- ----------------
As mentioned in the previous tutorial, :ref:`doc_canvas_layers`, every As mentioned in the previous tutorial, `doc_canvas_layers`, every
CanvasItem node (remember that Node2D and Control based nodes use CanvasItem node (remember that Node2D and Control based nodes use
CanvasItem as their common root) will reside in a *Canvas Layer*. Every CanvasItem as their common root) will reside in a *Canvas Layer*. Every
canvas layer has a transform (translation, rotation, scale, etc.) that canvas layer has a transform (translation, rotation, scale, etc.) that
can be accessed as a :ref:`Transform2D <class_Transform2D>`. can be accessed as a `Transform2D <class_Transform2D>`.
Also covered in the previous tutorial, nodes are drawn by default in Layer 0, Also covered in the previous tutorial, nodes are drawn by default in Layer 0,
in the built-in canvas. To put nodes in a different layer, a :ref:`CanvasLayer in the built-in canvas. To put nodes in a different layer, a `CanvasLayer
<class_CanvasLayer>` node can be used. <class_CanvasLayer>` node can be used.
Global canvas transform Global canvas transform
----------------------- -----------------------
Viewports also have a Global Canvas transform (also a Viewports also have a Global Canvas transform (also a
:ref:`Transform2D <class_Transform2D>`). This is the master transform and `Transform2D <class_Transform2D>`). This is the master transform and
affects all individual *Canvas Layer* transforms. Generally, this affects all individual *Canvas Layer* transforms. Generally, this
transform is not of much use, but is used in the CanvasItem Editor transform is not of much use, but is used in the CanvasItem Editor
in Godot's editor. in Godot's editor.
@ -37,13 +37,13 @@ Stretch transform
Finally, viewports have a *Stretch Transform*, which is used when Finally, viewports have a *Stretch Transform*, which is used when
resizing or stretching the screen. This transform is used internally (as resizing or stretching the screen. This transform is used internally (as
described in :ref:`doc_multiple_resolutions`), but can also be manually set described in `doc_multiple_resolutions`), but can also be manually set
on each viewport. on each viewport.
Input events received in the :ref:`MainLoop._input_event() <class_MainLoop_method__input_event>` Input events received in the `MainLoop._input_event() <class_MainLoop_method__input_event>`
callback are multiplied by this transform but lack the ones above. To callback are multiplied by this transform but lack the ones above. To
convert InputEvent coordinates to local CanvasItem coordinates, the convert InputEvent coordinates to local CanvasItem coordinates, the
:ref:`CanvasItem.make_input_local() <class_CanvasItem_method_make_input_local>` `CanvasItem.make_input_local() <class_CanvasItem_method_make_input_local>`
function was added for convenience. function was added for convenience.
Transform order Transform order
@ -62,11 +62,11 @@ Obtaining each transform can be achieved with the following functions:
+----------------------------------+---------------------------------------------------------------------------------------------+ +----------------------------------+---------------------------------------------------------------------------------------------+
| Type | Transform | | Type | Transform |
+==================================+=============================================================================================+ +==================================+=============================================================================================+
| CanvasItem | :ref:`CanvasItem.get_global_transform() <class_CanvasItem_method_get_global_transform>` | | CanvasItem | `CanvasItem.get_global_transform() <class_CanvasItem_method_get_global_transform>` |
+----------------------------------+---------------------------------------------------------------------------------------------+ +----------------------------------+---------------------------------------------------------------------------------------------+
| CanvasLayer | :ref:`CanvasItem.get_canvas_transform() <class_CanvasItem_method_get_canvas_transform>` | | CanvasLayer | `CanvasItem.get_canvas_transform() <class_CanvasItem_method_get_canvas_transform>` |
+----------------------------------+---------------------------------------------------------------------------------------------+ +----------------------------------+---------------------------------------------------------------------------------------------+
| CanvasLayer+GlobalCanvas+Stretch | :ref:`CanvasItem.get_viewport_transform() <class_CanvasItem_method_get_viewport_transform>` | | CanvasLayer+GlobalCanvas+Stretch | `CanvasItem.get_viewport_transform() <class_CanvasItem_method_get_viewport_transform>` |
+----------------------------------+---------------------------------------------------------------------------------------------+ +----------------------------------+---------------------------------------------------------------------------------------------+
Finally, then, to convert a CanvasItem local coordinates to screen Finally, then, to convert a CanvasItem local coordinates to screen

View File

@ -6,20 +6,20 @@ Canvas layers
Viewport and Canvas items Viewport and Canvas items
------------------------- -------------------------
:ref:`CanvasItem <class_CanvasItem>` is the base for all 2D nodes, be it regular `CanvasItem <class_CanvasItem>` is the base for all 2D nodes, be it regular
2D nodes, such as :ref:`Node2D <class_Node2D>`, or :ref:`Control <class_Control>`. 2D nodes, such as `Node2D <class_Node2D>`, or `Control <class_Control>`.
Both inherit from :ref:`CanvasItem <class_CanvasItem>`. Both inherit from `CanvasItem <class_CanvasItem>`.
You can arrange canvas items in trees. Each item will inherit its parent's You can arrange canvas items in trees. Each item will inherit its parent's
transform: when the parent moves, its children move too. transform: when the parent moves, its children move too.
CanvasItem nodes, and nodes inheriting from them, are direct or indirect children of a CanvasItem nodes, and nodes inheriting from them, are direct or indirect children of a
:ref:`Viewport <class_Viewport>`, that display them. `Viewport <class_Viewport>`, that display them.
A Viewport has the property A Viewport has the property
:ref:`Viewport.canvas_transform <class_Viewport_property_canvas_transform>`, `Viewport.canvas_transform <class_Viewport_property_canvas_transform>`,
allows to apply a custom :ref:`Transform2D <class_Transform2D>` allows to apply a custom `Transform2D <class_Transform2D>`
transform to the CanvasItem hierarchy it contains. Nodes such as transform to the CanvasItem hierarchy it contains. Nodes such as
:ref:`Camera2D <class_Camera2D>` work by changing that transform. `Camera2D <class_Camera2D>` work by changing that transform.
To achieve effects like scrolling, manipulating the canvas transform property is To achieve effects like scrolling, manipulating the canvas transform property is
more efficient than moving the root canvas item and the entire scene with it. more efficient than moving the root canvas item and the entire scene with it.
@ -37,7 +37,7 @@ How can these problems be solved in a single scene tree?
CanvasLayers CanvasLayers
------------ ------------
The answer is :ref:`CanvasLayer <class_CanvasLayer>`, The answer is `CanvasLayer <class_CanvasLayer>`,
which is a node that adds a separate 2D rendering layer for all its which is a node that adds a separate 2D rendering layer for all its
children and grand-children. Viewport children will draw by default at children and grand-children. Viewport children will draw by default at
layer "0", while a CanvasLayer will draw at any numeric layer. Layers layer "0", while a CanvasLayer will draw at any numeric layer. Layers
@ -61,4 +61,4 @@ their layer number, so they can be instantiated when needed.
The standard way to ensuring that a node is correctly drawn 'in front' or 'behind' others is to manipulate the The standard way to ensuring that a node is correctly drawn 'in front' or 'behind' others is to manipulate the
order of the nodes in the scene panel. Perhaps counterintuitively, the topmost nodes in the scene panel are drawn order of the nodes in the scene panel. Perhaps counterintuitively, the topmost nodes in the scene panel are drawn
on *behind* lower ones in the viewport. 2d nodes also have a property for controlling their drawing order on *behind* lower ones in the viewport. 2d nodes also have a property for controlling their drawing order
(see :ref:`Node2D.z_index <class_Node2D_property_z_index>`). (see `Node2D.z_index <class_Node2D_property_z_index>`).

View File

@ -10,7 +10,7 @@ Godot has nodes to draw sprites, polygons, particles, and all sorts of
stuff. For most cases, this is enough; but not always. Before crying in fear, stuff. For most cases, this is enough; but not always. Before crying in fear,
angst, and rage because a node to draw that specific *something* does not exist... angst, and rage because a node to draw that specific *something* does not exist...
it would be good to know that it is possible to easily make any 2D node (be it it would be good to know that it is possible to easily make any 2D node (be it
:ref:`Control <class_Control>` or :ref:`Node2D <class_Node2D>` `Control <class_Control>` or `Node2D <class_Node2D>`
based) draw custom commands. It is *really* easy to do it, too. based) draw custom commands. It is *really* easy to do it, too.
Custom drawing in a 2D node is *really* useful. Here are some use cases: Custom drawing in a 2D node is *really* useful. Here are some use cases:
@ -30,9 +30,9 @@ Custom drawing in a 2D node is *really* useful. Here are some use cases:
Drawing Drawing
------- -------
Add a script to any :ref:`CanvasItem <class_CanvasItem>` Add a script to any `CanvasItem <class_CanvasItem>`
derived node, like :ref:`Control <class_Control>` or derived node, like `Control <class_Control>` or
:ref:`Node2D <class_Node2D>`. Then override the ``_draw()`` function. `Node2D <class_Node2D>`. Then override the ``_draw()`` function.
gdscript GDScript gdscript GDScript
@ -44,7 +44,7 @@ gdscript GDScript
pass pass
``` ```
Draw commands are described in the :ref:`CanvasItem <class_CanvasItem>` Draw commands are described in the `CanvasItem <class_CanvasItem>`
class reference. There are plenty of them. class reference. There are plenty of them.
Updating Updating
@ -54,7 +54,7 @@ The ``_draw()`` function is only called once, and then the draw commands
are cached and remembered, so further calls are unnecessary. are cached and remembered, so further calls are unnecessary.
If re-drawing is required because a state or something else changed, If re-drawing is required because a state or something else changed,
call :ref:`CanvasItem.update() <class_CanvasItem_method_update>` call `CanvasItem.update() <class_CanvasItem_method_update>`
in that same node and a new ``_draw()`` call will happen. in that same node and a new ``_draw()`` call will happen.
Here is a little more complex example, a texture variable that will be Here is a little more complex example, a texture variable that will be
@ -308,11 +308,11 @@ Let's run again! This time, the rotation displays fine!
Antialiased drawing Antialiased drawing
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
Godot offers method parameters in :ref:`draw_line<class_CanvasItem_method_draw_line>` Godot offers method parameters in `draw_line<class_CanvasItem_method_draw_line>`
to enable antialiasing, but it doesn't work reliably in all situations to enable antialiasing, but it doesn't work reliably in all situations
(for instance, on mobile/web platforms, or when HDR is enabled). (for instance, on mobile/web platforms, or when HDR is enabled).
There is also no ``antialiased`` parameter available in There is also no ``antialiased`` parameter available in
:ref:`draw_polygon<class_CanvasItem_method_draw_polygon>`. `draw_polygon<class_CanvasItem_method_draw_polygon>`.
As a workaround, install and use the As a workaround, install and use the
`Antialiased Line2D add-on <https://github.com/godot-extended-libraries/godot-antialiased-line2d>`__ `Antialiased Line2D add-on <https://github.com/godot-extended-libraries/godot-antialiased-line2d>`__
@ -324,4 +324,4 @@ Tools
Drawing your own nodes might also be desired while running them in the Drawing your own nodes might also be desired while running them in the
editor. This can be used as a preview or visualization of some feature or editor. This can be used as a preview or visualization of some feature or
behavior. See :ref:`doc_running_code_in_the_editor` for more information. behavior. See `doc_running_code_in_the_editor` for more information.

View File

@ -20,13 +20,13 @@ parameters and then adding randomness to them.
Particle nodes Particle nodes
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Godot provides two different nodes for 2D particles, :ref:`class_Particles2D` and Godot provides two different nodes for 2D particles, `class_Particles2D` and
:ref:`class_CPUParticles2D`. `class_CPUParticles2D`.
Particles2D is more advanced and uses the GPU to process particle effects, but that limits Particles2D is more advanced and uses the GPU to process particle effects, but that limits
it to higher end graphics API, and in our case to the GLES3 renderer. For projects using it to higher end graphics API, and in our case to the GLES3 renderer. For projects using
the GLES2 backend, CPUParticles2D is a CPU-driven option with near feature parity with the GLES2 backend, CPUParticles2D is a CPU-driven option with near feature parity with
Particles2D, but lesser performance. While Particles2D is configured via a Particles2D, but lesser performance. While Particles2D is configured via a
:ref:`class_ParticlesMaterial` (and optionally with a custom shader), the matching options `class_ParticlesMaterial` (and optionally with a custom shader), the matching options
are provided via node properties in CPUParticles2D (with the exception of the trail settings). are provided via node properties in CPUParticles2D (with the exception of the trail settings).
You can convert a Particles2D node into a CPUParticles2D node by clicking on the node in the You can convert a Particles2D node into a CPUParticles2D node by clicking on the node in the
inspector, and selecting "Convert to CPUParticles2D" in the "Particles" menu of the toolbar. inspector, and selecting "Convert to CPUParticles2D" in the "Particles" menu of the toolbar.

View File

@ -7,9 +7,9 @@ Introduction
------------ ------------
A tilemap is a grid of tiles used to create a game's layout. There are several A tilemap is a grid of tiles used to create a game's layout. There are several
benefits to using :ref:`TileMap <class_TileMap>` nodes to design your levels. benefits to using `TileMap <class_TileMap>` nodes to design your levels.
First, they make it possible to draw the layout by "painting" the tiles onto a First, they make it possible to draw the layout by "painting" the tiles onto a
grid, which is much faster than placing individual :ref:`Sprite <class_Sprite>` grid, which is much faster than placing individual `Sprite <class_Sprite>`
nodes one by one. Second, they allow for much larger levels because they are nodes one by one. Second, they allow for much larger levels because they are
optimized for drawing large numbers of tiles. Finally, you can add collision, optimized for drawing large numbers of tiles. Finally, you can add collision,
occlusion, and navigation shapes to tiles, adding additional functionality to occlusion, and navigation shapes to tiles, adding additional functionality to
@ -31,12 +31,12 @@ Create a new project and place the above image in the project folder.
When using a tileset, it's important that adjacent tiles match up. Godot's default When using a tileset, it's important that adjacent tiles match up. Godot's default
is to import 2D images using an interpolated "filter" mode, which will result in is to import 2D images using an interpolated "filter" mode, which will result in
ugly borders between the tiles. Select the image and click the Import tab. Turn ugly borders between the tiles. Select the image and click the Import tab. Turn
off ``Filter`` and click "Reimport". See :ref:`doc_import_images` for details. off ``Filter`` and click "Reimport". See `doc_import_images` for details.
TileMap node TileMap node
------------ ------------
Add a new :ref:`TileMap <class_TileMap>` node to the scene. By default, a TileMap Add a new `TileMap <class_TileMap>` node to the scene. By default, a TileMap
uses a square grid of tiles. You can also use a perspective-based "Isometric" mode uses a square grid of tiles. You can also use a perspective-based "Isometric" mode
or define your own custom tile shape. or define your own custom tile shape.
@ -71,8 +71,8 @@ Creating a TileSet
------------------ ------------------
Once you've configured your tilemap, it's time to add a Once you've configured your tilemap, it's time to add a
:ref:`TileSet <class_TileSet>`. A TileSet is a `TileSet <class_TileSet>`. A TileSet is a
:ref:`Resource <class_Resource>` that contains the data about your `Resource <class_Resource>` that contains the data about your
tiles - their textures, collision shapes, and other properties. When the game tiles - their textures, collision shapes, and other properties. When the game
runs, the TileMap combines the individual tiles into a single object. runs, the TileMap combines the individual tiles into a single object.
@ -340,7 +340,7 @@ to take effect.
Tips and tricks Tips and tricks
--------------- ---------------
- If you're using a :ref:`Camera2D <class_Camera2D>` to scroll your level, you - If you're using a `Camera2D <class_Camera2D>` to scroll your level, you
may notice lines appearing between your tiles. To fix this, open Project may notice lines appearing between your tiles. To fix this, open Project
Settings and enable **Use Gpu Pixel Snap** in the **Rendering > 2d > Snapping** section. Settings and enable **Use Gpu Pixel Snap** in the **Rendering > 2d > Snapping** section.

View File

@ -7,7 +7,7 @@
In addition to the limitations below, mobile platforms have even more In addition to the limitations below, mobile platforms have even more
limitations on 3D rendering compared to desktop platforms. limitations on 3D rendering compared to desktop platforms.
See :ref:`doc_mobile_rendering_limitations` for more information. See `doc_mobile_rendering_limitations` for more information.
Introduction Introduction
------------ ------------
@ -91,7 +91,7 @@ In Godot, transparent materials are drawn after opaque materials. Transparent
objects are sorted back to front before being drawn based on the Spatial's objects are sorted back to front before being drawn based on the Spatial's
position, not the vertex position in world space. Due to this, overlapping position, not the vertex position in world space. Due to this, overlapping
objects may often be sorted out of order. To fix improperly sorted objects, tweak objects may often be sorted out of order. To fix improperly sorted objects, tweak
the material's :ref:`Render Priority <class_Material_property_render_priority>` the material's `Render Priority <class_Material_property_render_priority>`
property. This will force specific materials to appear in front or behind of property. This will force specific materials to appear in front or behind of
other transparent materials. Even then, this may not always be sufficient. other transparent materials. Even then, this may not always be sufficient.

View File

@ -30,7 +30,7 @@ up and shaded by light sources if the shaded flag is enabled, but it
will not cast a shadow, even with cast shadow turned on under the nodes will not cast a shadow, even with cast shadow turned on under the nodes
GeometryInstance3D settings. This is because the node is a quad mesh GeometryInstance3D settings. This is because the node is a quad mesh
(one glyph per quad) with transparent textures and has the same limitations (one glyph per quad) with transparent textures and has the same limitations
as Sprite3D. See :ref:`this page <doc_3d_rendering_limitations_transparency_sorting>` as Sprite3D. See `this page <doc_3d_rendering_limitations_transparency_sorting>`
for more information. for more information.
Text mesh Text mesh

View File

@ -7,14 +7,14 @@ Introduction
------------ ------------
Baked lightmaps are an alternative workflow for adding indirect (or fully baked) Baked lightmaps are an alternative workflow for adding indirect (or fully baked)
lighting to a scene. Unlike the :ref:`doc_gi_probes` approach, baked lightmaps lighting to a scene. Unlike the `doc_gi_probes` approach, baked lightmaps
work fine on low-end PCs and mobile devices, as they consume almost no resources work fine on low-end PCs and mobile devices, as they consume almost no resources
at run-time. Also unlike GIProbe, baked lightmaps can optionally be used to at run-time. Also unlike GIProbe, baked lightmaps can optionally be used to
store direct lighting, which provides even further performance gains. store direct lighting, which provides even further performance gains.
Unlike GIProbes, Baked Lightmaps are completely static. Once baked, they Unlike GIProbes, Baked Lightmaps are completely static. Once baked, they
can't be modified at all. They also don't provide the scene with reflections, so can't be modified at all. They also don't provide the scene with reflections, so
using :ref:`doc_reflection_probes` together with it on interiors (or using a Sky using `doc_reflection_probes` together with it on interiors (or using a Sky
on exteriors) is a requirement to get good quality. on exteriors) is a requirement to get good quality.
As they are baked, they have fewer problems than ``GIProbe`` regarding light As they are baked, they have fewer problems than ``GIProbe`` regarding light
@ -26,7 +26,7 @@ bake lightmaps only when you actually need to see changes in lighting.
Baking lightmaps will also reserve baked materials' UV2 slot, which means you can Baking lightmaps will also reserve baked materials' UV2 slot, which means you can
no longer use it for other purposes in materials (either in the built-in no longer use it for other purposes in materials (either in the built-in
:ref:`doc_spatial_material` or in custom shaders). `doc_spatial_material` or in custom shaders).
In the end, deciding which indirect lighting approach is better depends on your In the end, deciding which indirect lighting approach is better depends on your
use case. In general, GIProbe is easier to set up and works better with dynamic use case. In general, GIProbe is easier to set up and works better with dynamic
@ -333,7 +333,7 @@ Capture
- **Quality:** The lightmap probe generation quality. Higher values result in - **Quality:** The lightmap probe generation quality. Higher values result in
more accurate lighting, but take longer to bake. This setting does not affect more accurate lighting, but take longer to bake. This setting does not affect
the *density* of the lightmap probes, only their quality. the *density* of the lightmap probes, only their quality.
- **Propagation:** Similar to :ref:`GIProbe <doc_gi_probes>`'s Propagation property. - **Propagation:** Similar to `GIProbe <doc_gi_probes>`'s Propagation property.
Higher values result in brighter and more diffuse indirect lighting for Higher values result in brighter and more diffuse indirect lighting for
dynamic objects. Adjust this value depending on your scene to make dynamic dynamic objects. Adjust this value depending on your scene to make dynamic
objects better fit with static baked lighting. objects better fit with static baked lighting.

View File

@ -29,13 +29,13 @@ Introduction to CSG nodes
Like other features of Godot, CSG is supported in the form of nodes. These are Like other features of Godot, CSG is supported in the form of nodes. These are
the CSG nodes: the CSG nodes:
- :ref:`CSGBox <class_CSGBox>` - `CSGBox <class_CSGBox>`
- :ref:`CSGCylinder <class_CSGCylinder>` (also supports cone) - `CSGCylinder <class_CSGCylinder>` (also supports cone)
- :ref:`CSGSphere <class_CSGSphere>` - `CSGSphere <class_CSGSphere>`
- :ref:`CSGTorus <class_CSGTorus>` - `CSGTorus <class_CSGTorus>`
- :ref:`CSGPolygon <class_CSGPolygon>` - `CSGPolygon <class_CSGPolygon>`
- :ref:`CSGMesh <class_CSGMesh>` - `CSGMesh <class_CSGMesh>`
- :ref:`CSGCombiner <class_CSGcombiner>` - `CSGCombiner <class_CSGcombiner>`
.. image:: img/csg_nodes.png .. image:: img/csg_nodes.png
@ -59,7 +59,7 @@ Every CSG node supports 3 kinds of boolean operations:
CSGPolygon CSGPolygon
~~~~~~~~~~ ~~~~~~~~~~
The :ref:`CSGPolygon <class_CSGPolygon>` node extrude along a Polygon drawn in The `CSGPolygon <class_CSGPolygon>` node extrude along a Polygon drawn in
2D (in X, Y coordinates) in the following ways: 2D (in X, Y coordinates) in the following ways:
- **Depth:** Extruded back a given amount. - **Depth:** Extruded back a given amount.
@ -71,7 +71,7 @@ The :ref:`CSGPolygon <class_CSGPolygon>` node extrude along a Polygon drawn in
.. image:: img/csg_poly.png .. image:: img/csg_poly.png
.. note:: The **Path** mode must be provided with a :ref:`Path <class_Path>` .. note:: The **Path** mode must be provided with a `Path <class_Path>`
node to work. In the Path node, draw the path and the polygon in node to work. In the Path node, draw the path and the polygon in
CSGPolygon will extrude along the given path. CSGPolygon will extrude along the given path.
@ -79,7 +79,7 @@ The :ref:`CSGPolygon <class_CSGPolygon>` node extrude along a Polygon drawn in
Custom meshes Custom meshes
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Any mesh can be used for :ref:`CSGMesh <class_CSGMesh>`; the mesh can be Any mesh can be used for `CSGMesh <class_CSGMesh>`; the mesh can be
modelled in other software and imported into Godot. Multiple materials are modelled in other software and imported into Godot. Multiple materials are
supported. There are some restrictions for geometry: supported. There are some restrictions for geometry:
@ -93,7 +93,7 @@ supported. There are some restrictions for geometry:
CSGCombiner CSGCombiner
~~~~~~~~~~~ ~~~~~~~~~~~
The :ref:`CSGCombiner <class_CSGCombiner>` node is an empty shape used for The `CSGCombiner <class_CSGCombiner>` node is an empty shape used for
organization. It will only combine children nodes. organization. It will only combine children nodes.
Processing order Processing order
@ -249,7 +249,7 @@ or a city; explore its limitations when designing your game.
Using prototype textures Using prototype textures
------------------------ ------------------------
Godot's :ref:`doc_spatial_material` supports *triplanar mapping*, which can be Godot's `doc_spatial_material` supports *triplanar mapping*, which can be
used to automatically apply a texture to arbitrary objects without distortion. used to automatically apply a texture to arbitrary objects without distortion.
This is handy when using CSG as Godot doesn't support editing UV maps on CSG This is handy when using CSG as Godot doesn't support editing UV maps on CSG
nodes yet. Triplanar mapping is relatively slow, which usually restricts its nodes yet. Triplanar mapping is relatively slow, which usually restricts its

View File

@ -7,11 +7,11 @@ Introduction
------------ ------------
.. note:: This feature is only available when using the GLES3 backend. .. note:: This feature is only available when using the GLES3 backend.
:ref:`doc_baked_lightmaps` can be used as an alternative `doc_baked_lightmaps` can be used as an alternative
when using the GLES2 renderer. when using the GLES2 renderer.
Just like with :ref:`doc_reflection_probes`, and as stated in Just like with `doc_reflection_probes`, and as stated in
the :ref:`doc_spatial_material`, objects can show reflected or diffuse light. the `doc_spatial_material`, objects can show reflected or diffuse light.
GI Probes are similar to Reflection Probes, but they use a different and more GI Probes are similar to Reflection Probes, but they use a different and more
complex technique to produce indirect light and reflections. complex technique to produce indirect light and reflections.

View File

@ -101,7 +101,7 @@ Scene linear to display-referred nonlinear
After all the rendering is done, the scene linear render requires transforming After all the rendering is done, the scene linear render requires transforming
to a suitable output such as an sRGB display. To do this, enable sRGB conversion to a suitable output such as an sRGB display. To do this, enable sRGB conversion
in the current :ref:`Environment <class_Environment>` (more on that below). in the current `Environment <class_Environment>` (more on that below).
Keep in mind that the **sRGB -> Display Linear** and **Display Linear -> sRGB** Keep in mind that the **sRGB -> Display Linear** and **Display Linear -> sRGB**
conversions must always be **both** enabled. Failing to enable one of them will conversions must always be **both** enabled. Failing to enable one of them will
@ -111,8 +111,8 @@ indie games.
Parameters of HDR Parameters of HDR
----------------- -----------------
HDR settings can be found in the :ref:`Environment <class_Environment>` HDR settings can be found in the `Environment <class_Environment>`
resource. Most of the time, these are found inside a resource. Most of the time, these are found inside a
:ref:`WorldEnvironment <class_WorldEnvironment>` `WorldEnvironment <class_WorldEnvironment>`
node or set in a Camera node. For more information, see node or set in a Camera node. For more information, see
:ref:`doc_environment_and_post_processing`. `doc_environment_and_post_processing`.

View File

@ -12,16 +12,16 @@ the 3D platformer tutorial, or the 3D kinematic character tutorials,
which are almost identical to their 2D counterparts. which are almost identical to their 2D counterparts.
In 3D, math is a little more complex than in 2D, so also checking the In 3D, math is a little more complex than in 2D, so also checking the
:ref:`doc_vector_math` entry in the wiki (which was especially created for game `doc_vector_math` entry in the wiki (which was especially created for game
developers, not mathematicians or engineers) will help pave the way for you developers, not mathematicians or engineers) will help pave the way for you
to develop 3D games efficiently. to develop 3D games efficiently.
Spatial node Spatial node
~~~~~~~~~~~~ ~~~~~~~~~~~~
:ref:`Node2D <class_Node2D>` is the base node for 2D. `Node2D <class_Node2D>` is the base node for 2D.
:ref:`Control <class_Control>` is the base node for everything GUI. `Control <class_Control>` is the base node for everything GUI.
Following this reasoning, the 3D engine uses the :ref:`Spatial <class_Spatial>` Following this reasoning, the 3D engine uses the `Spatial <class_Spatial>`
node for everything 3D. node for everything 3D.
.. image:: img/tuto_3d1.png .. image:: img/tuto_3d1.png
@ -29,7 +29,7 @@ node for everything 3D.
Spatial nodes have a local transform, which is relative to the parent Spatial nodes have a local transform, which is relative to the parent
node (as long as the parent node is also of **or inherits from** the type node (as long as the parent node is also of **or inherits from** the type
Spatial). This transform can be accessed as a 4×3 Spatial). This transform can be accessed as a 4×3
:ref:`Transform <class_Transform>`, or as 3 :ref:`Vector3 <class_Vector3>` `Transform <class_Transform>`, or as 3 `Vector3 <class_Vector3>`
members representing location, Euler rotation (X, Y and Z angles) and members representing location, Euler rotation (X, Y and Z angles) and
scale. scale.
@ -51,21 +51,21 @@ DCC-created models
(used to reference a non existing doc_importing_3d_meshes importer). (used to reference a non existing doc_importing_3d_meshes importer).
There are two pipelines to import 3D models in Godot. The first and most There are two pipelines to import 3D models in Godot. The first and most
common one is by :ref:`doc_importing_3d_scenes`, which allows you to import common one is by `doc_importing_3d_scenes`, which allows you to import
entire scenes (just as they look in the DCC), including animation, entire scenes (just as they look in the DCC), including animation,
skeletal rigs, blend shapes, etc. skeletal rigs, blend shapes, etc.
The second pipeline is by importing simple .OBJ files as mesh resources, The second pipeline is by importing simple .OBJ files as mesh resources,
which can be then put inside a :ref:`MeshInstance <class_MeshInstance>` which can be then put inside a `MeshInstance <class_MeshInstance>`
node for display. node for display.
Generated geometry Generated geometry
------------------ ------------------
It is possible to create custom geometry by using the It is possible to create custom geometry by using the
:ref:`ArrayMesh <class_ArrayMesh>` resource directly. Simply create your arrays `ArrayMesh <class_ArrayMesh>` resource directly. Simply create your arrays
and use the :ref:`ArrayMesh.add_surface_from_arrays() <class_ArrayMesh_method_add_surface_from_arrays>` and use the `ArrayMesh.add_surface_from_arrays() <class_ArrayMesh_method_add_surface_from_arrays>`
function. A helper class is also available, :ref:`SurfaceTool <class_SurfaceTool>`, function. A helper class is also available, `SurfaceTool <class_SurfaceTool>`,
which provides a more straightforward API and helpers for indexing, which provides a more straightforward API and helpers for indexing,
generating normals, tangents, etc. generating normals, tangents, etc.
@ -78,7 +78,7 @@ Immediate geometry
If, instead, there is a requirement to generate simple geometry that If, instead, there is a requirement to generate simple geometry that
will be updated often, Godot provides a special node, will be updated often, Godot provides a special node,
:ref:`ImmediateGeometry <class_ImmediateGeometry>`, `ImmediateGeometry <class_ImmediateGeometry>`,
which provides an OpenGL 1.x style immediate-mode API to create points, which provides an OpenGL 1.x style immediate-mode API to create points,
lines, triangles, etc. lines, triangles, etc.
@ -88,8 +88,8 @@ lines, triangles, etc.
While Godot packs a powerful 2D engine, many types of games use 2D in a While Godot packs a powerful 2D engine, many types of games use 2D in a
3D environment. By using a fixed camera (either orthogonal or 3D environment. By using a fixed camera (either orthogonal or
perspective) that does not rotate, nodes such as perspective) that does not rotate, nodes such as
:ref:`Sprite3D <class_Sprite3D>` and `Sprite3D <class_Sprite3D>` and
:ref:`AnimatedSprite3D <class_AnimatedSprite3D>` `AnimatedSprite3D <class_AnimatedSprite3D>`
can be used to create 2D games that take advantage of mixing with 3D can be used to create 2D games that take advantage of mixing with 3D
backgrounds, more realistic parallax, lighting/shadow effects, etc. backgrounds, more realistic parallax, lighting/shadow effects, etc.
@ -101,7 +101,7 @@ Environment
~~~~~~~~~~~ ~~~~~~~~~~~
Besides editing a scene, it is often common to edit the environment. Besides editing a scene, it is often common to edit the environment.
Godot provides a :ref:`WorldEnvironment <class_WorldEnvironment>` Godot provides a `WorldEnvironment <class_WorldEnvironment>`
node that allows changing the background color, mode (as in, put a node that allows changing the background color, mode (as in, put a
skybox), and applying several types of built-in post-processing effects. skybox), and applying several types of built-in post-processing effects.
Environments can also be overridden in the Camera. Environments can also be overridden in the Camera.
@ -193,7 +193,7 @@ Cameras
------- -------
No matter how many objects are placed in the 3D space, nothing will be No matter how many objects are placed in the 3D space, nothing will be
displayed unless a :ref:`Camera <class_Camera>` is displayed unless a `Camera <class_Camera>` is
also added to the scene. Cameras can work in either orthogonal or also added to the scene. Cameras can work in either orthogonal or
perspective projections: perspective projections:

View File

@ -13,11 +13,11 @@ result. Light can come from several types of sources in a scene:
it does not affect nearby objects unless baked). it does not affect nearby objects unless baked).
- Light Nodes: Directional, Omni and Spot. - Light Nodes: Directional, Omni and Spot.
- Ambient Light in the - Ambient Light in the
:ref:`Environment <class_Environment>`. `Environment <class_Environment>`.
- Baked Light (read :ref:`doc_baked_lightmaps`). - Baked Light (read `doc_baked_lightmaps`).
The emission color is a material property. You can read more about it The emission color is a material property. You can read more about it
in the :ref:`doc_spatial_material` tutorial. in the `doc_spatial_material` tutorial.
Light nodes Light nodes
----------- -----------
@ -31,11 +31,11 @@ parameters for lights:
Each one has a specific function: Each one has a specific function:
- **Color**: Base color for emitted light. - **Color**: Base color for emitted light.
- **Energy**: Energy multiplier. This is useful for saturating lights or working with :ref:`doc_high_dynamic_range`. - **Energy**: Energy multiplier. This is useful for saturating lights or working with `doc_high_dynamic_range`.
- **Indirect Energy**: Secondary multiplier used with indirect light (light bounces). This works in baked light or GIProbe. - **Indirect Energy**: Secondary multiplier used with indirect light (light bounces). This works in baked light or GIProbe.
- **Negative**: Light becomes subtractive instead of additive. It's sometimes useful to manually compensate some dark corners. - **Negative**: Light becomes subtractive instead of additive. It's sometimes useful to manually compensate some dark corners.
- **Specular**: Affects the intensity of the specular blob in objects affected by this light. At zero, this light becomes a pure diffuse light. - **Specular**: Affects the intensity of the specular blob in objects affected by this light. At zero, this light becomes a pure diffuse light.
- **Bake Mode**: Sets the bake mode for the light. For more information see :ref:`doc_baked_lightmaps` - **Bake Mode**: Sets the bake mode for the light. For more information see `doc_baked_lightmaps`
- **Cull Mask**: Objects that are in the selected layers below will be affected by this light. - **Cull Mask**: Objects that are in the selected layers below will be affected by this light.
Note that objects disabled via this cull mask will still cast shadows. Note that objects disabled via this cull mask will still cast shadows.
If you don't want disabled objects to cast shadows, adjust the ``cast_shadow`` property on the If you don't want disabled objects to cast shadows, adjust the ``cast_shadow`` property on the

View File

@ -3,9 +3,9 @@
Occluder Nodes Occluder Nodes
============== ==============
In addition to occlusion via :ref:`doc_rooms_and_portals`, Godot also has the ability to provide basic occlusion using simple geometric ``Occluder`` nodes. These are geometric shapes that are shown in the editor using gizmos, but are invisible at runtime. In addition to occlusion via `doc_rooms_and_portals`, Godot also has the ability to provide basic occlusion using simple geometric ``Occluder`` nodes. These are geometric shapes that are shown in the editor using gizmos, but are invisible at runtime.
Any object that is fully occluded by the shape (behind or in some cases inside) will be culled at runtime. They are designed to be simple to use and inexpensive at runtime, but the trade off is they may not be as effective at culling as :ref:`doc_rooms_and_portals`. Nevertheless they can still significantly boost performance in some situations. Any object that is fully occluded by the shape (behind or in some cases inside) will be culled at runtime. They are designed to be simple to use and inexpensive at runtime, but the trade off is they may not be as effective at culling as `doc_rooms_and_portals`. Nevertheless they can still significantly boost performance in some situations.
.. note:: It is important to understand that geometric occluders work by testing the axis aligned bounding box (``AABB``) of the occludee against the occluder. The AABB must be *fully occluded* to be culled. The consequence of this is that smaller objects are more likely to be effectively culled than larger objects, and larger occluders tend to be much more effective than smaller ones. .. note:: It is important to understand that geometric occluders work by testing the axis aligned bounding box (``AABB``) of the occludee against the occluder. The AABB must be *fully occluded* to be culled. The consequence of this is that smaller objects are more likely to be effectively culled than larger objects, and larger occluders tend to be much more effective than smaller ones.

View File

@ -17,7 +17,7 @@ This works because if a monster is in an area that is completely out of view for
How does a monster know whether it is within the gameplay area? How does a monster know whether it is within the gameplay area?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This problem is solved because the portal system contains a subsystem called the **Gameplay Monitor** that can be turned on and off from the :ref:`RoomManager<class_RoomManager>`. When switched on, any roaming objects that move inside or outside the gameplay area (whether by moving themselves, or the camera moving) will receive callbacks to let them know of this change. This problem is solved because the portal system contains a subsystem called the **Gameplay Monitor** that can be turned on and off from the `RoomManager<class_RoomManager>`. When switched on, any roaming objects that move inside or outside the gameplay area (whether by moving themselves, or the camera moving) will receive callbacks to let them know of this change.
You can choose to either receive these callbacks as ``signals``, or as ``notifications``. You can choose to either receive these callbacks as ``signals``, or as ``notifications``.
@ -41,7 +41,7 @@ VisbilityNotifiers / VisibilityEnablers
Gameplay callbacks have one more useful function. By default in Godot, animation and physics are still processed regardless of whether an object is within view. This can sap performance, especially when using software skinning. Gameplay callbacks have one more useful function. By default in Godot, animation and physics are still processed regardless of whether an object is within view. This can sap performance, especially when using software skinning.
The engine's solution to this problem is the :ref:`VisibilityNotifier<class_VisibilityNotifier>` node, and its slightly easier to use variation, the :ref:`VisibilityEnabler<class_VisibilityEnabler>` node. VisibilityEnabler can be used to switch off animation and sleep physics when an object is outside the view frustum. You do this by simply placing a VisibilityEnabler node in your subscene (for e.g. a monster). It will do the rest. Consult the :ref:`VisibilityEnabler<class_VisibilityEnabler>` documentation for full details. The engine's solution to this problem is the `VisibilityNotifier<class_VisibilityNotifier>` node, and its slightly easier to use variation, the `VisibilityEnabler<class_VisibilityEnabler>` node. VisibilityEnabler can be used to switch off animation and sleep physics when an object is outside the view frustum. You do this by simply placing a VisibilityEnabler node in your subscene (for e.g. a monster). It will do the rest. Consult the `VisibilityEnabler<class_VisibilityEnabler>` documentation for full details.
.. image:: img/visibility_enabler.png .. image:: img/visibility_enabler.png
@ -52,11 +52,11 @@ What if the VisibilityEnabler could turn off objects when they were occlusion cu
RoomGroups RoomGroups
~~~~~~~~~~ ~~~~~~~~~~
A :ref:`RoomGroup<class_RoomGroup>` is a special node which allows you to deal with a group of rooms at once, instead of having write code for them individually. This is especially useful in conjunction with gameplay callbacks. The most important use for RoomGroups is to delineate between "inside" and "outside" areas. A `RoomGroup<class_RoomGroup>` is a special node which allows you to deal with a group of rooms at once, instead of having write code for them individually. This is especially useful in conjunction with gameplay callbacks. The most important use for RoomGroups is to delineate between "inside" and "outside" areas.
.. image:: img/roomgroups.png .. image:: img/roomgroups.png
For instance, when outside you may wish to use a :ref:`DirectionalLight<class_DirectionalLight>` to represent the sun. When the outside RoomGroup receives an ``enter gameplay`` callback, you can turn the light on, and you can turn it off when the RoomGroup exits gameplay. With the light off, performance will increase as there is no need to render it indoors. For instance, when outside you may wish to use a `DirectionalLight<class_DirectionalLight>` to represent the sun. When the outside RoomGroup receives an ``enter gameplay`` callback, you can turn the light on, and you can turn it off when the RoomGroup exits gameplay. With the light off, performance will increase as there is no need to render it indoors.
This is an example of a simple RoomGroup script to turn on and off a DirectionalLight. Note that you can also use signals for callbacks (the choice is up to you): This is an example of a simple RoomGroup script to turn on and off a DirectionalLight. Note that you can also use signals for callbacks (the choice is up to you):

View File

@ -8,9 +8,9 @@ Putting all the ideas together, here is an example scene tree:
.. image:: img/example_scenetree.png .. image:: img/example_scenetree.png
- We have used a :ref:`RoomGroup<class_RoomGroup>` to denote an outside area. - We have used a `RoomGroup<class_RoomGroup>` to denote an outside area.
- The :ref:`MeshInstance<class_MeshInstance>`\ s inside the :ref:`Room<class_Room>`\ s are either ``STATIC`` or ``DYNAMIC``. - The `MeshInstance<class_MeshInstance>`\ s inside the `Room<class_Room>`\ s are either ``STATIC`` or ``DYNAMIC``.
- We have created a :ref:`Spatial<class_Spatial>` (I decided to call it 'Freeform', but you could use any name) under which to place ``STATIC`` and ``DYNAMIC`` objects that will be autoplaced in rooms - We have created a `Spatial<class_Spatial>` (I decided to call it 'Freeform', but you could use any name) under which to place ``STATIC`` and ``DYNAMIC`` objects that will be autoplaced in rooms
(Freeform is inside the ``roomlist``, but *not* inside a room.) (Freeform is inside the ``roomlist``, but *not* inside a room.)
- The player and the monsters are on branches *OUTSIDE* the ``roomlist``. - The player and the monsters are on branches *OUTSIDE* the ``roomlist``.
- The player and monster meshes have portal mode ``ROAMING`` so they can be in any room. - The player and monster meshes have portal mode ``ROAMING`` so they can be in any room.
@ -26,9 +26,9 @@ Although you can create your room system entirely within the editor, you can als
Postfix convention Postfix convention
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
- ``-room`` becomes a :ref:`Room<class_Room>`. - ``-room`` becomes a `Room<class_Room>`.
- ``-roomgroup`` becomes a :ref:`RoomGroup<class_RoomGroup>`. - ``-roomgroup`` becomes a `RoomGroup<class_RoomGroup>`.
- ``-portal`` becomes a :ref:`Portal<class_Portal>`. - ``-portal`` becomes a `Portal<class_Portal>`.
- ``-bound`` becomes a manual bound. - ``-bound`` becomes a manual bound.
Rooms and RoomGroups should be created as Empties within Blender. Any mesh children of the ``-room`` Empty will thus be placed in the Room during conversion in Godot. Rooms and RoomGroups should be created as Empties within Blender. Any mesh children of the ``-room`` Empty will thus be placed in the Room during conversion in Godot.
@ -44,7 +44,7 @@ Portals
Portals are different from Rooms. In Portals, we need to specify the geometry of the Portal in our modelling tool, in addition to just the name. To do this your "portal-to-be" should be created as a Mesh. Portals are different from Rooms. In Portals, we need to specify the geometry of the Portal in our modelling tool, in addition to just the name. To do this your "portal-to-be" should be created as a Mesh.
Portal meshes have some restrictions to work properly. They must be convex, and the polygon points should be in the same plane. The accuracy to the plane does not have to be exact, as Godot will automatically average the direction of the portal plane. Once converted to a :ref:`Portal<class_Portal>` node, the snapping to the portal plane is enforced, and the vertices are specified (and editable) as 2D coordinates in the inspector, rather than 3D points. Portal meshes have some restrictions to work properly. They must be convex, and the polygon points should be in the same plane. The accuracy to the plane does not have to be exact, as Godot will automatically average the direction of the portal plane. Once converted to a `Portal<class_Portal>` node, the snapping to the portal plane is enforced, and the vertices are specified (and editable) as 2D coordinates in the inspector, rather than 3D points.
The portal's naming is quite important. You can either name the portal ``-portal`` which will attempt to autolink the Portal in Godot, or you can use the name of the Room you wish to link the Portal to as a prefix. The portal's naming is quite important. You can either name the portal ``-portal`` which will attempt to autolink the Portal in Godot, or you can use the name of the Room you wish to link the Portal to as a prefix.

View File

@ -4,7 +4,7 @@ First steps with Rooms and Portals
The RoomManager The RoomManager
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
Anytime you want to use the portal system, you need to include a special node in your scene tree, called the :ref:`RoomManager<class_RoomManager>`. The RoomManager is responsible for the runtime maintenance of the system, especially converting the objects in your rooms into a *room graph* which is used at runtime to perform occlusion culling and other tasks. Anytime you want to use the portal system, you need to include a special node in your scene tree, called the `RoomManager<class_RoomManager>`. The RoomManager is responsible for the runtime maintenance of the system, especially converting the objects in your rooms into a *room graph* which is used at runtime to perform occlusion culling and other tasks.
Room Conversion Room Conversion
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
@ -40,7 +40,7 @@ Rooms
What is a room? What is a room?
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
:ref:`Room<class_Room>`\ s are a way of spatially partitioning your level into areas that make sense in terms of level design. Rooms often quite literally *are* rooms (like in a building). Ultimately though, as far as the engine is concerned, a room represents a **non-overlapping** convex volume in which you typically place most of your objects that fall within that area. `Room<class_Room>`\ s are a way of spatially partitioning your level into areas that make sense in terms of level design. Rooms often quite literally *are* rooms (like in a building). Ultimately though, as far as the engine is concerned, a room represents a **non-overlapping** convex volume in which you typically place most of your objects that fall within that area.
A room doesn't need to correspond to a literal room. It could, for example, also be a canyon in an outdoor area or a smaller part of a concave room. With a little imagination, you can use the system in almost any scenario. A room doesn't need to correspond to a literal room. It could, for example, also be a canyon in an outdoor area or a smaller part of a concave room. With a little imagination, you can use the system in almost any scenario.
@ -64,12 +64,12 @@ If you accidentally create overlapping rooms, the editor will warn you when you
The system does attempt to cope with overlapping rooms as best as possible by making the current room *"sticky"*. Each object remembers which room it was in during the previous frame and stays within it as long as it does not move outside the convex hull room bound. This can result in some hysteresis in these overlapping zones. The system does attempt to cope with overlapping rooms as best as possible by making the current room *"sticky"*. Each object remembers which room it was in during the previous frame and stays within it as long as it does not move outside the convex hull room bound. This can result in some hysteresis in these overlapping zones.
There is one exception, however, for :ref:`internal rooms<doc_rooms_and_portals_internal_rooms>`. You do not have to worry about these to start with. There is one exception, however, for `internal rooms<doc_rooms_and_portals_internal_rooms>`. You do not have to worry about these to start with.
How do I create a room? How do I create a room?
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
A :ref:`Room<class_Room>` is a node type that can be added to the scene tree like any other. You can place objects within the room by making them children and grand-children of the Room node. A `Room<class_Room>` is a node type that can be added to the scene tree like any other. You can place objects within the room by making them children and grand-children of the Room node.
How do I define the shape and position of my room convex hull? How do I define the shape and position of my room convex hull?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -77,8 +77,8 @@ How do I define the shape and position of my room convex hull?
Because defining the room bound is the most important aspect of the system, there are THREE methods available to define the shape of a room in Godot: Because defining the room bound is the most important aspect of the system, there are THREE methods available to define the shape of a room in Godot:
1. Use the geometry of the objects contained within the room to automatically create an approximate bound. 1. Use the geometry of the objects contained within the room to automatically create an approximate bound.
2. Manually edit the points that define the convex hull in the room inspector or drag the points around using the editor gizmo (see :ref:`doc_room_point_editing`). 2. Manually edit the points that define the convex hull in the room inspector or drag the points around using the editor gizmo (see `doc_room_point_editing`).
3. Provide a manual bound. This is a MeshInstance in the room that has geometry in the shape of the desired bound, with a name with the postfix ``-bound``. This is something you might choose to do if you create your levels in Blender or similar (see :ref:`doc_rooms_and_portals_blender`). 3. Provide a manual bound. This is a MeshInstance in the room that has geometry in the shape of the desired bound, with a name with the postfix ``-bound``. This is something you might choose to do if you create your levels in Blender or similar (see `doc_rooms_and_portals_blender`).
While the first option can be all that is required, particularly with simple rooms or for pre-production, using manual bounds gives you ultimate control at the expense of a small amount of editing. You can also combine the two approaches, perhaps using automatic bounds for most rooms but manually editing problem areas. While the first option can be all that is required, particularly with simple rooms or for pre-production, using manual bounds gives you ultimate control at the expense of a small amount of editing. You can also combine the two approaches, perhaps using automatic bounds for most rooms but manually editing problem areas.
@ -93,7 +93,7 @@ Portals
If you create some rooms, place objects within them, then convert the level in the editor, you will see the objects in the rooms appearing and showing as you move between rooms. There is one problem, however! Although you can see the objects within the room that the camera is in, you can't see to any neighbouring rooms! For that we need portals. If you create some rooms, place objects within them, then convert the level in the editor, you will see the objects in the rooms appearing and showing as you move between rooms. There is one problem, however! Although you can see the objects within the room that the camera is in, you can't see to any neighbouring rooms! For that we need portals.
:ref:`Portal<class_Portal>`\ s are special convex polygons that you position over the openings between rooms in order to allow the system to see between them. You can create a portal node directly in the editor. The default portal has 4 points and behaves much like a ``plane`` :ref:`MeshInstance<class_MeshInstance>`. You can add or remove points using the inspector. A portal requires at least 3 points to work - this is because it needs to form a polygon rather than a point or line. `Portal<class_Portal>`\ s are special convex polygons that you position over the openings between rooms in order to allow the system to see between them. You can create a portal node directly in the editor. The default portal has 4 points and behaves much like a ``plane`` `MeshInstance<class_MeshInstance>`. You can add or remove points using the inspector. A portal requires at least 3 points to work - this is because it needs to form a polygon rather than a point or line.
To save editing effort, **only one Portal is required between each pair of Rooms**. You *do not need* to (and indeed should not) create two Portals that overlap in opposite directions. Portals default to being two-way, but you can make them one-way in the Portal inspector. To save editing effort, **only one Portal is required between each pair of Rooms**. You *do not need* to (and indeed should not) create two Portals that overlap in opposite directions. Portals default to being two-way, but you can make them one-way in the Portal inspector.

View File

@ -3,7 +3,7 @@
Introduction to Rooms and Portals Introduction to Rooms and Portals
================================= =================================
The rooms and portals system is an optional component of Godot that allows you to partition your 3D game levels into a series of :ref:`Room<class_Room>` s (*aka cells*), and :ref:`Portal<class_Portal>` s. Portals are openings between the rooms that the :ref:`Camera<class_Camera>` (and lights) can see through. The rooms and portals system is an optional component of Godot that allows you to partition your 3D game levels into a series of `Room<class_Room>` s (*aka cells*), and `Portal<class_Portal>` s. Portals are openings between the rooms that the `Camera<class_Camera>` (and lights) can see through.
This allows several features: This allows several features:

View File

@ -16,13 +16,13 @@ Step 1
.. image:: tutorial_simple/img/tutorial_simple_1.png .. image:: tutorial_simple/img/tutorial_simple_1.png
- Create a new project. - Create a new project.
- Add a :ref:`Spatial<class_Spatial>` as the scene root (on the screenshot, it's called "Root"). - Add a `Spatial<class_Spatial>` as the scene root (on the screenshot, it's called "Root").
- Next add a :ref:`RoomManager<class_RoomManager>` node. We will need this later to process the room system. - Next add a `RoomManager<class_RoomManager>` node. We will need this later to process the room system.
- Next we need to start defining our rooms. We create all our rooms under another Spatial we have called 'RoomList'. - Next we need to start defining our rooms. We create all our rooms under another Spatial we have called 'RoomList'.
- Add a new :ref:`Room<class_Room>` node as a child of the roomlist. - Add a new `Room<class_Room>` node as a child of the roomlist.
- We have named the room ``Kitchen``. - We have named the room ``Kitchen``.
- We will now create the geometry of our room. The names you give to the geometry is up to you. - We will now create the geometry of our room. The names you give to the geometry is up to you.
- Create a :ref:`MeshInstance<class_MeshInstance>` for the floor. Create a box by adding a CubeMesh resource to the MeshInstance. Scale and position it to form a floor. - Create a `MeshInstance<class_MeshInstance>` for the floor. Create a box by adding a CubeMesh resource to the MeshInstance. Scale and position it to form a floor.
- Create MeshInstances for the walls. Create more box meshes for this, then scale and position them. Be sure to leave an opening on one side. You will need to create two wall segments to do this on that side. - Create MeshInstances for the walls. Create more box meshes for this, then scale and position them. Be sure to leave an opening on one side. You will need to create two wall segments to do this on that side.
Step 2 Step 2
@ -41,7 +41,7 @@ Step 3
.. image:: tutorial_simple/img/tutorial_simple_3.png .. image:: tutorial_simple/img/tutorial_simple_3.png
- Next, we will add a portal between the two rooms. - Next, we will add a portal between the two rooms.
- Create a new :ref:`Portal<class_Portal>` in the kitchen. - Create a new `Portal<class_Portal>` in the kitchen.
- Scale and position the portal using the node ``Transform`` in the inspector, so it fits within the opening between the two rooms. - Scale and position the portal using the node ``Transform`` in the inspector, so it fits within the opening between the two rooms.
- The portal plane should face *outward* from the source room, i.e. towards the lounge. This direction is indicated by the arrow in the editor gizmo, and portal gizmo's color. - The portal plane should face *outward* from the source room, i.e. towards the lounge. This direction is indicated by the arrow in the editor gizmo, and portal gizmo's color.
@ -54,7 +54,7 @@ Step 4
- Placing these boxes as children or grandchildren of the room nodes explicitly tells the system which room the objects should be in. However, we can also create these objects *outside* the rooms. Provided they are in the RoomList branch, the system will attempt to automatically place them in the correct room at runtime. - Placing these boxes as children or grandchildren of the room nodes explicitly tells the system which room the objects should be in. However, we can also create these objects *outside* the rooms. Provided they are in the RoomList branch, the system will attempt to automatically place them in the correct room at runtime.
- On the screenshot, the boxes were places as children of a Spatial I have called ``Freeform`` to keep things tidy. - On the screenshot, the boxes were places as children of a Spatial I have called ``Freeform`` to keep things tidy.
- Boxes also have a green SpatialMaterial assigned to them to make them stand out more from the rest of the room. - Boxes also have a green SpatialMaterial assigned to them to make them stand out more from the rest of the room.
- Let's also create an :ref:`OmniLight<class_OmniLight>` so it will be autoplaced in one of the rooms. - Let's also create an `OmniLight<class_OmniLight>` so it will be autoplaced in one of the rooms.
Step 5 Step 5
~~~~~~ ~~~~~~

View File

@ -1,12 +1,12 @@
Using objects in Rooms and Portals Using objects in Rooms and Portals
================================== ==================================
Normally, when you use Godot, all objects that you can see (:ref:`VisualInstance<class_VisualInstance>`\ s) are treated in the same way by the engine. The portal renderer is slightly different, in that it makes a distinction between the different roles objects will have in your game. It makes this distinction to define the :ref:`Room<class_Room>`\ s, and to render and process everything in the most efficient way. Normally, when you use Godot, all objects that you can see (`VisualInstance<class_VisualInstance>`\ s) are treated in the same way by the engine. The portal renderer is slightly different, in that it makes a distinction between the different roles objects will have in your game. It makes this distinction to define the `Room<class_Room>`\ s, and to render and process everything in the most efficient way.
Portal mode Portal mode
~~~~~~~~~~~ ~~~~~~~~~~~
If you look in the inspector, every VisualInstance in Godot is derived from a :ref:`CullInstance<class_CullInstance>`, where you can set a ``PortalMode``. This determines how objects will behave in the portal system. If you look in the inspector, every VisualInstance in Godot is derived from a `CullInstance<class_CullInstance>`, where you can set a ``PortalMode``. This determines how objects will behave in the portal system.
.. image:: img/cull_instance.png .. image:: img/cull_instance.png
@ -90,6 +90,6 @@ While sprawling works great for large moving objects, it also gives you a lot mo
Lighting Lighting
~~~~~~~~ ~~~~~~~~
In general lights are handled like any other visual instance. They can be placed in rooms, and they will sprawl to affect neighbouring rooms, following the dimensions and direction of the light. The exception to this is :ref:`DirectionalLight<class_DirectionalLight>`\ s. DirectionalLights have no source room as they affect *everywhere*. They should therefore not be placed in a room. As DirectionalLights can be expensive, it is a good idea to turn them off when inside, see the later :ref:`doc_rooms_and_portals_roomgroups` section for details on how to do this. In general lights are handled like any other visual instance. They can be placed in rooms, and they will sprawl to affect neighbouring rooms, following the dimensions and direction of the light. The exception to this is `DirectionalLight<class_DirectionalLight>`\ s. DirectionalLights have no source room as they affect *everywhere*. They should therefore not be placed in a room. As DirectionalLights can be expensive, it is a good idea to turn them off when inside, see the later `doc_rooms_and_portals_roomgroups` section for details on how to do this.
Congratulations! You have now mastered the intermediate techniques required to use rooms and portals. You can use these to make games already, but there are many more features. Congratulations! You have now mastered the intermediate techniques required to use rooms and portals. You can use these to make games already, but there are many more features.

View File

@ -3,21 +3,21 @@
Using the ArrayMesh Using the ArrayMesh
=================== ===================
This tutorial will present the basics of using an :ref:`ArrayMesh <class_arraymesh>`. This tutorial will present the basics of using an `ArrayMesh <class_arraymesh>`.
To do so, we will use the function :ref:`add_surface_from_arrays() <class_ArrayMesh_method_add_surface_from_arrays>`, To do so, we will use the function `add_surface_from_arrays() <class_ArrayMesh_method_add_surface_from_arrays>`,
which takes up to four parameters. The first two are required, while the second two are optional. which takes up to four parameters. The first two are required, while the second two are optional.
The first parameter is the ``PrimitiveType``, an OpenGL concept that instructs the GPU The first parameter is the ``PrimitiveType``, an OpenGL concept that instructs the GPU
how to arrange the primitive based on the vertices given, i.e. whether they represent triangles, how to arrange the primitive based on the vertices given, i.e. whether they represent triangles,
lines, points, etc. See :ref:`Mesh.PrimitiveType <enum_Mesh_PrimitiveType>` for the options available. lines, points, etc. See `Mesh.PrimitiveType <enum_Mesh_PrimitiveType>` for the options available.
The second parameter, ``arrays``, is the actual Array that stores the mesh information. The array is a The second parameter, ``arrays``, is the actual Array that stores the mesh information. The array is a
normal Godot array that is constructed with empty brackets ``[]``. It stores a ``Pool**Array`` normal Godot array that is constructed with empty brackets ``[]``. It stores a ``Pool**Array``
(e.g. PoolVector3Array, PoolIntArray, etc.) for each type of information that will be used to build the surface. (e.g. PoolVector3Array, PoolIntArray, etc.) for each type of information that will be used to build the surface.
The possible elements of ``arrays`` are listed below, together with the position they must have within ``arrays``. The possible elements of ``arrays`` are listed below, together with the position they must have within ``arrays``.
See also :ref:`Mesh.ArrayType <enum_Mesh_ArrayType>`. See also `Mesh.ArrayType <enum_Mesh_ArrayType>`.
.. list-table:: .. list-table::
@ -32,40 +32,40 @@ See also :ref:`Mesh.ArrayType <enum_Mesh_ArrayType>`.
* - 0 * - 0
- ``ARRAY_VERTEX`` - ``ARRAY_VERTEX``
- :ref:`PoolVector3Array <class_PoolVector3Array>` or :ref:`PoolVector2Array <class_PoolVector2Array>` - `PoolVector3Array <class_PoolVector3Array>` or `PoolVector2Array <class_PoolVector2Array>`
* - 1 * - 1
- ``ARRAY_NORMAL`` - ``ARRAY_NORMAL``
- :ref:`PoolVector3Array <class_PoolVector3Array>` - `PoolVector3Array <class_PoolVector3Array>`
* - 2 * - 2
- ``ARRAY_TANGENT`` - ``ARRAY_TANGENT``
- :ref:`PoolRealArray <class_PoolRealArray>` of groups of 4 floats. First 3 floats determine the tangent, and - `PoolRealArray <class_PoolRealArray>` of groups of 4 floats. First 3 floats determine the tangent, and
the last the binormal direction as -1 or 1. the last the binormal direction as -1 or 1.
* - 3 * - 3
- ``ARRAY_COLOR`` - ``ARRAY_COLOR``
- :ref:`PoolColorArray <class_PoolColorArray>` - `PoolColorArray <class_PoolColorArray>`
* - 4 * - 4
- ``ARRAY_TEX_UV`` - ``ARRAY_TEX_UV``
- :ref:`PoolVector2Array <class_PoolVector2Array>` or :ref:`PoolVector3Array <class_PoolVector3Array>` - `PoolVector2Array <class_PoolVector2Array>` or `PoolVector3Array <class_PoolVector3Array>`
* - 5 * - 5
- ``ARRAY_TEX_UV2`` - ``ARRAY_TEX_UV2``
- :ref:`PoolVector2Array <class_PoolVector2Array>` or :ref:`PoolVector3Array <class_PoolVector3Array>` - `PoolVector2Array <class_PoolVector2Array>` or `PoolVector3Array <class_PoolVector3Array>`
* - 6 * - 6
- ``ARRAY_BONES`` - ``ARRAY_BONES``
- :ref:`PoolRealArray <class_PoolRealArray>` of groups of 4 floats or :ref:`PoolIntArray <class_PoolIntArray>` of groups of 4 ints. Each group lists indexes of 4 bones that affects a given vertex. - `PoolRealArray <class_PoolRealArray>` of groups of 4 floats or `PoolIntArray <class_PoolIntArray>` of groups of 4 ints. Each group lists indexes of 4 bones that affects a given vertex.
* - 7 * - 7
- ``ARRAY_WEIGHTS`` - ``ARRAY_WEIGHTS``
- :ref:`PoolRealArray <class_PoolRealArray>` of groups of 4 floats. Each float lists the amount of weight an determined bone on ``ARRAY_BONES`` has on a given vertex. - `PoolRealArray <class_PoolRealArray>` of groups of 4 floats. Each float lists the amount of weight an determined bone on ``ARRAY_BONES`` has on a given vertex.
* - 8 * - 8
- ``ARRAY_INDEX`` - ``ARRAY_INDEX``
- :ref:`PoolIntArray <class_PoolIntArray>` - `PoolIntArray <class_PoolIntArray>`
The array of vertices (at index 0) is always required. The index array is optional and will only be used if included. We won't use it in this tutorial. The array of vertices (at index 0) is always required. The index array is optional and will only be used if included. We won't use it in this tutorial.
@ -73,12 +73,12 @@ All the other arrays carry information about the vertices. They are also optiona
use one entry per vertex to provide extra information about vertices. They must have the same size as the vertex array. Other arrays (e.g. ``ARRAY_TANGENT``) use use one entry per vertex to provide extra information about vertices. They must have the same size as the vertex array. Other arrays (e.g. ``ARRAY_TANGENT``) use
four entries to describe a single vertex. These must be exactly four times larger than the vertex array. four entries to describe a single vertex. These must be exactly four times larger than the vertex array.
For normal usage, the last two parameters in :ref:`add_surface_from_arrays() <class_arraymesh_method_add_surface_from_arrays>` are typically left empty. For normal usage, the last two parameters in `add_surface_from_arrays() <class_arraymesh_method_add_surface_from_arrays>` are typically left empty.
ArrayMesh ArrayMesh
--------- ---------
In the editor, create a :ref:`MeshInstance <class_meshinstance>` and add an :ref:`ArrayMesh <class_arraymesh>` to it in the Inspector. In the editor, create a `MeshInstance <class_meshinstance>` and add an `ArrayMesh <class_arraymesh>` to it in the Inspector.
Normally, adding an ArrayMesh in the editor is not useful, but in this case it allows us to access the ArrayMesh Normally, adding an ArrayMesh in the editor is not useful, but in this case it allows us to access the ArrayMesh
from code without creating one. from code without creating one.
@ -239,7 +239,7 @@ gdscript GDScript
Saving Saving
------ ------
Finally, we can use the :ref:`ResourceSaver <class_resourcesaver>` class to save the ArrayMesh. Finally, we can use the `ResourceSaver <class_resourcesaver>` class to save the ArrayMesh.
This is useful when you want to generate a mesh and then use it later without having to re-generate it. This is useful when you want to generate a mesh and then use it later without having to re-generate it.
gdscript GDScript gdscript GDScript

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