From 20c818284f2e53436b0c7092472a98c44964a0e7 Mon Sep 17 00:00:00 2001 From: notPelf Date: Sun, 10 Nov 2024 11:28:56 -0500 Subject: [PATCH 1/4] Update physics_introduction.rst The docs page for raycasting provides a link to the physics introduction page for how to set a collision mask on a raycast created in code. The physics introduction page does not mention export annotations for exporting a collision mask. This pull request adds a brief bit about exporting layer masks, and links to the export annotation docs. --- tutorials/physics/physics_introduction.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tutorials/physics/physics_introduction.rst b/tutorials/physics/physics_introduction.rst index b16b97754ad..0c9686ef9b8 100644 --- a/tutorials/physics/physics_introduction.rst +++ b/tutorials/physics/physics_introduction.rst @@ -180,6 +180,12 @@ would be as follows:: # (2^(1-1)) + (2^(3-1)) + (2^(4-1)) = 1 + 4 + 8 = 13 pow(2, 1-1) + pow(2, 3-1) + pow(2, 4-1) +Export annotations can be used to export bitmasks in the editor with a user-friendly GUI:: + + # @export_flags_2d_physics var layers_2d_physics + +Additional export annotations are available for render and navigation layers, in both 2D and 3D. See :ref:`exporting_bit_flags` + Area2D ------ From 322a939b5773acb6b2539fc35511d393538a5624 Mon Sep 17 00:00:00 2001 From: notPelf Date: Sun, 10 Nov 2024 17:17:32 -0500 Subject: [PATCH 2/4] Update tutorials/physics/physics_introduction.rst Update cross-page link to use correct anchor format Co-authored-by: tetrapod <145553014+tetrapod00@users.noreply.github.com> --- tutorials/physics/physics_introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/physics/physics_introduction.rst b/tutorials/physics/physics_introduction.rst index 0c9686ef9b8..168291a0633 100644 --- a/tutorials/physics/physics_introduction.rst +++ b/tutorials/physics/physics_introduction.rst @@ -184,7 +184,7 @@ Export annotations can be used to export bitmasks in the editor with a user-frie # @export_flags_2d_physics var layers_2d_physics -Additional export annotations are available for render and navigation layers, in both 2D and 3D. See :ref:`exporting_bit_flags` +Additional export annotations are available for render and navigation layers, in both 2D and 3D. See :ref:`doc_gdscript_exports_exporting_bit_flags`. Area2D From cbef62325f7cd2538f5ec7f4a9bec3e4004618d4 Mon Sep 17 00:00:00 2001 From: notPelf Date: Sun, 10 Nov 2024 17:19:00 -0500 Subject: [PATCH 3/4] Update gdscript_exports.rst Added anchor for exporting bit flags section --- tutorials/scripting/gdscript/gdscript_exports.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tutorials/scripting/gdscript/gdscript_exports.rst b/tutorials/scripting/gdscript/gdscript_exports.rst index e8577aab82d..9373c40ee96 100644 --- a/tutorials/scripting/gdscript/gdscript_exports.rst +++ b/tutorials/scripting/gdscript/gdscript_exports.rst @@ -248,6 +248,8 @@ It must be noted that even if the script is not being run while in the editor, the exported properties are still editable. This can be used in conjunction with a :ref:`script in "tool" mode `. +.. _doc_gdscript_exports_exporting_bit_flags: + Exporting bit flags ------------------- From 62a73d84a63df45ec1b6c0417e77e6f180c96a69 Mon Sep 17 00:00:00 2001 From: notPelf Date: Sun, 10 Nov 2024 20:42:51 -0500 Subject: [PATCH 4/4] Update tutorials/physics/physics_introduction.rst Co-authored-by: tetrapod <145553014+tetrapod00@users.noreply.github.com> --- tutorials/physics/physics_introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/physics/physics_introduction.rst b/tutorials/physics/physics_introduction.rst index 168291a0633..98ad916e523 100644 --- a/tutorials/physics/physics_introduction.rst +++ b/tutorials/physics/physics_introduction.rst @@ -182,7 +182,7 @@ would be as follows:: Export annotations can be used to export bitmasks in the editor with a user-friendly GUI:: - # @export_flags_2d_physics var layers_2d_physics + @export_flags_2d_physics var layers_2d_physics Additional export annotations are available for render and navigation layers, in both 2D and 3D. See :ref:`doc_gdscript_exports_exporting_bit_flags`.