From 39c0392a64861b5f89717f6dc091c82bc1d72513 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 29 Mar 2023 20:39:04 +0200 Subject: Document using AnimatableBody when needed in StaticBody description (cherry picked from commit 68117d2fc7b68c544e16f8968b13d40b145c5bf4) --- doc/classes/AnimatableBody2D.xml | 2 +- doc/classes/AnimatableBody3D.xml | 2 +- doc/classes/StaticBody2D.xml | 4 ++-- doc/classes/StaticBody3D.xml | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/classes/AnimatableBody2D.xml b/doc/classes/AnimatableBody2D.xml index fbc2fb8509..7b0d356b5a 100644 --- a/doc/classes/AnimatableBody2D.xml +++ b/doc/classes/AnimatableBody2D.xml @@ -1,7 +1,7 @@ - Physics body for 2D physics which moves only by script or animation. Useful for moving platforms and doors. + Physics body for 2D physics which moves only by script or animation (while affecting other bodies on its path). Useful for moving platforms and doors. Animatable body for 2D physics. diff --git a/doc/classes/AnimatableBody3D.xml b/doc/classes/AnimatableBody3D.xml index 0733780bf7..617a4cc88f 100644 --- a/doc/classes/AnimatableBody3D.xml +++ b/doc/classes/AnimatableBody3D.xml @@ -1,7 +1,7 @@ - Physics body for 3D physics which moves only by script or animation. Useful for moving platforms and doors. + Physics body for 3D physics which moves only by script or animation (while affecting other bodies on its path). Useful for moving platforms and doors. Animatable body for 3D physics. diff --git a/doc/classes/StaticBody2D.xml b/doc/classes/StaticBody2D.xml index 2393790e12..acb291b7e1 100644 --- a/doc/classes/StaticBody2D.xml +++ b/doc/classes/StaticBody2D.xml @@ -1,13 +1,13 @@ - Physics body for 2D physics which is static or moves only by script. Useful for floor and walls. + Physics body for 2D physics which is static or moves only by script (without affecting other bodies on its path). Useful for floors and walls. Static body for 2D physics. A static body is a simple body that doesn't move under physics simulation, i.e. it can't be moved by external forces or contacts but its transformation can still be updated manually by the user. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidBody2D], it doesn't consume any CPU resources as long as they don't move. They have extra functionalities to move and affect other bodies: - [b]Static transform change:[/b] Static bodies can be moved by animation or script. In this case, they are just teleported and don't affect other bodies on their path. + [b]Static transform change:[/b] Static bodies [i]can[/i] be moved by animation or script. In this case, they are just teleported and don't affect other bodies on their path. Use [AnimatableBody2D] instead of [StaticBody2D] if you need a moving static body that affects other bodies on its path. [b]Constant velocity:[/b] When [member constant_linear_velocity] or [member constant_angular_velocity] is set, static bodies don't move themselves but affect touching bodies as if they were moving. This is useful for simulating conveyor belts or conveyor wheels. diff --git a/doc/classes/StaticBody3D.xml b/doc/classes/StaticBody3D.xml index 7bebd46004..a0e3c3fae5 100644 --- a/doc/classes/StaticBody3D.xml +++ b/doc/classes/StaticBody3D.xml @@ -1,14 +1,14 @@ - Physics body for 3D physics which is static or moves only by script. Useful for floor and walls. + Physics body for 3D physics which is static or moves only by script (without affecting other bodies on its path). Useful for floors and walls. Static body for 3D physics. A static body is a simple body that doesn't move under physics simulation, i.e. it can't be moved by external forces or contacts but its transformation can still be updated manually by the user. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidBody3D], it doesn't consume any CPU resources as long as they don't move. They have extra functionalities to move and affect other bodies: - [i]Static transform change:[/i] Static bodies can be moved by animation or script. In this case, they are just teleported and don't affect other bodies on their path. - [i]Constant velocity:[/i] When [member constant_linear_velocity] or [member constant_angular_velocity] is set, static bodies don't move themselves but affect touching bodies as if they were moving. This is useful for simulating conveyor belts or conveyor wheels. + [b]Static transform change:[/b] Static bodies [i]can[/i] be moved by animation or script. In this case, they are just teleported and don't affect other bodies on their path. Use [AnimatableBody3D] instead of [StaticBody3D] if you need a moving static body that affects other bodies on its path. + [b]Constant velocity:[/b] When [member constant_linear_velocity] or [member constant_angular_velocity] is set, static bodies don't move themselves but affect touching bodies as if they were moving. This is useful for simulating conveyor belts or conveyor wheels. [b]Warning:[/b] With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead. -- cgit v1.2.3 From f5721ca61ac0134907bf3dc20dc672f19a04b5a7 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 21 Apr 2023 02:04:58 +0200 Subject: =?UTF-8?q?Document=20custom=20mouse=20cursors=20larger=20than=201?= =?UTF-8?q?28=C3=97128=20potentially=20having=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 92730fb07dbeb7e3640d0bed60c9b9033bc30577) --- doc/classes/Input.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 70e629974d..ab9ed47b85 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -300,7 +300,7 @@ Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing [code]null[/code] to the image parameter resets to the system cursor. See [enum CursorShape] for the list of shapes. - [param image]'s size must be lower than 256×256. + [param image]'s size must be lower than or equal to 256×256. To avoid rendering issues, sizes lower than or equal to 128×128 are recommended. [param hotspot] must be within [param image]'s size. [b]Note:[/b] [AnimatedTexture]s aren't supported as custom mouse cursors. If using an [AnimatedTexture], only the first frame will be displayed. [b]Note:[/b] Only images imported with the [b]Lossless[/b], [b]Lossy[/b] or [b]Uncompressed[/b] compression modes are supported. The [b]Video RAM[/b] compression mode can't be used for custom cursors. -- cgit v1.2.3 From 289d551fbb1efe02b65139a07eb5e35374cbaf96 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Mon, 24 Apr 2023 21:06:55 +0200 Subject: Create an "Editor-only" section in the online class reference This helps to find such classes without digging through the rest of the class reference. Editor-only classes can still be found under your normal "Node" and "Resource" types. This also fixes a typo and a missed case from the recent platform docs PR. (cherry picked from commit 3ae282b452c1b35015cf327b376ef635b08393b5) --- doc/tools/make_rst.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'doc') diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 1f71b77cbd..98412eca58 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -33,6 +33,7 @@ BASE_STRINGS = [ "Globals", "Nodes", "Resources", + "Editor-only", "Other objects", "Variant types", "Description", @@ -74,13 +75,23 @@ CLASS_GROUPS: Dict[str, str] = { "node": "Nodes", "resource": "Resources", "object": "Other objects", + "editor": "Editor-only", "variant": "Variant types", } CLASS_GROUPS_BASE: Dict[str, str] = { "node": "Node", "resource": "Resource", "object": "Object", + "variant": "Variant", } +# Sync with editor\register_editor_types.cpp +EDITOR_CLASSES: List[str] = [ + "AnimationTrackEditPlugin", + "FileSystemDock", + "ScriptCreateDialog", + "ScriptEditor", + "ScriptEditorBase", +] class State: @@ -635,6 +646,11 @@ def main() -> None: grouped_classes[group_name] = [] grouped_classes[group_name].append(class_name) + if is_editor_class(class_def): + if "editor" not in grouped_classes: + grouped_classes["editor"] = [] + grouped_classes["editor"].append(class_name) + print("") print("Generating the index file...") @@ -724,6 +740,17 @@ def get_class_group(class_def: ClassDef, state: State) -> str: return group_name +def is_editor_class(class_def: ClassDef) -> bool: + class_name = class_def.name + + if class_name.startswith("Editor"): + return True + if class_name in EDITOR_CLASSES: + return True + + return False + + # Generator methods. @@ -1472,6 +1499,9 @@ def make_rst_index(grouped_classes: Dict[str, List[str]], dry_run: bool, output_ f.write(f" class_{CLASS_GROUPS_BASE[group_name].lower()}\n") for class_name in grouped_classes[group_name]: + if group_name in CLASS_GROUPS_BASE and CLASS_GROUPS_BASE[group_name].lower() == class_name.lower(): + continue + f.write(f" class_{class_name.lower()}\n") f.write("\n") -- cgit v1.2.3 From 7b5936163736589cb234e3900b6e57948b1784ba Mon Sep 17 00:00:00 2001 From: VolTer Date: Mon, 17 Apr 2023 15:06:24 +0200 Subject: Document why Gradient.reverse() doesn't reverse constant gradients (cherry picked from commit f21d13600e41817646789a2b45221d8f5c2b2564) --- doc/classes/Gradient.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/classes/Gradient.xml b/doc/classes/Gradient.xml index 33f0a7979a..969169d8f5 100644 --- a/doc/classes/Gradient.xml +++ b/doc/classes/Gradient.xml @@ -49,13 +49,14 @@ Reverses/mirrors the gradient. + [b]Note:[/b] This method mirrors all points around the middle of the gradient, which may produce unexpected results when [member interpolation_mode] is set to [constant GRADIENT_INTERPOLATE_CONSTANT]. - Returns the interpolated color specified by [code]offset[/code]. + Returns the interpolated color specified by [param offset]. -- cgit v1.2.3 From 08ec4a82bd29828d47c241f6d5dbc062564810b7 Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Sun, 23 Apr 2023 10:21:18 +0200 Subject: Add information about how `Engine.time_scale` affects Timers (cherry picked from commit 16a1465380df708edebffc53c77011cd771f6b91) --- doc/classes/Engine.xml | 2 +- doc/classes/Timer.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 461ffcb2e0..c41a853bb7 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -306,7 +306,7 @@ [b]Note:[/b] This property does not impact the editor's Errors tab when running a project from the editor. - Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed. + Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed. This also affects [Timer] and [SceneTreeTimer] (see [method SceneTree.create_timer] for how to control this). diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml index 1b6c05284e..f4f4efd42e 100644 --- a/doc/classes/Timer.xml +++ b/doc/classes/Timer.xml @@ -5,6 +5,7 @@ Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one-shot" mode. + [b]Note:[/b] Timers are affected by [member Engine.time_scale], a higher scale means quicker timeouts, and vice versa. [b]Note:[/b] To create a one-shot timer without instantiating a node, use [method SceneTree.create_timer]. @@ -52,7 +53,7 @@ The wait time in seconds. - [b]Note:[/b] Timers can only emit once per rendered frame at most (or once per physics frame if [member process_callback] is [constant TIMER_PROCESS_PHYSICS]). This means very low wait times (lower than 0.05 seconds) will behave in significantly different ways depending on the rendered framerate. For very low wait times, it is recommended to use a process loop in a script instead of using a Timer node. + [b]Note:[/b] Timers can only emit once per rendered frame at most (or once per physics frame if [member process_callback] is [constant TIMER_PROCESS_PHYSICS]). This means very low wait times (lower than 0.05 seconds) will behave in significantly different ways depending on the rendered framerate. For very low wait times, it is recommended to use a process loop in a script instead of using a Timer node. Timers are affected by [member Engine.time_scale], a higher scale means quicker timeouts, and vice versa. -- cgit v1.2.3 From b9e75e50dc50ae49dc341069d2023add3eb7c4b8 Mon Sep 17 00:00:00 2001 From: Winston <44872771+winston-yallow@users.noreply.github.com> Date: Wed, 26 Apr 2023 02:31:40 +0200 Subject: Document automatic center mode using shape origins (cherry picked from commit 7b30d7da51e40a69b464e501dbc02fcaa99deb5b) --- doc/classes/RigidBody2D.xml | 2 +- doc/classes/RigidBody3D.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 937d0910ec..17b5ce6c68 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -283,7 +283,7 @@ Kinematic body freeze mode. Similar to [constant FREEZE_MODE_STATIC], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated. - In this mode, the body's center of mass is calculated automatically based on its shapes. + In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass. In this mode, the body's center of mass is set through [member center_of_mass]. Defaults to the body's origin position. diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml index a066254b4f..917ffe0b99 100644 --- a/doc/classes/RigidBody3D.xml +++ b/doc/classes/RigidBody3D.xml @@ -290,7 +290,7 @@ Kinematic body freeze mode. Similar to [constant FREEZE_MODE_STATIC], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated. - In this mode, the body's center of mass is calculated automatically based on its shapes. + In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass. In this mode, the body's center of mass is set through [member center_of_mass]. Defaults to the body's origin position. -- cgit v1.2.3 From 7f09c3d2fc40c96f38daa156364a20cf900ab201 Mon Sep 17 00:00:00 2001 From: VolTer Date: Wed, 26 Apr 2023 11:58:13 +0200 Subject: Provide an example on how to use ImmediateMesh (cherry picked from commit 4eabad6c265c0c068b5ab2c26e911ac99cd03c3b) --- doc/classes/Expression.xml | 1 + doc/classes/ImmediateMesh.xml | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index 2451ab1a0d..2c0e6b49b2 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -49,6 +49,7 @@ [/codeblocks] + $DOCS_URL/tutorials/scripting/evaluating_expressions.html diff --git a/doc/classes/ImmediateMesh.xml b/doc/classes/ImmediateMesh.xml index a6d2e3e249..81fd62f85f 100644 --- a/doc/classes/ImmediateMesh.xml +++ b/doc/classes/ImmediateMesh.xml @@ -4,9 +4,20 @@ Mesh optimized for creating geometry manually. - Mesh optimized for creating geometry manually, similar to OpenGL1.x immediate mode. + A mesh type optimized for creating geometry manually, similar to OpenGL 1.x immediate mode. + Here's a sample on how to generate a triangular face: + [codeblocks] + var mesh = ImmediateMesh.new() + mesh.surface_begin(Mesh.PRIMITIVE_TRIANGLES) + mesh.surface_add_vertex(Vector3.LEFT) + mesh.surface_add_vertex(Vector3.FORWARD) + mesh.surface_add_vertex(Vector3.ZERO) + mesh.surface_end() + [/codeblocks] + [b]Note:[/b] Generating complex geometries with [ImmediateMesh] is highly inefficient. Instead, it is designed to generate simple geometry that changes often. + $DOCS_URL/tutorials/3d/procedural_geometry/immediatemesh.html -- cgit v1.2.3