From 8835289fe7234e8555fe1e79271f98e9f733dc5b Mon Sep 17 00:00:00 2001 From: notPelf Date: Sun, 17 Nov 2024 05:22:00 -0500 Subject: [PATCH] Add info about layer mask exporting to physics_introduction.rst (#10242) * 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. --------- Co-authored-by: tetrapod <145553014+tetrapod00@users.noreply.github.com> --- tutorials/physics/physics_introduction.rst | 6 ++++++ tutorials/scripting/gdscript/gdscript_exports.rst | 2 ++ 2 files changed, 8 insertions(+) diff --git a/tutorials/physics/physics_introduction.rst b/tutorials/physics/physics_introduction.rst index b16b97754..98ad916e5 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:`doc_gdscript_exports_exporting_bit_flags`. + Area2D ------ diff --git a/tutorials/scripting/gdscript/gdscript_exports.rst b/tutorials/scripting/gdscript/gdscript_exports.rst index e8577aab8..9373c40ee 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 -------------------