summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/@GlobalScope.xml22
-rw-r--r--doc/classes/AnimatableBody2D.xml22
-rw-r--r--doc/classes/AnimatableBody3D.xml25
-rw-r--r--doc/classes/Array.xml2
-rw-r--r--doc/classes/AudioListener2D.xml35
-rw-r--r--doc/classes/AudioListener3D.xml (renamed from doc/classes/Listener3D.xml)5
-rw-r--r--doc/classes/AudioStream.xml11
-rw-r--r--doc/classes/AudioStreamPlayer.xml3
-rw-r--r--doc/classes/AudioStreamPlayer2D.xml3
-rw-r--r--doc/classes/AudioStreamPlayer3D.xml5
-rw-r--r--doc/classes/Camera2D.xml3
-rw-r--r--doc/classes/Camera3D.xml2
-rw-r--r--doc/classes/CanvasItem.xml2
-rw-r--r--doc/classes/CharacterBody2D.xml10
-rw-r--r--doc/classes/CharacterBody3D.xml8
-rw-r--r--doc/classes/ClassDB.xml35
-rw-r--r--doc/classes/ConcavePolygonShape2D.xml2
-rw-r--r--doc/classes/ConcavePolygonShape3D.xml2
-rw-r--r--doc/classes/ConfigFile.xml3
-rw-r--r--doc/classes/Control.xml3
-rw-r--r--doc/classes/Cubemap.xml4
-rw-r--r--doc/classes/EditorCommandPalette.xml25
-rw-r--r--doc/classes/EditorInterface.xml1
-rw-r--r--doc/classes/EditorSceneImporterMesh.xml8
-rw-r--r--doc/classes/Engine.xml18
-rw-r--r--doc/classes/File.xml16
-rw-r--r--doc/classes/FontData.xml3
-rw-r--r--doc/classes/HScrollBar.xml6
-rw-r--r--doc/classes/HTTPClient.xml1
-rw-r--r--doc/classes/HTTPRequest.xml3
-rw-r--r--doc/classes/JNISingleton.xml3
-rw-r--r--doc/classes/Light3D.xml3
-rw-r--r--doc/classes/MainLoop.xml54
-rw-r--r--doc/classes/Mesh.xml2
-rw-r--r--doc/classes/MeshLibrary.xml15
-rw-r--r--doc/classes/MultiplayerAPI.xml67
-rw-r--r--doc/classes/MultiplayerPeer.xml15
-rw-r--r--doc/classes/MultiplayerReplicator.xml6
-rw-r--r--doc/classes/Mutex.xml3
-rw-r--r--doc/classes/Node.xml22
-rw-r--r--doc/classes/Node2D.xml1
-rw-r--r--doc/classes/OS.xml9
-rw-r--r--doc/classes/Object.xml30
-rw-r--r--doc/classes/PackedByteArray.xml2
-rw-r--r--doc/classes/PackedColorArray.xml2
-rw-r--r--doc/classes/PackedFloat32Array.xml2
-rw-r--r--doc/classes/PackedFloat64Array.xml2
-rw-r--r--doc/classes/PackedInt32Array.xml2
-rw-r--r--doc/classes/PackedInt64Array.xml2
-rw-r--r--doc/classes/PackedScene.xml26
-rw-r--r--doc/classes/PackedStringArray.xml2
-rw-r--r--doc/classes/PackedVector2Array.xml2
-rw-r--r--doc/classes/PackedVector3Array.xml2
-rw-r--r--doc/classes/Performance.xml4
-rw-r--r--doc/classes/PhysicalBone2D.xml4
-rw-r--r--doc/classes/PhysicsDirectBodyState2D.xml8
-rw-r--r--doc/classes/PhysicsDirectBodyState3D.xml7
-rw-r--r--doc/classes/PhysicsDirectSpaceState2D.xml21
-rw-r--r--doc/classes/PhysicsDirectSpaceState3D.xml5
-rw-r--r--doc/classes/PhysicsServer2D.xml30
-rw-r--r--doc/classes/PhysicsServer3D.xml43
-rw-r--r--doc/classes/PhysicsShapeQueryParameters2D.xml2
-rw-r--r--doc/classes/PhysicsShapeQueryParameters3D.xml2
-rw-r--r--doc/classes/ProjectSettings.xml32
-rw-r--r--doc/classes/RenderingDevice.xml34
-rw-r--r--doc/classes/RenderingServer.xml18
-rw-r--r--doc/classes/Resource.xml3
-rw-r--r--doc/classes/RichTextLabel.xml25
-rw-r--r--doc/classes/RigidDynamicBody2D.xml (renamed from doc/classes/RigidBody2D.xml)45
-rw-r--r--doc/classes/RigidDynamicBody3D.xml (renamed from doc/classes/RigidBody3D.xml)54
-rw-r--r--doc/classes/SceneTree.xml4
-rw-r--r--doc/classes/Skeleton3D.xml4
-rw-r--r--doc/classes/SoftDynamicBody3D.xml (renamed from doc/classes/SoftBody3D.xml)16
-rw-r--r--doc/classes/StaticBody2D.xml23
-rw-r--r--doc/classes/StaticBody3D.xml23
-rw-r--r--doc/classes/StyleBoxFlat.xml1
-rw-r--r--doc/classes/TabContainer.xml7
-rw-r--r--doc/classes/TextServer.xml3
-rw-r--r--doc/classes/Thread.xml2
-rw-r--r--doc/classes/TileData.xml33
-rw-r--r--doc/classes/TileMap.xml65
-rw-r--r--doc/classes/TileSet.xml304
-rw-r--r--doc/classes/TileSetAtlasSource.xml74
-rw-r--r--doc/classes/TileSetScenesCollectionSource.xml52
-rw-r--r--doc/classes/TileSetSource.xml51
-rw-r--r--doc/classes/TranslationServer.xml8
-rw-r--r--doc/classes/Tween.xml18
-rw-r--r--doc/classes/VScrollBar.xml6
-rw-r--r--doc/classes/Vector2.xml3
-rw-r--r--doc/classes/VehicleBody3D.xml6
-rw-r--r--doc/classes/VehicleWheel3D.xml6
-rw-r--r--doc/classes/Viewport.xml6
-rw-r--r--doc/classes/VisibleOnScreenEnabler3D.xml2
-rw-r--r--doc/classes/Window.xml25
-rw-r--r--doc/classes/WorldBoundaryShape2D.xml (renamed from doc/classes/WorldMarginShape2D.xml)6
-rw-r--r--doc/classes/WorldBoundaryShape3D.xml20
-rw-r--r--doc/classes/WorldMarginShape3D.xml20
-rw-r--r--doc/classes/XRInterfaceExtension.xml29
98 files changed, 1233 insertions, 483 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 616d88c7f3..c47ce81651 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -1069,7 +1069,7 @@
<member name="TranslationServer" type="TranslationServer" setter="" getter="">
The [TranslationServer] singleton.
</member>
- <member name="VisualScriptEditor" type="VisualScriptCustomNodes" setter="" getter="">
+ <member name="VisualScriptCustomNodes" type="VisualScriptCustomNodes" setter="" getter="">
The [VisualScriptCustomNodes] singleton.
</member>
<member name="XRServer" type="XRServer" setter="" getter="">
@@ -2425,6 +2425,8 @@
</constant>
<constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="268435456" enum="PropertyUsageFlags">
</constant>
+ <constant name="PROPERTY_USAGE_ARRAY" value="1073741824" enum="PropertyUsageFlags">
+ </constant>
<constant name="PROPERTY_USAGE_DEFAULT" value="7" enum="PropertyUsageFlags">
Default usage (storage, editor and network).
</constant>
@@ -2463,6 +2465,24 @@
<constant name="METHOD_FLAGS_DEFAULT" value="1" enum="MethodFlags">
Default method flags.
</constant>
+ <constant name="RPC_MODE_DISABLED" value="0" enum="RPCMode">
+ Used with [method Node.rpc_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods.
+ </constant>
+ <constant name="RPC_MODE_ANY" value="1" enum="RPCMode">
+ Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the [code]@rpc(any)[/code] annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not.
+ </constant>
+ <constant name="RPC_MODE_AUTH" value="2" enum="RPCMode">
+ Used with [method Node.rpc_config] to set a method to be callable remotely only by the current multiplayer authority (which is the server by default). Analogous to the [code]@rpc(auth)[/code] annotation. See [method Node.set_multiplayer_authority].
+ </constant>
+ <constant name="TRANSFER_MODE_UNRELIABLE" value="0" enum="TransferMode">
+ Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_ORDERED]. Use for non-critical data, and always consider whether the order matters.
+ </constant>
+ <constant name="TRANSFER_MODE_ORDERED" value="1" enum="TransferMode">
+ Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than [constant TRANSFER_MODE_RELIABLE]. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data.
+ </constant>
+ <constant name="TRANSFER_MODE_RELIABLE" value="2" enum="TransferMode">
+ Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly.
+ </constant>
<constant name="TYPE_NIL" value="0" enum="Variant.Type">
Variable is [code]null[/code].
</constant>
diff --git a/doc/classes/AnimatableBody2D.xml b/doc/classes/AnimatableBody2D.xml
new file mode 100644
index 0000000000..731c702549
--- /dev/null
+++ b/doc/classes/AnimatableBody2D.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="AnimatableBody2D" inherits="StaticBody2D" version="4.0">
+ <brief_description>
+ Physics body for 2D physics which moves only by script or animation. Useful for moving platforms and doors.
+ </brief_description>
+ <description>
+ Animatable body for 2D physics.
+ An animatable body can't be moved by external forces or contacts, but can be moved by script or animation to affect other bodies in its path. It is ideal for implementing moving objects in the environment, such as moving platforms or doors.
+ When the body is moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to [code]physics[/code]), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="sync_to_physics" type="bool" setter="set_sync_to_physics" getter="is_sync_to_physics_enabled" default="false">
+ If [code]true[/code], the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do [b]not[/b] use together with [method PhysicsBody2D.move_and_collide].
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/AnimatableBody3D.xml b/doc/classes/AnimatableBody3D.xml
new file mode 100644
index 0000000000..8192f26057
--- /dev/null
+++ b/doc/classes/AnimatableBody3D.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="AnimatableBody3D" inherits="StaticBody3D" version="4.0">
+ <brief_description>
+ Physics body for 3D physics which moves only by script or animation. Useful for moving platforms and doors.
+ </brief_description>
+ <description>
+ Animatable body for 3D physics.
+ An animatable body can't be moved by external forces or contacts, but can be moved by script or animation to affect other bodies in its path. It is ideal for implementing moving objects in the environment, such as moving platforms or doors.
+ When the body is moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to [code]physics[/code]), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
+ </description>
+ <tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="sync_to_physics" type="bool" setter="set_sync_to_physics" getter="is_sync_to_physics_enabled" default="false">
+ If [code]true[/code], the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do [b]not[/b] use together with [method PhysicsBody3D.move_and_collide].
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index 396490c8eb..91450e50a4 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -495,7 +495,7 @@
<argument index="2" name="step" type="int" default="1" />
<argument index="3" name="deep" type="bool" default="false" />
<description>
- Duplicates the subset described in the function and returns it in an array, deeply copying the array if [code]deep[/code] is [code]true[/code]. Lower and upper index are inclusive, with the [code]step[/code] describing the change between indices while slicing.
+ Duplicates the subset described in the function and returns it in an array, deeply copying the array if [code]deep[/code] is [code]true[/code]. Lower and upper index are inclusive, with the [code]step[/code] describing the change between indices while slicing. Wraps around if [code]begin[/code] or [code]end[/code] are out of bounds or negative. Returns an empty array for invalid parameters.
</description>
</method>
<method name="sort">
diff --git a/doc/classes/AudioListener2D.xml b/doc/classes/AudioListener2D.xml
new file mode 100644
index 0000000000..86dc870926
--- /dev/null
+++ b/doc/classes/AudioListener2D.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="AudioListener2D" inherits="Node2D" version="4.0">
+ <brief_description>
+ Overrides the location sounds are heard from.
+ </brief_description>
+ <description>
+ Once added to the scene tree and enabled using [method make_current], this node will override the location sounds are heard from. Only one [AudioListener2D] can be current. Using [method make_current] will disable the previous [AudioListener2D].
+ If there is no active [AudioListener2D] in the current [Viewport], center of the screen will be used as a hearing point for the audio. [AudioListener2D] needs to be inside [SceneTree] to function.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="clear_current">
+ <return type="void" />
+ <description>
+ Disables the [AudioListener2D]. If it's not set as current, this method will have no effect.
+ </description>
+ </method>
+ <method name="is_current" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if this [AudioListener2D] is currently active.
+ </description>
+ </method>
+ <method name="make_current">
+ <return type="void" />
+ <description>
+ Makes the [AudioListener2D] active, setting it as the hearing point for the sounds. If there is already another active [AudioListener2D], it will be disabled.
+ This method will have no effect if the [AudioListener2D] is not added to [SceneTree].
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Listener3D.xml b/doc/classes/AudioListener3D.xml
index 9cc803f241..ed1f7fcc8f 100644
--- a/doc/classes/Listener3D.xml
+++ b/doc/classes/AudioListener3D.xml
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="Listener3D" inherits="Node3D" version="4.0">
+<class name="AudioListener3D" inherits="Node3D" version="4.0">
<brief_description>
Overrides the location sounds are heard from.
</brief_description>
<description>
Once added to the scene tree and enabled using [method make_current], this node will override the location sounds are heard from. This can be used to listen from a location different from the [Camera3D].
- [b]Note:[/b] There is no 2D equivalent for this node yet.
</description>
<tutorials>
</tutorials>
@@ -26,7 +25,7 @@
<return type="bool" />
<description>
Returns [code]true[/code] if the listener was made current using [method make_current], [code]false[/code] otherwise.
- [b]Note:[/b] There may be more than one Listener3D marked as "current" in the scene tree, but only the one that was made current last will be used.
+ [b]Note:[/b] There may be more than one AudioListener3D marked as "current" in the scene tree, but only the one that was made current last will be used.
</description>
</method>
<method name="make_current">
diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml
index a954a06117..32e51603ee 100644
--- a/doc/classes/AudioStream.xml
+++ b/doc/classes/AudioStream.xml
@@ -28,12 +28,23 @@
<description>
</description>
</method>
+ <method name="_is_monophonic" qualifiers="virtual const">
+ <return type="bool" />
+ <description>
+ </description>
+ </method>
<method name="get_length" qualifiers="const">
<return type="float" />
<description>
Returns the length of the audio stream in seconds.
</description>
</method>
+ <method name="is_monophonic" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns true if this audio stream only supports monophonic playback, or false if the audio stream supports polyphony.
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml
index a6c437f875..b692ae858e 100644
--- a/doc/classes/AudioStreamPlayer.xml
+++ b/doc/classes/AudioStreamPlayer.xml
@@ -56,6 +56,9 @@
<member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&amp;&quot;Master&quot;">
Bus on which this audio is playing.
</member>
+ <member name="max_polyphony" type="int" setter="set_max_polyphony" getter="get_max_polyphony" default="1">
+ The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
+ </member>
<member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" enum="AudioStreamPlayer.MixTarget" default="0">
If the audio configuration has more than two speakers, this sets the target channels. See [enum MixTarget] constants.
</member>
diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml
index c40c223091..e36a428499 100644
--- a/doc/classes/AudioStreamPlayer2D.xml
+++ b/doc/classes/AudioStreamPlayer2D.xml
@@ -61,6 +61,9 @@
<member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="2000.0">
Maximum distance from which audio is still hearable.
</member>
+ <member name="max_polyphony" type="int" setter="set_max_polyphony" getter="get_max_polyphony" default="1">
+ The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
+ </member>
<member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0">
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
</member>
diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml
index 584f03399c..c848812011 100644
--- a/doc/classes/AudioStreamPlayer3D.xml
+++ b/doc/classes/AudioStreamPlayer3D.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. For greater realism, a low-pass filter is automatically applied to distant sounds. This can be disabled by setting [member attenuation_filter_cutoff_hz] to [code]20500[/code].
- By default, audio is heard from the camera position. This can be changed by adding a [Listener3D] node to the scene and enabling it by calling [method Listener3D.make_current] on it.
+ By default, audio is heard from the camera position. This can be changed by adding a [AudioListener3D] node to the scene and enabling it by calling [method AudioListener3D.make_current] on it.
See also [AudioStreamPlayer] to play a sound non-positionally.
[b]Note:[/b] Hiding an [AudioStreamPlayer3D] node does not disable its audio output. To temporarily disable an [AudioStreamPlayer3D]'s audio output, set [member unit_db] to a very low value like [code]-100[/code] (which isn't audible to human hearing).
</description>
@@ -83,6 +83,9 @@
<member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="0.0">
Sets the distance from which the [member out_of_range_mode] takes effect. Has no effect if set to 0.
</member>
+ <member name="max_polyphony" type="int" setter="set_max_polyphony" getter="get_max_polyphony" default="1">
+ The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
+ </member>
<member name="out_of_range_mode" type="int" setter="set_out_of_range_mode" getter="get_out_of_range_mode" enum="AudioStreamPlayer3D.OutOfRangeMode" default="0">
Decides if audio should pause when source is outside of [member max_distance] range.
</member>
diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml
index d0ff66ae06..a3a891cdcb 100644
--- a/doc/classes/Camera2D.xml
+++ b/doc/classes/Camera2D.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of [CanvasItem]-based nodes.
+ Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport.
This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from [Node2D] and change the transform of the canvas by setting [member Viewport.canvas_transform] in [Viewport] (you can obtain the current [Viewport] by using [method Node.get_viewport]).
Note that the [Camera2D] node's [code]position[/code] doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [method get_camera_screen_center] to get the real position.
</description>
@@ -81,7 +82,7 @@
The Camera2D's anchor point. See [enum AnchorMode] constants.
</member>
<member name="current" type="bool" setter="set_current" getter="is_current" default="false">
- If [code]true[/code], the camera is the active camera for the current scene. Only one camera can be current, so setting a different camera [code]current[/code] will disable this one.
+ If [code]true[/code], the camera acts as the active camera for its [Viewport] ancestor. Only one camera can be current in a given viewport, so setting a different camera in the same viewport [code]current[/code] will disable whatever camera was already active in that viewport.
</member>
<member name="custom_viewport" type="Node" setter="set_custom_viewport" getter="get_custom_viewport">
The custom [Viewport] node attached to the [Camera2D]. If [code]null[/code] or not a [Viewport], uses the default viewport instead.
diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml
index 8a91a91b22..cd17a31e23 100644
--- a/doc/classes/Camera3D.xml
+++ b/doc/classes/Camera3D.xml
@@ -26,7 +26,7 @@
<method name="get_camera_transform" qualifiers="const">
<return type="Transform3D" />
<description>
- Gets the camera transform. Subclassed cameras such as [ClippedCamera3D] may provide different transforms than the [Node] transform.
+ Returns the transform of the camera plus the vertical ([member v_offset]) and horizontal ([member h_offset]) offsets; and any other adjustments made to the position and orientation of the camera by subclassed cameras such as [ClippedCamera3D] and [XRCamera3D].
</description>
</method>
<method name="get_cull_mask_value" qualifiers="const">
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 4641bc52a4..501f89fa0d 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -115,7 +115,7 @@
<argument index="4" name="outline" type="float" default="0.0" />
<argument index="5" name="pixel_range" type="float" default="4.0" />
<description>
- Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color.
+ Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [method FontData.set_multichannel_signed_distance_field] for more information and caveats about MSDF font rendering.
If [code]outline[/code] is positive, each alpha channel value of pixel in region is set to maximum value of true distance in the [code]outline[/code] radius.
Value of the [code]pixel_range[/code] should the same that was used during distance field texture generation.
</description>
diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml
index 71e6eeab5a..7637356f63 100644
--- a/doc/classes/CharacterBody2D.xml
+++ b/doc/classes/CharacterBody2D.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CharacterBody2D" inherits="PhysicsBody2D" version="4.0">
<brief_description>
- Character body 2D node.
+ Specialized 2D physics body node for characters moved by script.
</brief_description>
<description>
- Character bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a rigid body, these are the same as a static body. However, they have two main uses:
- [b]Kinematic characters:[/b] Character bodies have an API for moving objects with walls and slopes detection ([method move_and_slide] method), in addition to collision detection (also done with [method PhysicsBody3D.move_and_collide]). This makes them really useful to implement characters that move in specific ways and collide with the world, but don't require advanced physics.
- [b]Kinematic motion:[/b] Character bodies can also be used for kinematic motion (same functionality as [member StaticBody3D.kinematic_motion] when enabled), which allows them to be moved by code and push other bodies on their path.
+ Character bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a rigid body, these are the same as a [AnimatableBody2D]. However, they have two main uses:
+ [b]Kinematic characters:[/b] Character bodies have an API for moving objects with walls and slopes detection ([method move_and_slide] method), in addition to collision detection (also done with [method PhysicsBody2D.move_and_collide]). This makes them really useful to implement characters that move in specific ways and collide with the world, but don't require advanced physics.
+ [b]Kinematic motion:[/b] Character bodies can also be used for kinematic motion (same functionality as [AnimatableBody2D]), which allows them to be moved by code and push other bodies on their path.
</description>
<tutorials>
<link title="Kinematic character (2D)">https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link>
@@ -107,7 +107,7 @@
<method name="move_and_slide">
<return type="bool" />
<description>
- Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
+ Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidDynamicBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
Modifies [member linear_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision].
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml
index 85135d5509..f08a2cafea 100644
--- a/doc/classes/CharacterBody3D.xml
+++ b/doc/classes/CharacterBody3D.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CharacterBody3D" inherits="PhysicsBody3D" version="4.0">
<brief_description>
- Character body 3D node.
+ Specialized 3D physics body node for characters moved by script.
</brief_description>
<description>
- Character bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a rigid body, these are the same as a static body. However, they have two main uses:
+ Character bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a rigid body, these are the same as a [AnimatableBody3D]. However, they have two main uses:
[b]Kinematic characters:[/b] Character bodies have an API for moving objects with walls and slopes detection ([method move_and_slide] method), in addition to collision detection (also done with [method PhysicsBody3D.move_and_collide]). This makes them really useful to implement characters that move in specific ways and collide with the world, but don't require advanced physics.
- [b]Kinematic motion:[/b] Character bodies can also be used for kinematic motion (same functionality as [member StaticBody3D.kinematic_motion] when enabled), which allows them to be moved by code and push other bodies on their path.
+ [b]Kinematic motion:[/b] Character bodies can also be used for kinematic motion (same functionality as [AnimatableBody3D]), which allows them to be moved by code and push other bodies on their path.
</description>
<tutorials>
<link title="Kinematic character (2D)">https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link>
@@ -93,7 +93,7 @@
<method name="move_and_slide">
<return type="bool" />
<description>
- Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
+ Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidDynamicBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
Modifies [member linear_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for more detailed information about collisions that occurred, use [method get_slide_collision].
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml
index 063233fe50..62165a5fce 100644
--- a/doc/classes/ClassDB.xml
+++ b/doc/classes/ClassDB.xml
@@ -30,6 +30,23 @@
Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required.
</description>
</method>
+ <method name="class_get_enum_constants" qualifiers="const">
+ <return type="PackedStringArray" />
+ <argument index="0" name="class" type="StringName" />
+ <argument index="1" name="enum" type="StringName" />
+ <argument index="2" name="no_inheritance" type="bool" default="false" />
+ <description>
+ Returns an array with all the keys in [code]enum[/code] of [code]class[/code] or its ancestry.
+ </description>
+ </method>
+ <method name="class_get_enum_list" qualifiers="const">
+ <return type="PackedStringArray" />
+ <argument index="0" name="class" type="StringName" />
+ <argument index="1" name="no_inheritance" type="bool" default="false" />
+ <description>
+ Returns an array with all the enums of [code]class[/code] or its ancestry.
+ </description>
+ </method>
<method name="class_get_integer_constant" qualifiers="const">
<return type="int" />
<argument index="0" name="class" type="StringName" />
@@ -38,6 +55,15 @@
Returns the value of the integer constant [code]name[/code] of [code]class[/code] or its ancestry. Always returns 0 when the constant could not be found.
</description>
</method>
+ <method name="class_get_integer_constant_enum" qualifiers="const">
+ <return type="StringName" />
+ <argument index="0" name="class" type="StringName" />
+ <argument index="1" name="name" type="StringName" />
+ <argument index="2" name="no_inheritance" type="bool" default="false" />
+ <description>
+ Returns which enum the integer constant [code]name[/code] of [code]class[/code] or its ancestry belongs to.
+ </description>
+ </method>
<method name="class_get_integer_constant_list" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="class" type="StringName" />
@@ -87,6 +113,15 @@
Returns an array with all the signals of [code]class[/code] or its ancestry if [code]no_inheritance[/code] is [code]false[/code]. Every element of the array is a [Dictionary] as described in [method class_get_signal].
</description>
</method>
+ <method name="class_has_enum" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="class" type="StringName" />
+ <argument index="1" name="name" type="StringName" />
+ <argument index="2" name="no_inheritance" type="bool" default="false" />
+ <description>
+ Returns whether [code]class[/code] or its ancestry has an enum called [code]name[/code] or not.
+ </description>
+ </method>
<method name="class_has_integer_constant" qualifiers="const">
<return type="bool" />
<argument index="0" name="class" type="StringName" />
diff --git a/doc/classes/ConcavePolygonShape2D.xml b/doc/classes/ConcavePolygonShape2D.xml
index e6b2e1845d..50632cd2c8 100644
--- a/doc/classes/ConcavePolygonShape2D.xml
+++ b/doc/classes/ConcavePolygonShape2D.xml
@@ -4,7 +4,7 @@
Concave polygon 2D shape resource for physics.
</brief_description>
<description>
- Concave polygon 2D shape resource for physics. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for [RigidBody2D] nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions.
+ Concave polygon 2D shape resource for physics. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for [RigidDynamicBody2D] nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions.
The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection.
</description>
<tutorials>
diff --git a/doc/classes/ConcavePolygonShape3D.xml b/doc/classes/ConcavePolygonShape3D.xml
index 34fb06a476..907afa6367 100644
--- a/doc/classes/ConcavePolygonShape3D.xml
+++ b/doc/classes/ConcavePolygonShape3D.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
Concave polygon shape resource, which can be set into a [PhysicsBody3D] or area. This shape is created by feeding a list of triangles.
- Note: when used for collision, [ConcavePolygonShape3D] is intended to work with static [PhysicsBody3D] nodes like [StaticBody3D] and will not work with [CharacterBody3D] or [RigidBody3D] with a mode other than Static.
+ Note: when used for collision, [ConcavePolygonShape3D] is intended to work with static [PhysicsBody3D] nodes like [StaticBody3D] and will not work with [CharacterBody3D] or [RigidDynamicBody3D] with a mode other than Static.
</description>
<tutorials>
<link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml
index d6da4bc248..ce976e3d8b 100644
--- a/doc/classes/ConfigFile.xml
+++ b/doc/classes/ConfigFile.xml
@@ -84,8 +84,10 @@
}
[/csharp]
[/codeblocks]
+ Any operation that mutates the ConfigFile such as [method set_value], [method clear], or [method erase_section], only changes what is loaded in memory. If you want to write the change to a file, you have to save the changes with [method save], [method save_encrypted], or [method save_encrypted_pass].
Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load.
ConfigFiles can also contain manually written comment lines starting with a semicolon ([code];[/code]). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action.
+ [b]Note:[/b] The file extension given to a ConfigFile does not have any impact on its formatting or behavior. By convention, the [code].cfg[/code] extension is used here, but any other extension such as [code].ini[/code] is also valid. Since neither [code].cfg[/code] nor [code].ini[/code] are standardized, Godot's ConfigFile formatting may differ from files written by other programs.
</description>
<tutorials>
</tutorials>
@@ -93,6 +95,7 @@
<method name="clear">
<return type="void" />
<description>
+ Removes the entire contents of the config.
</description>
</method>
<method name="erase_section">
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index 5392189f6a..6602764cd4 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -921,7 +921,8 @@
Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience.
</member>
<member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" default="true">
- Toggles if any text should automatically change to its translated version depending on the current locale.
+ Toggles if any text should automatically change to its translated version depending on the current locale. Note that this will not affect any internal nodes (e.g. the popup of a [MenuButton]).
+ Also decides if the node's strings should be parsed for POT generation.
</member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0">
The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals.
diff --git a/doc/classes/Cubemap.xml b/doc/classes/Cubemap.xml
index 61cb1d43f0..9e31ee8a92 100644
--- a/doc/classes/Cubemap.xml
+++ b/doc/classes/Cubemap.xml
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Cubemap" inherits="ImageTextureLayered" version="4.0">
<brief_description>
+ 6-sided texture typically used in 3D rendering.
</brief_description>
<description>
+ A cubemap is a 6-sided texture typically used for faking reflections in 3D rendering. It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods.
+ This resource is typically used as a uniform in custom shaders. Few core Godot methods make use of Cubemap resources.
+ [b]Note:[/b] Godot doesn't support using cubemaps as a [PanoramaSkyMaterial]. You can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this tool[/url] to convert a cube map to an equirectangular sky map.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/EditorCommandPalette.xml b/doc/classes/EditorCommandPalette.xml
index 743c59eec2..1d3b21255f 100644
--- a/doc/classes/EditorCommandPalette.xml
+++ b/doc/classes/EditorCommandPalette.xml
@@ -1,8 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorCommandPalette" inherits="ConfirmationDialog" version="4.0">
<brief_description>
+ Godot editor's command palette.
</brief_description>
<description>
+ Object that holds all the available Commands and their shortcuts text. These Commands can be accessed through [b]Editor &gt; Command Palette[/b] menu.
+ Command key names use slash delimiters to distinguish sections Example: [code]"example/command1"[/code] then [code]example[/code] will be the section name.
+ [codeblocks]
+ [gdscript]
+ var command_palette = get_editor_interface().get_command_palette()
+ # external_command is a function that will be called with the command is executed.
+ var command_callable = Callable(self, "external_command").bind(arguments)
+ command_palette.add_command("command", "test/command",command_callable)
+ [/gdscript]
+ [csharp]
+ EditorCommandPalette commandPalette = GetEditorInterface().GetCommandPalette();
+ // ExternalCommand is a function that will be called with the command is executed.
+ Callable commandCallable = new Callable(this, nameof(ExternalCommand));
+ commandPalette.AddCommand("command", "test/command", commandCallable)
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_command_palette].
</description>
<tutorials>
</tutorials>
@@ -14,12 +32,19 @@
<argument index="2" name="binded_callable" type="Callable" />
<argument index="3" name="shortcut_text" type="String" default="&quot;None&quot;" />
<description>
+ Adds a custom command to EditorCommandPalette.
+ - [code]command_name[/code]: [String] (Name of the [b]Command[/b]. This is displayed to the user.)
+ - [code]key_name[/code]: [String] (Name of the key for a particular [b]Command[/b]. This is used to uniquely identify the [b]Command[/b].)
+ - [code]binded_callable[/code]: [Callable] (Callable of the [b]Command[/b]. This will be executed when the [b]Command[/b] is selected.)
+ - [code]shortcut_text[/code]: [String] (Shortcut text of the [b]Command[/b] if available.)
</description>
</method>
<method name="remove_command">
<return type="void" />
<argument index="0" name="key_name" type="String" />
<description>
+ Removes the custom command from EditorCommandPalette.
+ - [code]key_name[/code]: [String] (Name of the key for a particular [b]Command[/b].)
</description>
</method>
</methods>
diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml
index 91e1dfbf57..8558f4b9f7 100644
--- a/doc/classes/EditorInterface.xml
+++ b/doc/classes/EditorInterface.xml
@@ -33,6 +33,7 @@
<method name="get_command_palette" qualifiers="const">
<return type="EditorCommandPalette" />
<description>
+ Returns the editor's [EditorCommandPalette] instance.
</description>
</method>
<method name="get_current_path" qualifiers="const">
diff --git a/doc/classes/EditorSceneImporterMesh.xml b/doc/classes/EditorSceneImporterMesh.xml
index b0f233da2f..c0c53ff255 100644
--- a/doc/classes/EditorSceneImporterMesh.xml
+++ b/doc/classes/EditorSceneImporterMesh.xml
@@ -27,6 +27,7 @@
}" />
<argument index="4" name="material" type="Material" default="null" />
<argument index="5" name="name" type="String" default="&quot;&quot;" />
+ <argument index="6" name="flags" type="int" default="0" />
<description>
Creates a new surface, analogous to [method ArrayMesh.add_surface_from_arrays].
Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
@@ -94,6 +95,13 @@
Returns the amount of surfaces that the mesh holds.
</description>
</method>
+ <method name="get_surface_format" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="surface_idx" type="int" />
+ <description>
+ Returns the format of the surface that the mesh holds.
+ </description>
+ </method>
<method name="get_surface_lod_count" qualifiers="const">
<return type="int" />
<argument index="0" name="surface_idx" type="int" />
diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml
index 8b399f64c9..36590093bd 100644
--- a/doc/classes/Engine.xml
+++ b/doc/classes/Engine.xml
@@ -37,7 +37,7 @@
<method name="get_frames_drawn">
<return type="int" />
<description>
- Returns the total number of frames drawn. If the render loop is disabled with [code]--disable-render-loop[/code] via command line, this returns [code]0[/code]. See also [method get_process_frames].
+ Returns the total number of frames drawn. On headless platforms, or if the render loop is disabled with [code]--disable-render-loop[/code] via command line, [method get_frames_drawn] always returns [code]0[/code]. See [method get_process_frames].
</description>
</method>
<method name="get_frames_per_second" qualifiers="const">
@@ -67,7 +67,13 @@
<method name="get_physics_frames" qualifiers="const">
<return type="int" />
<description>
- Returns the total number of frames passed since engine initialization which is advanced on each [b]physics frame[/b].
+ Returns the total number of frames passed since engine initialization which is advanced on each [b]physics frame[/b]. See also [method get_process_frames].
+ [method get_physics_frames] can be used to run expensive logic less often without relying on a [Timer]:
+ [codeblock]
+ func _physics_process(_delta):
+ if Engine.get_physics_frames() % 2 == 0:
+ pass # Run expensive logic only once every 2 physics frames here.
+ [/codeblock]
</description>
</method>
<method name="get_physics_interpolation_fraction" qualifiers="const">
@@ -79,7 +85,13 @@
<method name="get_process_frames" qualifiers="const">
<return type="int" />
<description>
- Returns the total number of frames passed since engine initialization which is advanced on each [b]process frame[/b], regardless of whether the render loop is enabled. See also [method get_frames_drawn].
+ Returns the total number of frames passed since engine initialization which is advanced on each [b]process frame[/b], regardless of whether the render loop is enabled. See also [method get_frames_drawn] and [method get_physics_frames].
+ [method get_process_frames] can be used to run expensive logic less often without relying on a [Timer]:
+ [codeblock]
+ func _process(_delta):
+ if Engine.get_process_frames() % 2 == 0:
+ pass # Run expensive logic only once every 2 process (render) frames here.
+ [/codeblock]
</description>
</method>
<method name="get_singleton" qualifiers="const">
diff --git a/doc/classes/File.xml b/doc/classes/File.xml
index 8ecdc8b220..cf08029c72 100644
--- a/doc/classes/File.xml
+++ b/doc/classes/File.xml
@@ -58,8 +58,20 @@
<method name="eof_reached" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the file cursor has read past the end of the file.
- [b]Note:[/b] This function will still return [code]false[/code] while at the end of the file and only activates when reading past it. This can be confusing but it conforms to how low-level file access works in all operating systems. There is always [method get_length] and [method get_position] to implement a custom logic.
+ Returns [code]true[/code] if the file cursor has already read past the end of the file.
+ [b]Note:[/b] [code]eof_reached() == false[/code] cannot be used to check whether there is more data available. To loop while there is more data available, use:
+ [codeblocks]
+ [gdscript]
+ while file.get_position() &lt; file.get_length():
+ # Read data
+ [/gdscript]
+ [csharp]
+ while (file.GetPosition() &lt; file.GetLength())
+ {
+ // Read data
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="file_exists" qualifiers="const">
diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml
index 72af7ca485..384d7c81f4 100644
--- a/doc/classes/FontData.xml
+++ b/doc/classes/FontData.xml
@@ -558,7 +558,8 @@
<return type="void" />
<argument index="0" name="msdf" type="bool" />
<description>
- If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
+ If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field (MSDF) generated from the dynamic font vector data. MSDF rendering allows displaying the font at any scaling factor without blurriness, and without incurring a CPU cost when the font size changes (since the font no longer needs to be rasterized on the CPU). As a downside, font hinting is not available with MSDF. The lack of font hinting may result in less crisp and less readable fonts at small sizes.
+ [b]Note:[/b] MSDF font rendering does not render glyphs with overlapping shapes correctly. Overlapping shapes are not valid per the OpenType standard, but are still commonly found in many font files, especially those converted by Google Fonts. To avoid issues with overlapping glyphs, consider downloading the font file directly from the type foundry instead of relying on Google Fonts.
</description>
</method>
<method name="set_oversampling">
diff --git a/doc/classes/HScrollBar.xml b/doc/classes/HScrollBar.xml
index 3bdd739cdf..36ff070a37 100644
--- a/doc/classes/HScrollBar.xml
+++ b/doc/classes/HScrollBar.xml
@@ -19,6 +19,9 @@
<theme_item name="decrement_highlight" data_type="icon" type="Texture2D">
Displayed when the mouse cursor hovers over the decrement button.
</theme_item>
+ <theme_item name="decrement_pressed" data_type="icon" type="Texture2D">
+ Displayed when the decrement button is being pressed.
+ </theme_item>
<theme_item name="grabber" data_type="style" type="StyleBox">
Used as texture for the grabber, the draggable element representing current scroll.
</theme_item>
@@ -34,6 +37,9 @@
<theme_item name="increment_highlight" data_type="icon" type="Texture2D">
Displayed when the mouse cursor hovers over the increment button.
</theme_item>
+ <theme_item name="increment_pressed" data_type="icon" type="Texture2D">
+ Displayed when the increment button is being pressed.
+ </theme_item>
<theme_item name="scroll" data_type="style" type="StyleBox">
Used as background of this [ScrollBar].
</theme_item>
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index 861627b526..29aaf3c756 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -8,6 +8,7 @@
[b]Note:[/b] This client only needs to connect to a host once (see [method connect_to_host]) to send multiple requests. Because of this, methods that take URLs usually take just the part after the host instead of the full URL, as the client is already connected to a host. See [method request] for a full example and to get started.
A [HTTPClient] should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side.
For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616).
+ [b]Note:[/b] It's recommended to use transport encryption (SSL/TLS) and to avoid sending sensitive information (such as login credentials) in HTTP GET URL parameters. Consider using HTTP POST requests or HTTP headers for such information instead.
[b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header.
[b]Note:[/b] SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error.
[b]Warning:[/b] SSL/TLS certificate revocation and certificate pinning are currently not supported. Revoked certificates are accepted as long as they are otherwise valid. If this is a concern, you may want to use automatically managed certificates with a short validity period.
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index 4fafa0a0a1..00927b98c5 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -192,7 +192,8 @@
<description>
Creates request on the underlying [HTTPClient]. If there is no configuration errors, it tries to connect using [method HTTPClient.connect_to_host] and passes parameters onto [method HTTPClient.request].
Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host.
- [b]Note:[/b] When [code]method[/code] is [constant HTTPClient.METHOD_GET], the payload sent via [code]request_data[/code] might be ignored by the server or even cause the server to reject the request (check [url=https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.1]RFC 7231 section 4.3.1[/url] for more details). As a workaround, you can send data as a query string in the URL. See [method String.uri_encode] for an example.
+ [b]Note:[/b] When [code]method[/code] is [constant HTTPClient.METHOD_GET], the payload sent via [code]request_data[/code] might be ignored by the server or even cause the server to reject the request (check [url=https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.1]RFC 7231 section 4.3.1[/url] for more details). As a workaround, you can send data as a query string in the URL (see [method String.uri_encode] for an example).
+ [b]Note:[/b] It's recommended to use transport encryption (SSL/TLS) and to avoid sending sensitive information (such as login credentials) in HTTP GET URL parameters. Consider using HTTP POST requests or HTTP headers for such information instead.
</description>
</method>
<method name="request_raw">
diff --git a/doc/classes/JNISingleton.xml b/doc/classes/JNISingleton.xml
index 84ab1a49c1..fbf18ddc03 100644
--- a/doc/classes/JNISingleton.xml
+++ b/doc/classes/JNISingleton.xml
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="JNISingleton" inherits="Object" version="4.0">
<brief_description>
+ Singleton that connects the engine with Android plugins to interface with native Android code.
</brief_description>
<description>
+ The JNISingleton is implemented only in the Android export. It's used to call methods and connect signals from an Android plugin written in Java or Kotlin. Methods and signals can be called and connected to the JNISingleton as if it is a Node. See [url=https://en.wikipedia.org/wiki/Java_Native_Interface]Java Native Interface - Wikipedia[/url] for more information.
</description>
<tutorials>
+ <link title="Creating Android plugins">https://docs.godotengine.org/en/latest/tutorials/platform/android/android_plugin.html#doc-android-plugin</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml
index cd2f4eca18..52359b0ede 100644
--- a/doc/classes/Light3D.xml
+++ b/doc/classes/Light3D.xml
@@ -47,7 +47,8 @@
The light's strength multiplier (this is not a physical unit). For [OmniLight3D] and [SpotLight3D], changing this value will only change the light color's intensity, not the light's radius.
</member>
<member name="light_indirect_energy" type="float" setter="set_param" getter="get_param" default="1.0">
- Secondary multiplier used with indirect light (light bounces). Used with [VoxelGI].
+ Secondary multiplier used with indirect light (light bounces). Used with [VoxelGI] and SDFGI (see [member Environment.sdfgi_enabled]).
+ [b]Note:[/b] This property is ignored if [member light_energy] is equal to [code]0.0[/code], as the light won't be present at all in the GI shader.
</member>
<member name="light_negative" type="bool" setter="set_negative" getter="is_negative" default="false">
If [code]true[/code], the light's effect is reversed, darkening areas and casting bright shadows.
diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml
index 11124a1436..1df00f556a 100644
--- a/doc/classes/MainLoop.xml
+++ b/doc/classes/MainLoop.xml
@@ -5,15 +5,14 @@
</brief_description>
<description>
[MainLoop] is the abstract base class for a Godot project's game loop. It is inherited by [SceneTree], which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own [MainLoop] subclass instead of the scene tree.
- Upon the application start, a [MainLoop] implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a [SceneTree] is created) unless a main [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code], which should then be a [MainLoop] implementation.
+ Upon the application start, a [MainLoop] implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a [SceneTree] is created) unless a [MainLoop] [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code] or the "Main Loop Type" project setting is overwritten.
Here is an example script implementing a simple [MainLoop]:
- [b]FIXME:[/b] No longer valid after DisplayServer split and Input refactoring.
- [codeblock]
+ [codeblocks]
+ [gdscript]
+ class_name CustomMainLoop
extends MainLoop
var time_elapsed = 0
- var keys_typed = []
- var quit = false
func _initialize():
print("Initialized:")
@@ -22,24 +21,41 @@
func _process(delta):
time_elapsed += delta
# Return true to end the main loop.
- return quit
-
- func _input_event(event):
- # Record keys.
- if event is InputEventKey and event.pressed and !event.echo:
- keys_typed.append(OS.get_keycode_string(event.keycode))
- # Quit on Escape press.
- if event.keycode == KEY_ESCAPE:
- quit = true
- # Quit on any mouse click.
- if event is InputEventMouseButton:
- quit = true
+ return Input.get_mouse_button_mask() != 0 || Input.is_key_pressed(KEY_ESCAPE)
func _finalize():
print("Finalized:")
print(" End time: %s" % str(time_elapsed))
- print(" Keys typed: %s" % var2str(keys_typed))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+
+ public class CustomMainLoop : MainLoop
+ {
+ public float TimeElapsed = 0;
+
+ public override void _Initialize()
+ {
+ GD.Print("Initialized:");
+ GD.Print($" Starting Time: {TimeElapsed}");
+ }
+
+ public override bool _Process(float delta)
+ {
+ TimeElapsed += delta;
+ // Return true to end the main loop.
+ return Input.GetMouseButtonMask() != 0 || Input.IsKeyPressed((int)KeyList.Escape);
+ }
+
+ private void _Finalize()
+ {
+ GD.Print("Finalized:");
+ GD.Print($" End Time: {TimeElapsed}");
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index bfa55c2d35..c774528a39 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -210,6 +210,8 @@
</constant>
<constant name="ARRAY_FORMAT_CUSTOM_BASE" value="13" enum="ArrayFormat">
</constant>
+ <constant name="ARRAY_FORMAT_CUSTOM_BITS" value="3" enum="ArrayFormat">
+ </constant>
<constant name="ARRAY_FORMAT_CUSTOM0_SHIFT" value="13" enum="ArrayFormat">
</constant>
<constant name="ARRAY_FORMAT_CUSTOM1_SHIFT" value="16" enum="ArrayFormat">
diff --git a/doc/classes/MeshLibrary.xml b/doc/classes/MeshLibrary.xml
index 9e0292f946..1d07647ea7 100644
--- a/doc/classes/MeshLibrary.xml
+++ b/doc/classes/MeshLibrary.xml
@@ -45,6 +45,13 @@
Returns the item's mesh.
</description>
</method>
+ <method name="get_item_mesh_transform" qualifiers="const">
+ <return type="Transform3D" />
+ <argument index="0" name="id" type="int" />
+ <description>
+ Returns the transform applied to the item's mesh.
+ </description>
+ </method>
<method name="get_item_name" qualifiers="const">
<return type="String" />
<argument index="0" name="id" type="int" />
@@ -102,6 +109,14 @@
Sets the item's mesh.
</description>
</method>
+ <method name="set_item_mesh_transform">
+ <return type="void" />
+ <argument index="0" name="id" type="int" />
+ <argument index="1" name="mesh_transform" type="Transform3D" />
+ <description>
+ Sets the transform to apply to the item's mesh.
+ </description>
+ </method>
<method name="set_item_name">
<return type="void" />
<argument index="0" name="id" type="int" />
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index 70046fc3e9..647233f679 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -4,8 +4,8 @@
High-level multiplayer API.
</brief_description>
<description>
- This class implements most of the logic behind the high-level multiplayer API. See also [MultiplayerPeer].
- By default, [SceneTree] has a reference to this class that is used to provide multiplayer capabilities (i.e. RPC/RSET) across the whole scene.
+ This class implements the high-level multiplayer API. See also [MultiplayerPeer].
+ By default, [SceneTree] has a reference to this class that is used to provide multiplayer capabilities (i.e. RPCs) across the whole scene.
It is possible to override the MultiplayerAPI instance used by specific Nodes by setting the [member Node.custom_multiplayer] property, effectively allowing to run both client and server in the same scene.
[b]Note:[/b] The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice.
</description>
@@ -18,49 +18,49 @@
Clears the current MultiplayerAPI network state (you shouldn't call this unless you know what you are doing).
</description>
</method>
- <method name="get_network_connected_peers" qualifiers="const">
+ <method name="get_peers" qualifiers="const">
<return type="PackedInt32Array" />
<description>
- Returns the peer IDs of all connected peers of this MultiplayerAPI's [member network_peer].
+ Returns the peer IDs of all connected peers of this MultiplayerAPI's [member multiplayer_peer].
</description>
</method>
- <method name="get_network_unique_id" qualifiers="const">
+ <method name="get_remote_sender_id" qualifiers="const">
<return type="int" />
<description>
- Returns the unique peer ID of this MultiplayerAPI's [member network_peer].
+ Returns the sender's peer ID for the RPC currently being executed.
+ [b]Note:[/b] If not inside an RPC this method will return 0.
</description>
</method>
- <method name="get_rpc_sender_id" qualifiers="const">
+ <method name="get_unique_id" qualifiers="const">
<return type="int" />
<description>
- Returns the sender's peer ID for the RPC currently being executed.
- [b]Note:[/b] If not inside an RPC this method will return 0.
+ Returns the unique peer ID of this MultiplayerAPI's [member multiplayer_peer].
</description>
</method>
- <method name="has_network_peer" qualifiers="const">
+ <method name="has_multiplayer_peer" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if there is a [member network_peer] set.
+ Returns [code]true[/code] if there is a [member multiplayer_peer] set.
</description>
</method>
- <method name="is_network_server" qualifiers="const">
+ <method name="is_server" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if this MultiplayerAPI's [member network_peer] is in server mode (listening for connections).
+ Returns [code]true[/code] if this MultiplayerAPI's [member multiplayer_peer] is valid and in server mode (listening for connections).
</description>
</method>
<method name="poll">
<return type="void" />
<description>
Method used for polling the MultiplayerAPI. You only need to worry about this if you are using [member Node.custom_multiplayer] override or you set [member SceneTree.multiplayer_poll] to [code]false[/code]. By default, [SceneTree] will poll its MultiplayerAPI for you.
- [b]Note:[/b] This method results in RPCs and RSETs being called, so they will be executed in the same context of this function (e.g. [code]_process[/code], [code]physics[/code], [Thread]).
+ [b]Note:[/b] This method results in RPCs being called, so they will be executed in the same context of this function (e.g. [code]_process[/code], [code]physics[/code], [Thread]).
</description>
</method>
<method name="send_bytes">
<return type="int" enum="Error" />
<argument index="0" name="bytes" type="PackedByteArray" />
<argument index="1" name="id" type="int" default="0" />
- <argument index="2" name="mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" />
+ <argument index="2" name="mode" type="int" enum="TransferMode" default="2" />
<argument index="3" name="channel" type="int" default="0" />
<description>
Sends the given raw [code]bytes[/code] to a specific peer identified by [code]id[/code] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers.
@@ -69,14 +69,14 @@
</methods>
<members>
<member name="allow_object_decoding" type="bool" setter="set_allow_object_decoding" getter="is_object_decoding_allowed" default="false">
- If [code]true[/code], the MultiplayerAPI will allow encoding and decoding of object during RPCs/RSETs.
+ If [code]true[/code], the MultiplayerAPI will allow encoding and decoding of object during RPCs.
[b]Warning:[/b] Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution.
</member>
- <member name="network_peer" type="MultiplayerPeer" setter="set_network_peer" getter="get_network_peer">
- The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to authority, or it will become a regular client peer. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals.
+ <member name="multiplayer_peer" type="MultiplayerPeer" setter="set_multiplayer_peer" getter="get_multiplayer_peer">
+ The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_server]) and will set root node's network mode to authority, or it will become a regular client peer. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals.
</member>
- <member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections" default="false">
- If [code]true[/code], the MultiplayerAPI's [member network_peer] refuses new incoming connections.
+ <member name="refuse_new_connections" type="bool" setter="set_refuse_new_connections" getter="is_refusing_new_connections" default="false">
+ If [code]true[/code], the MultiplayerAPI's [member multiplayer_peer] refuses new incoming connections.
</member>
<member name="replicator" type="MultiplayerReplicator" setter="" getter="get_replicator">
</member>
@@ -88,48 +88,39 @@
<signals>
<signal name="connected_to_server">
<description>
- Emitted when this MultiplayerAPI's [member network_peer] successfully connected to a server. Only emitted on clients.
+ Emitted when this MultiplayerAPI's [member multiplayer_peer] successfully connected to a server. Only emitted on clients.
</description>
</signal>
<signal name="connection_failed">
<description>
- Emitted when this MultiplayerAPI's [member network_peer] fails to establish a connection to a server. Only emitted on clients.
+ Emitted when this MultiplayerAPI's [member multiplayer_peer] fails to establish a connection to a server. Only emitted on clients.
</description>
</signal>
- <signal name="network_peer_connected">
+ <signal name="peer_connected">
<argument index="0" name="id" type="int" />
<description>
- Emitted when this MultiplayerAPI's [member network_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1).
+ Emitted when this MultiplayerAPI's [member multiplayer_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1).
</description>
</signal>
- <signal name="network_peer_disconnected">
+ <signal name="peer_disconnected">
<argument index="0" name="id" type="int" />
<description>
- Emitted when this MultiplayerAPI's [member network_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server.
+ Emitted when this MultiplayerAPI's [member multiplayer_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server.
</description>
</signal>
- <signal name="network_peer_packet">
+ <signal name="peer_packet">
<argument index="0" name="id" type="int" />
<argument index="1" name="packet" type="PackedByteArray" />
<description>
- Emitted when this MultiplayerAPI's [member network_peer] receive a [code]packet[/code] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet.
+ Emitted when this MultiplayerAPI's [member multiplayer_peer] receives a [code]packet[/code] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet.
</description>
</signal>
<signal name="server_disconnected">
<description>
- Emitted when this MultiplayerAPI's [member network_peer] disconnects from server. Only emitted on clients.
+ Emitted when this MultiplayerAPI's [member multiplayer_peer] disconnects from server. Only emitted on clients.
</description>
</signal>
</signals>
<constants>
- <constant name="RPC_MODE_DISABLED" value="0" enum="RPCMode">
- Used with [method Node.rpc_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods.
- </constant>
- <constant name="RPC_MODE_ANY" value="1" enum="RPCMode">
- Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the [code]@rpc(any)[/code] annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not.
- </constant>
- <constant name="RPC_MODE_AUTHORITY" value="2" enum="RPCMode">
- Used with [method Node.rpc_config] to set a method to be callable remotely only by the current network authority (which is the server by default). Analogous to the [code]@rpc(auth)[/code] annotation. See [method Node.set_network_authority].
- </constant>
</constants>
</class>
diff --git a/doc/classes/MultiplayerPeer.xml b/doc/classes/MultiplayerPeer.xml
index adaa359168..411317cdc8 100644
--- a/doc/classes/MultiplayerPeer.xml
+++ b/doc/classes/MultiplayerPeer.xml
@@ -4,7 +4,7 @@
A high-level network interface to simplify multiplayer interactions.
</brief_description>
<description>
- Manages the connection to network peers. Assigns unique IDs to each client connected to the server. See also [MultiplayerAPI].
+ Manages the connection to multiplayer peers. Assigns unique IDs to each client connected to the server. See also [MultiplayerAPI].
[b]Note:[/b] The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice.
</description>
<tutorials>
@@ -57,9 +57,9 @@
</member>
<member name="transfer_channel" type="int" setter="set_transfer_channel" getter="get_transfer_channel" default="0">
The channel to use to send packets. Many network APIs such as ENet and WebRTC allow the creation of multiple independent channels which behaves, in a way, like separate connections. This means that reliable data will only block delivery of other packets on that channel, and ordering will only be in respect to the channel the packet is being sent on. Using different channels to send [b]different and independent[/b] state updates is a common way to optimize network usage and decrease latency in fast-paced games.
- [b]Note:[/b] The default channel ([code]0[/code]) actually works as 3 separate channels (one for each [enum TransferMode]) so that [constant TRANSFER_MODE_RELIABLE] and [constant TRANSFER_MODE_UNRELIABLE_ORDERED] does not interact with each other by default. Refer to the specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels correctly.
+ [b]Note:[/b] The default channel ([code]0[/code]) actually works as 3 separate channels (one for each [enum TransferMode]) so that [constant TRANSFER_MODE_RELIABLE] and [constant TRANSFER_MODE_ORDERED] does not interact with each other by default. Refer to the specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels correctly.
</member>
- <member name="transfer_mode" type="int" setter="set_transfer_mode" getter="get_transfer_mode" enum="MultiplayerPeer.TransferMode" default="0">
+ <member name="transfer_mode" type="int" setter="set_transfer_mode" getter="get_transfer_mode" enum="TransferMode" default="0">
The manner in which to send packets to the [code]target_peer[/code]. See [enum TransferMode].
</member>
</members>
@@ -93,15 +93,6 @@
</signal>
</signals>
<constants>
- <constant name="TRANSFER_MODE_UNRELIABLE" value="0" enum="TransferMode">
- Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_UNRELIABLE_ORDERED]. Use for non-critical data, and always consider whether the order matters.
- </constant>
- <constant name="TRANSFER_MODE_UNRELIABLE_ORDERED" value="1" enum="TransferMode">
- Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than [constant TRANSFER_MODE_RELIABLE]. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data.
- </constant>
- <constant name="TRANSFER_MODE_RELIABLE" value="2" enum="TransferMode">
- Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly.
- </constant>
<constant name="CONNECTION_DISCONNECTED" value="0" enum="ConnectionStatus">
The ongoing connection disconnected.
</constant>
diff --git a/doc/classes/MultiplayerReplicator.xml b/doc/classes/MultiplayerReplicator.xml
index 0778a7335f..e0c309ef39 100644
--- a/doc/classes/MultiplayerReplicator.xml
+++ b/doc/classes/MultiplayerReplicator.xml
@@ -44,7 +44,7 @@
<argument index="2" name="data" type="Variant" default="null" />
<argument index="3" name="path" type="NodePath" default="NodePath(&quot;&quot;)" />
<description>
- Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal despawned]. In all other cases no deletion happens, and the signal [signal despawn_requested] is emitted instead.
+ Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal despawned]. In all other cases no deletion happens, and the signal [signal despawn_requested] is emitted instead.
</description>
</method>
<method name="send_spawn">
@@ -54,7 +54,7 @@
<argument index="2" name="data" type="Variant" default="null" />
<argument index="3" name="path" type="NodePath" default="NodePath(&quot;&quot;)" />
<description>
- Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal spawned]. In all other cases no instantiation happens, and the signal [signal spawn_requested] is emitted instead.
+ Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal spawned]. In all other cases no instantiation happens, and the signal [signal spawn_requested] is emitted instead.
</description>
</method>
<method name="send_sync">
@@ -62,7 +62,7 @@
<argument index="0" name="peer_id" type="int" />
<argument index="1" name="scene_id" type="int" />
<argument index="2" name="data" type="PackedByteArray" />
- <argument index="3" name="transfer_mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" />
+ <argument index="3" name="transfer_mode" type="int" enum="TransferMode" default="2" />
<argument index="4" name="channel" type="int" default="0" />
<description>
Sends a sync request for the instances of the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). This function can only be called manually when overriding the send and receive sync functions (see [method sync_config]).
diff --git a/doc/classes/Mutex.xml b/doc/classes/Mutex.xml
index f97b2344a5..0e6b1e3e44 100644
--- a/doc/classes/Mutex.xml
+++ b/doc/classes/Mutex.xml
@@ -14,18 +14,21 @@
<return type="void" />
<description>
Locks this [Mutex], blocks until it is unlocked by the current owner.
+ [b]Note:[/b] This function returns without blocking if the thread already has ownership of the mutex.
</description>
</method>
<method name="try_lock">
<return type="int" enum="Error" />
<description>
Tries locking this [Mutex], but does not block. Returns [constant OK] on success, [constant ERR_BUSY] otherwise.
+ [b]Note:[/b] This function returns [constant OK] if the thread already has ownership of the mutex.
</description>
</method>
<method name="unlock">
<return type="void" />
<description>
Unlocks this [Mutex], leaving it to other threads.
+ [b]Note:[/b] If a thread called [method lock] or [method try_lock] multiple times while already having ownership of the mutex, it must also call [method unlock] the same number of times in order to unlock it correctly.
</description>
</method>
</methods>
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 7d79c50466..608d76cd9f 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -153,6 +153,7 @@
<description>
Adds the node to a group. Groups are helpers to name and organize a subset of nodes, for example "enemies" or "collectables". A node can be in any number of groups. Nodes can be assigned a group at any time, but will not be added until they are inside the scene tree (see [method is_inside_tree]). See notes in the description, and the group methods in [SceneTree].
The [code]persistent[/code] option is used when packing node to [PackedScene] and saving to file. Non-persistent groups aren't stored.
+ [b]Note:[/b] For performance reasons, the order of node groups is [i]not[/i] guaranteed. The order of node groups should not be relied upon as it can vary across project runs.
</description>
</method>
<method name="can_process" qualifiers="const">
@@ -236,6 +237,7 @@
<return type="Array" />
<description>
Returns an array listing the groups that the node is a member of.
+ [b]Note:[/b] For performance reasons, the order of node groups is [i]not[/i] guaranteed. The order of node groups should not be relied upon as it can vary across project runs.
</description>
</method>
<method name="get_index" qualifiers="const">
@@ -246,10 +248,10 @@
If [code]include_internal[/code] is [code]false[/code], the index won't take internal children into account, i.e. first non-internal child will have index of 0 (see [code]internal[/code] parameter in [method add_child]).
</description>
</method>
- <method name="get_network_authority" qualifiers="const">
+ <method name="get_multiplayer_authority" qualifiers="const">
<return type="int" />
<description>
- Returns the peer ID of the network authority for this node. See [method set_network_authority].
+ Returns the peer ID of the multiplayer authority for this node. See [method set_multiplayer_authority].
</description>
</method>
<method name="get_node" qualifiers="const">
@@ -417,10 +419,10 @@
Returns [code]true[/code] if this node is currently inside a [SceneTree].
</description>
</method>
- <method name="is_network_authority" qualifiers="const">
+ <method name="is_multiplayer_authority" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the local system is the authority of this node.
+ Returns [code]true[/code] if the local system is the multiplayer authority of this node.
</description>
</method>
<method name="is_physics_processing" qualifiers="const">
@@ -578,17 +580,17 @@
<argument index="0" name="method" type="StringName" />
<description>
Sends a remote procedure call request for the given [code]method[/code] to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same node name. Behaviour depends on the RPC configuration for the given method, see [method rpc_config]. Methods are not exposed to RPCs by default. Returns an empty [Variant].
- [b]Note:[/b] You can only safely use RPCs on clients after you received the [code]connected_to_server[/code] signal from the [MultiplayerAPI]. You also need to keep track of the connection state, either by the [MultiplayerAPI] signals like [code]server_disconnected[/code] or by checking [code]get_multiplayer().network_peer.get_connection_status() == CONNECTION_CONNECTED[/code].
+ [b]Note:[/b] You can only safely use RPCs on clients after you received the [code]connected_to_server[/code] signal from the [MultiplayerAPI]. You also need to keep track of the connection state, either by the [MultiplayerAPI] signals like [code]server_disconnected[/code] or by checking [code]get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED[/code].
</description>
</method>
<method name="rpc_config">
<return type="int" />
<argument index="0" name="method" type="StringName" />
- <argument index="1" name="rpc_mode" type="int" enum="MultiplayerAPI.RPCMode" />
- <argument index="2" name="transfer_mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" />
+ <argument index="1" name="rpc_mode" type="int" enum="RPCMode" />
+ <argument index="2" name="transfer_mode" type="int" enum="TransferMode" default="2" />
<argument index="3" name="channel" type="int" default="0" />
<description>
- Changes the RPC mode for the given [code]method[/code] to the given [code]rpc_mode[/code], optionally specifying the [code]transfer_mode[/code] and [code]channel[/code] (on supported peers). See [enum MultiplayerAPI.RPCMode] and [enum MultiplayerPeer.TransferMode]. An alternative is annotating methods and properties with the corresponding annotation ([code]@rpc(any)[/code], [code]@rpc(auth)[/code]). By default, methods are not exposed to networking (and RPCs).
+ Changes the RPC mode for the given [code]method[/code] to the given [code]rpc_mode[/code], optionally specifying the [code]transfer_mode[/code] and [code]channel[/code] (on supported peers). See [enum RPCMode] and [enum TransferMode]. An alternative is annotating methods and properties with the corresponding annotation ([code]@rpc(any)[/code], [code]@rpc(auth)[/code]). By default, methods are not exposed to networking (and RPCs).
</description>
</method>
<method name="rpc_id" qualifiers="vararg">
@@ -620,12 +622,12 @@
<description>
</description>
</method>
- <method name="set_network_authority">
+ <method name="set_multiplayer_authority">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="recursive" type="bool" default="true" />
<description>
- Sets the node's network authority to the peer with the given peer ID. The network authority is the peer that has authority over the node on the network. Useful in conjunction with [method rpc_config] and the [MultiplayerAPI]. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If [code]recursive[/code], the given peer is recursively set as the authority for all children of this node.
+ Sets the node's multiplayer authority to the peer with the given peer ID. The multiplayer authority is the peer that has authority over the node on the network. Useful in conjunction with [method rpc_config] and the [MultiplayerAPI]. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If [code]recursive[/code], the given peer is recursively set as the authority for all children of this node.
</description>
</method>
<method name="set_physics_process">
diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml
index cc790b7c28..4f5c2bbd6e 100644
--- a/doc/classes/Node2D.xml
+++ b/doc/classes/Node2D.xml
@@ -23,6 +23,7 @@
<argument index="0" name="point" type="Vector2" />
<description>
Returns the angle between the node and the [code]point[/code] in radians.
+ [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/node2d_get_angle_to.png]Illustration of the returned angle.[/url]
</description>
</method>
<method name="get_relative_transform_to_parent" qualifiers="const">
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 757730f6c8..305258c8c5 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -215,7 +215,7 @@
<method name="get_locale" qualifiers="const">
<return type="String" />
<description>
- Returns the host OS locale as a string of the form [code]language_Script_COUNTRY_VARIANT@extra[/code].
+ Returns the host OS locale as a string of the form [code]language_Script_COUNTRY_VARIANT@extra[/code]. If you want only the language code and not the fully specified locale from the OS, you can use [method get_locale_language].
[code]language[/code] - 2 or 3-letter [url=https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes]language code[/url], in lower case.
[code]Script[/code] - optional, 4-letter [url=https://en.wikipedia.org/wiki/ISO_15924]script code[/url], in title case.
[code]COUNTRY[/code] - optional, 2 or 3-letter [url=https://en.wikipedia.org/wiki/ISO_3166-1]country code[/url], in upper case.
@@ -223,6 +223,13 @@
[code]extra[/code] - optional, semicolon separated list of additional key words. Currency, calendar, sort order and numbering system information.
</description>
</method>
+ <method name="get_locale_language" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the host OS locale's 2 or 3-letter [url=https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes]language code[/url] as a string which should be consistent on all platforms. This is equivalent to extracting the [code]language[/code] part of the [method get_locale] string.
+ This can be used to narrow down fully specified locale strings to only the "common" language code, when you don't need the additional information about country code or variants. For example, for a French Canadian user with [code]fr_CA[/code] locale, this would return [code]fr[/code].
+ </description>
+ </method>
<method name="get_model_name" qualifiers="const">
<return type="String" />
<description>
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index c9e9a0699c..ed045f8390 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -92,12 +92,12 @@
Calls the [code]method[/code] on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:
[codeblocks]
[gdscript]
- var node = Node2D.new()
- node.call("set", "position", Vector2(42, 0))
+ var node = Node3D.new()
+ node.call("rotate", Vector3(1.0, 0.0, 0.0), 1.571)
[/gdscript]
[csharp]
- var node = new Node2D();
- node.Call("set", "position", new Vector2(42, 0));
+ var node = new Node3D();
+ node.Call("rotate", new Vector3(1f, 0f, 0f), 1.571f);
[/csharp]
[/codeblocks]
[b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).
@@ -110,12 +110,12 @@
Calls the [code]method[/code] on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:
[codeblocks]
[gdscript]
- var node = Node2D.new()
- node.call_deferred("set", "position", Vector2(42, 0))
+ var node = Node3D.new()
+ node.call_deferred("rotate", Vector3(1.0, 0.0, 0.0), 1.571)
[/gdscript]
[csharp]
- var node = new Node2D();
- node.CallDeferred("set", "position", new Vector2(42, 0));
+ var node = new Node3D();
+ node.CallDeferred("rotate", new Vector3(1f, 0f, 0f), 1.571f);
[/csharp]
[/codeblocks]
[b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).
@@ -129,12 +129,12 @@
Calls the [code]method[/code] on the object and returns the result. Contrarily to [method call], this method does not support a variable number of arguments but expects all parameters to be via a single [Array].
[codeblocks]
[gdscript]
- var node = Node2D.new()
- node.callv("set", ["position", Vector2(42, 0)])
+ var node = Node3D.new()
+ node.callv("rotate", [Vector3(1.0, 0.0, 0.0), 1.571])
[/gdscript]
[csharp]
- var node = new Node2D();
- node.Callv("set", new Godot.Collections.Array { "position", new Vector2(42, 0) });
+ var node = new Node3D();
+ node.Callv("rotate", new Godot.Collections.Array { new Vector3(1f, 0f, 0f), 1.571f });
[/csharp]
[/codeblocks]
</description>
@@ -331,7 +331,8 @@
<method name="get_class" qualifiers="const">
<return type="String" />
<description>
- Returns the object's class as a [String].
+ Returns the object's class as a [String]. See also [method is_class].
+ [b]Note:[/b] [method get_class] does not take [code]class_name[/code] declarations into account. If the object has a [code]class_name[/code] defined, the base class name will be returned instead.
</description>
</method>
<method name="get_incoming_connections" qualifiers="const">
@@ -441,7 +442,8 @@
<return type="bool" />
<argument index="0" name="class" type="String" />
<description>
- Returns [code]true[/code] if the object inherits from the given [code]class[/code].
+ Returns [code]true[/code] if the object inherits from the given [code]class[/code]. See also [method get_class].
+ [b]Note:[/b] [method is_class] does not take [code]class_name[/code] declarations into account. If the object has a [code]class_name[/code] defined, [method is_class] will return [code]false[/code] for that name.
</description>
</method>
<method name="is_connected" qualifiers="const">
diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml
index af92590da3..72f134e9e9 100644
--- a/doc/classes/PackedByteArray.xml
+++ b/doc/classes/PackedByteArray.xml
@@ -270,7 +270,7 @@
Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string.
</description>
</method>
- <method name="has">
+ <method name="has" qualifiers="const">
<return type="bool" />
<argument index="0" name="value" type="int" />
<description>
diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml
index a5a5703bfa..2dfaefca23 100644
--- a/doc/classes/PackedColorArray.xml
+++ b/doc/classes/PackedColorArray.xml
@@ -56,7 +56,7 @@
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements.
</description>
</method>
- <method name="has">
+ <method name="has" qualifiers="const">
<return type="bool" />
<argument index="0" name="value" type="Color" />
<description>
diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml
index 9e7dd8f99e..5c05dd9fa7 100644
--- a/doc/classes/PackedFloat32Array.xml
+++ b/doc/classes/PackedFloat32Array.xml
@@ -57,7 +57,7 @@
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements.
</description>
</method>
- <method name="has">
+ <method name="has" qualifiers="const">
<return type="bool" />
<argument index="0" name="value" type="float" />
<description>
diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml
index ff4cf0edf8..921ca23859 100644
--- a/doc/classes/PackedFloat64Array.xml
+++ b/doc/classes/PackedFloat64Array.xml
@@ -57,7 +57,7 @@
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements.
</description>
</method>
- <method name="has">
+ <method name="has" qualifiers="const">
<return type="bool" />
<argument index="0" name="value" type="float" />
<description>
diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml
index 2e9716b665..dfc9cbf939 100644
--- a/doc/classes/PackedInt32Array.xml
+++ b/doc/classes/PackedInt32Array.xml
@@ -57,7 +57,7 @@
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements.
</description>
</method>
- <method name="has">
+ <method name="has" qualifiers="const">
<return type="bool" />
<argument index="0" name="value" type="int" />
<description>
diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml
index 1e7fff3bc6..dd38a4f5c2 100644
--- a/doc/classes/PackedInt64Array.xml
+++ b/doc/classes/PackedInt64Array.xml
@@ -57,7 +57,7 @@
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements.
</description>
</method>
- <method name="has">
+ <method name="has" qualifiers="const">
<return type="bool" />
<argument index="0" name="value" type="int" />
<description>
diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml
index 1374496b52..618123855f 100644
--- a/doc/classes/PackedScene.xml
+++ b/doc/classes/PackedScene.xml
@@ -22,23 +22,23 @@
AddChild(scene);
[/csharp]
[/codeblocks]
- [b]Example of saving a node with different owners:[/b] The following example creates 3 objects: [code]Node2D[/code] ([code]node[/code]), [code]RigidBody2D[/code] ([code]rigid[/code]) and [code]CollisionObject2D[/code] ([code]collision[/code]). [code]collision[/code] is a child of [code]rigid[/code] which is a child of [code]node[/code]. Only [code]rigid[/code] is owned by [code]node[/code] and [code]pack[/code] will therefore only save those two nodes, but not [code]collision[/code].
+ [b]Example of saving a node with different owners:[/b] The following example creates 3 objects: [code]Node2D[/code] ([code]node[/code]), [code]RigidDynamicBody2D[/code] ([code]body[/code]) and [code]CollisionObject2D[/code] ([code]collision[/code]). [code]collision[/code] is a child of [code]body[/code] which is a child of [code]node[/code]. Only [code]body[/code] is owned by [code]node[/code] and [code]pack[/code] will therefore only save those two nodes, but not [code]collision[/code].
[codeblocks]
[gdscript]
# Create the objects.
var node = Node2D.new()
- var rigid = RigidBody2D.new()
+ var body = RigidDynamicBody2D.new()
var collision = CollisionShape2D.new()
# Create the object hierarchy.
- rigid.add_child(collision)
- node.add_child(rigid)
+ body.add_child(collision)
+ node.add_child(body)
- # Change owner of `rigid`, but not of `collision`.
- rigid.owner = node
+ # Change owner of `body`, but not of `collision`.
+ body.owner = node
var scene = PackedScene.new()
- # Only `node` and `rigid` are now packed.
+ # Only `node` and `body` are now packed.
var result = scene.pack(node)
if result == OK:
var error = ResourceSaver.save("res://path/name.tscn", scene) # Or "user://..."
@@ -48,18 +48,18 @@
[csharp]
// Create the objects.
var node = new Node2D();
- var rigid = new RigidBody2D();
+ var body = new RigidDynamicBody2D();
var collision = new CollisionShape2D();
// Create the object hierarchy.
- rigid.AddChild(collision);
- node.AddChild(rigid);
+ body.AddChild(collision);
+ node.AddChild(body);
- // Change owner of `rigid`, but not of `collision`.
- rigid.Owner = node;
+ // Change owner of `body`, but not of `collision`.
+ body.Owner = node;
var scene = new PackedScene();
- // Only `node` and `rigid` are now packed.
+ // Only `node` and `body` are now packed.
Error result = scene.Pack(node);
if (result == Error.Ok)
{
diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml
index 04113d4a2e..c2055531a5 100644
--- a/doc/classes/PackedStringArray.xml
+++ b/doc/classes/PackedStringArray.xml
@@ -57,7 +57,7 @@
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements.
</description>
</method>
- <method name="has">
+ <method name="has" qualifiers="const">
<return type="bool" />
<argument index="0" name="value" type="String" />
<description>
diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml
index 76d3aff20e..51b7c951da 100644
--- a/doc/classes/PackedVector2Array.xml
+++ b/doc/classes/PackedVector2Array.xml
@@ -57,7 +57,7 @@
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements.
</description>
</method>
- <method name="has">
+ <method name="has" qualifiers="const">
<return type="bool" />
<argument index="0" name="value" type="Vector2" />
<description>
diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml
index 1a35f71619..04a5e3d42e 100644
--- a/doc/classes/PackedVector3Array.xml
+++ b/doc/classes/PackedVector3Array.xml
@@ -56,7 +56,7 @@
Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements.
</description>
</method>
- <method name="has">
+ <method name="has" qualifiers="const">
<return type="bool" />
<argument index="0" name="value" type="Vector3" />
<description>
diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml
index 335c3d254b..6e905eace6 100644
--- a/doc/classes/Performance.xml
+++ b/doc/classes/Performance.xml
@@ -169,7 +169,7 @@
<constant name="RENDER_BUFFER_MEM_USED" value="15" enum="Monitor">
</constant>
<constant name="PHYSICS_2D_ACTIVE_OBJECTS" value="16" enum="Monitor">
- Number of active [RigidBody2D] nodes in the game.
+ Number of active [RigidDynamicBody2D] nodes in the game.
</constant>
<constant name="PHYSICS_2D_COLLISION_PAIRS" value="17" enum="Monitor">
Number of collision pairs in the 2D physics engine.
@@ -178,7 +178,7 @@
Number of islands in the 2D physics engine.
</constant>
<constant name="PHYSICS_3D_ACTIVE_OBJECTS" value="19" enum="Monitor">
- Number of active [RigidBody3D] and [VehicleBody3D] nodes in the game.
+ Number of active [RigidDynamicBody3D] and [VehicleBody3D] nodes in the game.
</constant>
<constant name="PHYSICS_3D_COLLISION_PAIRS" value="20" enum="Monitor">
Number of collision pairs in the 3D physics engine.
diff --git a/doc/classes/PhysicalBone2D.xml b/doc/classes/PhysicalBone2D.xml
index b4d92475a1..8fa42a9596 100644
--- a/doc/classes/PhysicalBone2D.xml
+++ b/doc/classes/PhysicalBone2D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="PhysicalBone2D" inherits="RigidBody2D" version="4.0">
+<class name="PhysicalBone2D" inherits="RigidDynamicBody2D" version="4.0">
<brief_description>
A 2D node that can be used for physically aware bones in 2D.
</brief_description>
<description>
- The [code]PhysicalBone2D[/code] node is a [RigidBody2D]-based node that can be used to make [Bone2D] nodes in a [Skeleton2D] react to physics. This node is very similar to the [PhysicalBone3D] node, just for 2D instead of 3D.
+ The [code]PhysicalBone2D[/code] node is a [RigidDynamicBody2D]-based node that can be used to make [Bone2D] nodes in a [Skeleton2D] react to physics. This node is very similar to the [PhysicalBone3D] node, just for 2D instead of 3D.
[b]Note:[/b] To have the Bone2D nodes visually follow the [code]PhysicalBone2D[/code] node, use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes.
[b]Note:[/b] The PhysicalBone2D node does not automatically create a [Joint2D] node to keep [code]PhysicalBone2D[/code] nodes together. You will need to create these manually. For most cases, you want to use a [PinJoint2D] node. The [code]PhysicalBone2D[/code] node can automatically configure the [Joint2D] node once it's been created as a child node.
</description>
diff --git a/doc/classes/PhysicsDirectBodyState2D.xml b/doc/classes/PhysicsDirectBodyState2D.xml
index 4c6adfca32..56c34615ce 100644
--- a/doc/classes/PhysicsDirectBodyState2D.xml
+++ b/doc/classes/PhysicsDirectBodyState2D.xml
@@ -4,9 +4,10 @@
Direct access object to a physics body in the [PhysicsServer2D].
</brief_description>
<description>
- Provides direct access to a physics body in the [PhysicsServer2D], allowing safe changes to physics properties. This object is passed via the direct state callback of dynamic bodies, and is intended for changing the direct state of that body. See [method RigidBody2D._integrate_forces].
+ Provides direct access to a physics body in the [PhysicsServer2D], allowing safe changes to physics properties. This object is passed via the direct state callback of dynamic bodies, and is intended for changing the direct state of that body. See [method RigidDynamicBody2D._integrate_forces].
</description>
<tutorials>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
<link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
@@ -107,7 +108,7 @@
<return type="int" />
<description>
Returns the number of contacts this body has with other bodies.
- [b]Note:[/b] By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidBody2D.contact_monitor].
+ [b]Note:[/b] By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidDynamicBody2D.contact_monitor].
</description>
</method>
<method name="get_contact_local_normal" qualifiers="const">
@@ -155,6 +156,9 @@
<member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity">
The body's rotational velocity.
</member>
+ <member name="center_of_mass" type="Vector2" setter="" getter="get_center_of_mass">
+ The body's center of mass.
+ </member>
<member name="inverse_inertia" type="float" setter="" getter="get_inverse_inertia">
The inverse of the inertia of the body.
</member>
diff --git a/doc/classes/PhysicsDirectBodyState3D.xml b/doc/classes/PhysicsDirectBodyState3D.xml
index 271668e339..a7458ff495 100644
--- a/doc/classes/PhysicsDirectBodyState3D.xml
+++ b/doc/classes/PhysicsDirectBodyState3D.xml
@@ -4,9 +4,11 @@
Direct access object to a physics body in the [PhysicsServer3D].
</brief_description>
<description>
- Provides direct access to a physics body in the [PhysicsServer3D], allowing safe changes to physics properties. This object is passed via the direct state callback of dynamic bodies, and is intended for changing the direct state of that body. See [method RigidBody3D._integrate_forces].
+ Provides direct access to a physics body in the [PhysicsServer3D], allowing safe changes to physics properties. This object is passed via the direct state callback of dynamic bodies, and is intended for changing the direct state of that body. See [method RigidDynamicBody3D._integrate_forces].
</description>
<tutorials>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
<method name="add_central_force">
@@ -101,7 +103,7 @@
<return type="int" />
<description>
Returns the number of contacts this body has with other bodies.
- [b]Note:[/b] By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidBody3D.contact_monitor].
+ [b]Note:[/b] By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidDynamicBody3D.contact_monitor].
</description>
</method>
<method name="get_contact_impulse" qualifiers="const">
@@ -157,6 +159,7 @@
The body's rotational velocity.
</member>
<member name="center_of_mass" type="Vector3" setter="" getter="get_center_of_mass">
+ The body's center of mass.
</member>
<member name="inverse_inertia" type="Vector3" setter="" getter="get_inverse_inertia">
The inverse of the inertia of the body.
diff --git a/doc/classes/PhysicsDirectSpaceState2D.xml b/doc/classes/PhysicsDirectSpaceState2D.xml
index e84b3e0e49..536c7e4e04 100644
--- a/doc/classes/PhysicsDirectSpaceState2D.xml
+++ b/doc/classes/PhysicsDirectSpaceState2D.xml
@@ -7,7 +7,8 @@
Direct access object to a space in the [PhysicsServer2D]. It's used mainly to do queries against objects and areas residing in a given space.
</description>
<tutorials>
- <link title="Ray-Casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
<method name="cast_motion">
@@ -47,7 +48,7 @@
<argument index="0" name="point" type="Vector2" />
<argument index="1" name="max_results" type="int" default="32" />
<argument index="2" name="exclude" type="Array" default="[]" />
- <argument index="3" name="collision_mask" type="int" default="2147483647" />
+ <argument index="3" name="collision_mask" type="int" default="4294967295" />
<argument index="4" name="collide_with_bodies" type="bool" default="true" />
<argument index="5" name="collide_with_areas" type="bool" default="false" />
<description>
@@ -57,7 +58,7 @@
[code]metadata[/code]: The intersecting shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data].
[code]rid[/code]: The intersecting object's [RID].
[code]shape[/code]: The shape index of the colliding shape.
- Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to detect, or booleans to determine if the ray should collide with [PhysicsBody2D]s or [Area2D]s, respectively.
+ Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to detect (all layers by default), or booleans to determine if the ray should collide with [PhysicsBody2D]s or [Area2D]s, respectively.
[b]Note:[/b] [ConcavePolygonShape2D]s and [CollisionPolygon2D]s in [code]Segments[/code] build mode are not solid shapes. Therefore, they will not be detected.
</description>
</method>
@@ -67,10 +68,18 @@
<argument index="1" name="canvas_instance_id" type="int" />
<argument index="2" name="max_results" type="int" default="32" />
<argument index="3" name="exclude" type="Array" default="[]" />
- <argument index="4" name="collision_mask" type="int" default="2147483647" />
+ <argument index="4" name="collision_mask" type="int" default="4294967295" />
<argument index="5" name="collide_with_bodies" type="bool" default="true" />
<argument index="6" name="collide_with_areas" type="bool" default="false" />
<description>
+ Checks whether a point is inside any solid shape, in a specific canvas layer given by [code]canvas_instance_id[/code]. The shapes the point is inside of are returned in an array containing dictionaries with the following fields:
+ [code]collider[/code]: The colliding object.
+ [code]collider_id[/code]: The colliding object's ID.
+ [code]metadata[/code]: The intersecting shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data].
+ [code]rid[/code]: The intersecting object's [RID].
+ [code]shape[/code]: The shape index of the colliding shape.
+ Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to detect (all layers by default), or booleans to determine if the ray should collide with [PhysicsBody2D]s or [Area2D]s, respectively.
+ [b]Note:[/b] [ConcavePolygonShape2D]s and [CollisionPolygon2D]s in [code]Segments[/code] build mode are not solid shapes. Therefore, they will not be detected.
</description>
</method>
<method name="intersect_ray">
@@ -78,7 +87,7 @@
<argument index="0" name="from" type="Vector2" />
<argument index="1" name="to" type="Vector2" />
<argument index="2" name="exclude" type="Array" default="[]" />
- <argument index="3" name="collision_mask" type="int" default="2147483647" />
+ <argument index="3" name="collision_mask" type="int" default="4294967295" />
<argument index="4" name="collide_with_bodies" type="bool" default="true" />
<argument index="5" name="collide_with_areas" type="bool" default="false" />
<description>
@@ -91,7 +100,7 @@
[code]rid[/code]: The intersecting object's [RID].
[code]shape[/code]: The shape index of the colliding shape.
If the ray did not intersect anything, then an empty dictionary is returned instead.
- Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to detect, or booleans to determine if the ray should collide with [PhysicsBody2D]s or [Area2D]s, respectively.
+ Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to detect (all layers by default), or booleans to determine if the ray should collide with [PhysicsBody2D]s or [Area2D]s, respectively.
</description>
</method>
<method name="intersect_shape">
diff --git a/doc/classes/PhysicsDirectSpaceState3D.xml b/doc/classes/PhysicsDirectSpaceState3D.xml
index 13db50a2c7..4e6bd8456f 100644
--- a/doc/classes/PhysicsDirectSpaceState3D.xml
+++ b/doc/classes/PhysicsDirectSpaceState3D.xml
@@ -7,6 +7,7 @@
Direct access object to a space in the [PhysicsServer3D]. It's used mainly to do queries against objects and areas residing in a given space.
</description>
<tutorials>
+ <link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
<link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
</tutorials>
<methods>
@@ -47,7 +48,7 @@
<argument index="0" name="from" type="Vector3" />
<argument index="1" name="to" type="Vector3" />
<argument index="2" name="exclude" type="Array" default="[]" />
- <argument index="3" name="collision_mask" type="int" default="2147483647" />
+ <argument index="3" name="collision_mask" type="int" default="4294967295" />
<argument index="4" name="collide_with_bodies" type="bool" default="true" />
<argument index="5" name="collide_with_areas" type="bool" default="false" />
<description>
@@ -59,7 +60,7 @@
[code]rid[/code]: The intersecting object's [RID].
[code]shape[/code]: The shape index of the colliding shape.
If the ray did not intersect anything, then an empty dictionary is returned instead.
- Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to detect, or booleans to determine if the ray should collide with [PhysicsBody3D]s or [Area3D]s, respectively.
+ Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to detect (all layers by default), or booleans to determine if the ray should collide with [PhysicsBody3D]s or [Area3D]s, respectively.
</description>
</method>
<method name="intersect_shape">
diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml
index 9867b98ae6..7e5d7ca704 100644
--- a/doc/classes/PhysicsServer2D.xml
+++ b/doc/classes/PhysicsServer2D.xml
@@ -373,7 +373,7 @@
</description>
</method>
<method name="body_get_param" qualifiers="const">
- <return type="float" />
+ <return type="Variant" />
<argument index="0" name="body" type="RID" />
<argument index="1" name="param" type="int" enum="PhysicsServer2D.BodyParameter" />
<description>
@@ -449,6 +449,13 @@
Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.
</description>
</method>
+ <method name="body_reset_mass_properties">
+ <return type="void" />
+ <argument index="0" name="body" type="RID" />
+ <description>
+ Restores the default inertia and center of mass based on shapes to cancel any custom values previously set using [method body_set_param].
+ </description>
+ </method>
<method name="body_set_axis_velocity">
<return type="void" />
<argument index="0" name="body" type="RID" />
@@ -522,7 +529,7 @@
<return type="void" />
<argument index="0" name="body" type="RID" />
<argument index="1" name="param" type="int" enum="PhysicsServer2D.BodyParameter" />
- <argument index="2" name="value" type="float" />
+ <argument index="2" name="value" type="Variant" />
<description>
Sets a body parameter. See [enum BodyParameter] for a list of available parameters.
</description>
@@ -816,7 +823,7 @@
Sets the value for a space parameter. See [enum SpaceParameter] for a list of available parameters.
</description>
</method>
- <method name="world_margin_shape_create">
+ <method name="world_boundary_shape_create">
<return type="RID" />
<description>
</description>
@@ -846,8 +853,8 @@
</constant>
<constant name="SPACE_PARAM_TEST_MOTION_MIN_CONTACT_DEPTH" value="7" enum="SpaceParameter">
</constant>
- <constant name="SHAPE_WORLD_MARGIN" value="0" enum="ShapeType">
- This is the constant for creating world margin shapes. A world margin shape is an [i]infinite[/i] line with an origin point, and a normal. Thus, it can be used for front/behind checks.
+ <constant name="SHAPE_WORLD_BOUNDARY" value="0" enum="ShapeType">
+ This is the constant for creating world boundary shapes. A world boundary shape is an [i]infinite[/i] line with an origin point, and a normal. Thus, it can be used for front/behind checks.
</constant>
<constant name="SHAPE_SEPARATION_RAY" value="1" enum="ShapeType">
This is the constant for creating separation ray shapes. A separation ray is defined by a length and separates itself from what is touching its far endpoint. Useful for character controllers.
@@ -913,7 +920,7 @@
This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
</constant>
<constant name="BODY_MODE_STATIC" value="0" enum="BodyMode">
- Constant for static bodies. In this mode, a body can be only moved by user code.
+ Constant for static bodies. In this mode, a body can be only moved by user code and doesn't collide with other bodies along its path when moved.
</constant>
<constant name="BODY_MODE_KINEMATIC" value="1" enum="BodyMode">
Constant for kinematic bodies. In this mode, a body can be only moved by user code and collides with other bodies along its path.
@@ -936,16 +943,19 @@
<constant name="BODY_PARAM_INERTIA" value="3" enum="BodyParameter">
Constant to set/get a body's inertia.
</constant>
- <constant name="BODY_PARAM_GRAVITY_SCALE" value="4" enum="BodyParameter">
+ <constant name="BODY_PARAM_CENTER_OF_MASS" value="4" enum="BodyParameter">
+ Constant to set/get a body's center of mass.
+ </constant>
+ <constant name="BODY_PARAM_GRAVITY_SCALE" value="5" enum="BodyParameter">
Constant to set/get a body's gravity multiplier.
</constant>
- <constant name="BODY_PARAM_LINEAR_DAMP" value="5" enum="BodyParameter">
+ <constant name="BODY_PARAM_LINEAR_DAMP" value="6" enum="BodyParameter">
Constant to set/get a body's linear dampening factor.
</constant>
- <constant name="BODY_PARAM_ANGULAR_DAMP" value="6" enum="BodyParameter">
+ <constant name="BODY_PARAM_ANGULAR_DAMP" value="7" enum="BodyParameter">
Constant to set/get a body's angular dampening factor.
</constant>
- <constant name="BODY_PARAM_MAX" value="7" enum="BodyParameter">
+ <constant name="BODY_PARAM_MAX" value="8" enum="BodyParameter">
Represents the size of the [enum BodyParameter] enum.
</constant>
<constant name="BODY_STATE_TRANSFORM" value="0" enum="BodyState">
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index 46cbe48b28..5497ae7412 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -347,7 +347,7 @@
</description>
</method>
<method name="body_get_param" qualifiers="const">
- <return type="float" />
+ <return type="Variant" />
<argument index="0" name="body" type="RID" />
<argument index="1" name="param" type="int" enum="PhysicsServer3D.BodyParameter" />
<description>
@@ -430,6 +430,13 @@
Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.
</description>
</method>
+ <method name="body_reset_mass_properties">
+ <return type="void" />
+ <argument index="0" name="body" type="RID" />
+ <description>
+ Restores the default inertia and center of mass based on shapes to cancel any custom values previously set using [method body_set_param].
+ </description>
+ </method>
<method name="body_set_axis_lock">
<return type="void" />
<argument index="0" name="body" type="RID" />
@@ -511,7 +518,7 @@
<return type="void" />
<argument index="0" name="body" type="RID" />
<argument index="1" name="param" type="int" enum="PhysicsServer3D.BodyParameter" />
- <argument index="2" name="value" type="float" />
+ <argument index="2" name="value" type="Variant" />
<description>
Sets a body parameter. A list of available parameters is on the [enum BodyParameter] constants.
</description>
@@ -848,11 +855,6 @@
Sets a pin_joint parameter (see [enum PinJointParam] constants).
</description>
</method>
- <method name="plane_shape_create">
- <return type="RID" />
- <description>
- </description>
- </method>
<method name="separation_ray_shape_create">
<return type="RID" />
<description>
@@ -968,6 +970,11 @@
<description>
</description>
</method>
+ <method name="world_boundary_shape_create">
+ <return type="RID" />
+ <description>
+ </description>
+ </method>
</methods>
<constants>
<constant name="JOINT_TYPE_PIN" value="0" enum="JointType">
@@ -1177,8 +1184,8 @@
<constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR" value="5" enum="G6DOFJointAxisFlag">
If [code]set[/code] there is a linear motor on this axis that targets a specific velocity.
</constant>
- <constant name="SHAPE_PLANE" value="0" enum="ShapeType">
- The [Shape3D] is a [WorldMarginShape3D].
+ <constant name="SHAPE_WORLD_BOUNDARY" value="0" enum="ShapeType">
+ The [Shape3D] is a [WorldBoundaryShape3D].
</constant>
<constant name="SHAPE_SEPARATION_RAY" value="1" enum="ShapeType">
The [Shape3D] is a [SeparationRayShape3D].
@@ -1205,7 +1212,7 @@
The [Shape3D] is a [HeightMapShape3D].
</constant>
<constant name="SHAPE_SOFT_BODY" value="9" enum="ShapeType">
- The [Shape3D] is a [SoftBody3D].
+ The [Shape3D] is used internally for a soft body. Any attempt to create this kind of shape results in an error.
</constant>
<constant name="SHAPE_CUSTOM" value="10" enum="ShapeType">
This constant is used internally by the engine. Any attempt to create this kind of shape results in an error.
@@ -1262,7 +1269,7 @@
This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
</constant>
<constant name="BODY_MODE_STATIC" value="0" enum="BodyMode">
- Constant for static bodies. In this mode, a body can be only moved by user code.
+ Constant for static bodies. In this mode, a body can be only moved by user code and doesn't collide with other bodies along its path when moved.
</constant>
<constant name="BODY_MODE_KINEMATIC" value="1" enum="BodyMode">
Constant for kinematic bodies. In this mode, a body can be only moved by user code and collides with other bodies along its path.
@@ -1282,16 +1289,22 @@
<constant name="BODY_PARAM_MASS" value="2" enum="BodyParameter">
Constant to set/get a body's mass.
</constant>
- <constant name="BODY_PARAM_GRAVITY_SCALE" value="3" enum="BodyParameter">
+ <constant name="BODY_PARAM_INERTIA" value="3" enum="BodyParameter">
+ Constant to set/get a body's inertia.
+ </constant>
+ <constant name="BODY_PARAM_CENTER_OF_MASS" value="4" enum="BodyParameter">
+ Constant to set/get a body's center of mass.
+ </constant>
+ <constant name="BODY_PARAM_GRAVITY_SCALE" value="5" enum="BodyParameter">
Constant to set/get a body's gravity multiplier.
</constant>
- <constant name="BODY_PARAM_LINEAR_DAMP" value="4" enum="BodyParameter">
+ <constant name="BODY_PARAM_LINEAR_DAMP" value="6" enum="BodyParameter">
Constant to set/get a body's linear dampening factor.
</constant>
- <constant name="BODY_PARAM_ANGULAR_DAMP" value="5" enum="BodyParameter">
+ <constant name="BODY_PARAM_ANGULAR_DAMP" value="7" enum="BodyParameter">
Constant to set/get a body's angular dampening factor.
</constant>
- <constant name="BODY_PARAM_MAX" value="6" enum="BodyParameter">
+ <constant name="BODY_PARAM_MAX" value="8" enum="BodyParameter">
Represents the size of the [enum BodyParameter] enum.
</constant>
<constant name="BODY_STATE_TRANSFORM" value="0" enum="BodyState">
diff --git a/doc/classes/PhysicsShapeQueryParameters2D.xml b/doc/classes/PhysicsShapeQueryParameters2D.xml
index 8b006c68e7..b54de15d15 100644
--- a/doc/classes/PhysicsShapeQueryParameters2D.xml
+++ b/doc/classes/PhysicsShapeQueryParameters2D.xml
@@ -17,7 +17,7 @@
<member name="collide_with_bodies" type="bool" setter="set_collide_with_bodies" getter="is_collide_with_bodies_enabled" default="true">
If [code]true[/code], the query will take [PhysicsBody2D]s into account.
</member>
- <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="2147483647">
+ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="4294967295">
The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[]">
diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml
index de9b623591..f74d1b5e48 100644
--- a/doc/classes/PhysicsShapeQueryParameters3D.xml
+++ b/doc/classes/PhysicsShapeQueryParameters3D.xml
@@ -17,7 +17,7 @@
<member name="collide_with_bodies" type="bool" setter="set_collide_with_bodies" getter="is_collide_with_bodies_enabled" default="true">
If [code]true[/code], the query will take [PhysicsBody3D]s into account.
</member>
- <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="2147483647">
+ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="4294967295">
The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[]">
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 58c9d9e44b..22ed14743a 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -279,6 +279,9 @@
<member name="audio/driver/mix_rate" type="int" setter="" getter="" default="44100">
The mixing rate used for audio (in Hz). In general, it's better to not touch this and leave it to the host operating system.
</member>
+ <member name="audio/driver/mix_rate.web" type="int" setter="" getter="" default="0">
+ Safer override for [member audio/driver/mix_rate] in the Web platform. Here [code]0[/code] means "let the browser choose" (since some browsers do not like forcing the mix rate).
+ </member>
<member name="audio/driver/output_latency" type="int" setter="" getter="" default="15">
Output latency in milliseconds for audio. Lower values will result in lower audio latency at the cost of increased CPU usage. Low values may result in audible cracking on slower hardware.
</member>
@@ -328,6 +331,9 @@
<member name="debug/gdscript/warnings/deprecated_keyword" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when deprecated keywords are used.
</member>
+ <member name="debug/gdscript/warnings/empty_file" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], enables warnings when an empty file is parsed.
+ </member>
<member name="debug/gdscript/warnings/enable" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables specific GDScript warnings (see [code]debug/gdscript/warnings/*[/code] settings). If [code]false[/code], disables all GDScript warnings.
</member>
@@ -625,19 +631,19 @@
</member>
<member name="input/ui_text_backspace_all_to_left" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_backspace_all_to_left.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_backspace_all_to_left.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_backspace_word" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_backspace_word.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_backspace_word.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_caret_document_end" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_caret_document_end.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_caret_document_end.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_caret_document_start" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_caret_document_start.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_caret_document_start.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_caret_down" type="Dictionary" setter="" getter="">
</member>
@@ -645,11 +651,11 @@
</member>
<member name="input/ui_text_caret_line_end" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_caret_line_end.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_caret_line_end.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_caret_line_start" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_caret_line_start.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_caret_line_start.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_caret_page_down" type="Dictionary" setter="" getter="">
</member>
@@ -661,11 +667,11 @@
</member>
<member name="input/ui_text_caret_word_left" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_caret_word_left.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_caret_word_left.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_caret_word_right" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_caret_word_right.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_caret_word_right.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_completion_accept" type="Dictionary" setter="" getter="">
</member>
@@ -679,11 +685,11 @@
</member>
<member name="input/ui_text_delete_all_to_right" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_delete_all_to_right.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_delete_all_to_right.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_delete_word" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_delete_word.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_delete_word.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_indent" type="Dictionary" setter="" getter="">
</member>
@@ -695,11 +701,11 @@
</member>
<member name="input/ui_text_scroll_down" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_scroll_down.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_scroll_down.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_scroll_up" type="Dictionary" setter="" getter="">
</member>
- <member name="input/ui_text_scroll_up.OSX" type="Dictionary" setter="" getter="">
+ <member name="input/ui_text_scroll_up.macos" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_text_select_all" type="Dictionary" setter="" getter="">
</member>
@@ -726,7 +732,7 @@
<member name="input_devices/pen_tablet/driver" type="String" setter="" getter="">
Specifies the tablet driver to use. If left empty, the default driver will be used.
</member>
- <member name="input_devices/pen_tablet/driver.Windows" type="String" setter="" getter="">
+ <member name="input_devices/pen_tablet/driver.windows" type="String" setter="" getter="">
Override for [member input_devices/pen_tablet/driver] on Windows.
</member>
<member name="input_devices/pointing/emulate_mouse_from_touch" type="bool" setter="" getter="" default="true">
diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml
index 24f7f4274e..428fa2575c 100644
--- a/doc/classes/RenderingDevice.xml
+++ b/doc/classes/RenderingDevice.xml
@@ -359,6 +359,14 @@
<description>
</description>
</method>
+ <method name="get_driver_resource">
+ <return type="int" />
+ <argument index="0" name="resource" type="int" enum="RenderingDevice.DriverResource" />
+ <argument index="1" name="rid" type="RID" />
+ <argument index="2" name="index" type="int" />
+ <description>
+ </description>
+ </method>
<method name="get_frame_delay" qualifiers="const">
<return type="int" />
<description>
@@ -646,6 +654,32 @@
</constant>
<constant name="BARRIER_MASK_NO_BARRIER" value="8">
</constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_DEVICE" value="0" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_PHYSICAL_DEVICE" value="1" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_INSTANCE" value="2" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_QUEUE" value="3" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_QUEUE_FAMILY_INDEX" value="4" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_IMAGE" value="5" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_IMAGE_VIEW" value="6" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_IMAGE_NATIVE_TEXTURE_FORMAT" value="7" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_SAMPLER" value="8" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_DESCRIPTOR_SET" value="9" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_BUFFER" value="10" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_COMPUTE_PIPELINE" value="11" enum="DriverResource">
+ </constant>
+ <constant name="DRIVER_RESOURCE_VULKAN_RENDER_PIPELINE" value="12" enum="DriverResource">
+ </constant>
<constant name="DATA_FORMAT_R4G4_UNORM_PACK8" value="0" enum="DataFormat">
</constant>
<constant name="DATA_FORMAT_R4G4B4A4_UNORM_PACK16" value="1" enum="DataFormat">
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 638c657492..b5be04fb01 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -1156,6 +1156,11 @@
<description>
</description>
</method>
+ <method name="get_rendering_device" qualifiers="const">
+ <return type="RenderingDevice" />
+ <description>
+ </description>
+ </method>
<method name="get_rendering_info">
<return type="int" />
<argument index="0" name="info" type="int" enum="RenderingServer.RenderingInfo" />
@@ -3796,21 +3801,18 @@
<constant name="VIEWPORT_SDF_SCALE_MAX" value="3" enum="ViewportSDFScale">
</constant>
<constant name="VIEWPORT_MSAA_DISABLED" value="0" enum="ViewportMSAA">
- Multisample antialiasing is disabled.
+ Multisample antialiasing for 3D is disabled. This is the default value, and also the fastest setting.
</constant>
<constant name="VIEWPORT_MSAA_2X" value="1" enum="ViewportMSAA">
- Multisample antialiasing uses 2 samples per pixel.
+ Multisample antialiasing uses 2 samples per pixel for 3D. This has a moderate impact on performance.
</constant>
<constant name="VIEWPORT_MSAA_4X" value="2" enum="ViewportMSAA">
- Multisample antialiasing uses 4 samples per pixel.
+ Multisample antialiasing uses 4 samples per pixel for 3D. This has a high impact on performance.
</constant>
<constant name="VIEWPORT_MSAA_8X" value="3" enum="ViewportMSAA">
- Multisample antialiasing uses 8 samples per pixel.
- </constant>
- <constant name="VIEWPORT_MSAA_16X" value="4" enum="ViewportMSAA">
- Multisample antialiasing uses 16 samples per pixel.
+ Multisample antialiasing uses 8 samples per pixel for 3D. This has a very high impact on performance. Likely unsupported on low-end and older hardware.
</constant>
- <constant name="VIEWPORT_MSAA_MAX" value="5" enum="ViewportMSAA">
+ <constant name="VIEWPORT_MSAA_MAX" value="4" enum="ViewportMSAA">
</constant>
<constant name="VIEWPORT_SCREEN_SPACE_AA_DISABLED" value="0" enum="ViewportScreenSpaceAA">
</constant>
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index 65dedf5280..efb0339aa7 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -16,7 +16,8 @@
<return type="Resource" />
<argument index="0" name="subresources" type="bool" default="false" />
<description>
- Duplicates the resource, returning a new resource. By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing [code]true[/code] to the [code]subresources[/code] argument which will copy the subresources.
+ Duplicates the resource, returning a new resource with the exported members copied. [b]Note:[/b] To duplicate the resource the constructor is called without arguments. This method will error when the constructor doesn't have default values.
+ By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing [code]true[/code] to the [code]subresources[/code] argument which will copy the subresources.
[b]Note:[/b] If [code]subresources[/code] is [code]true[/code], this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.
[b]Note:[/b] When duplicating a resource, only [code]export[/code]ed properties are copied. Other properties will be set to their default value in the new resource.
</description>
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index e77232a613..50db1dc122 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -5,8 +5,9 @@
</brief_description>
<description>
Rich text can contain custom text, fonts, images and some basic formatting. The label manages these as an internal tag stack. It also adapts itself to given width/heights.
- [b]Note:[/b] Assignments to [member bbcode_text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member bbcode_text] will erase previous edits made from other manual sources such as [method append_bbcode] and the [code]push_*[/code] / [method pop] methods.
+ [b]Note:[/b] Assignments to [member text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member text] will erase previous edits made from other manual sources such as [method append_text] and the [code]push_*[/code] / [method pop] methods.
[b]Note:[/b] RichTextLabel doesn't support entangled BBCode tags. For example, instead of using [code][b]bold[i]bold italic[/b]italic[/i][/code], use [code][b]bold[i]bold italic[/i][/b][i]italic[/i][/code].
+ [b]Note:[/b] [code]push_*/pop[/code] functions won't affect BBCode.
[b]Note:[/b] Unlike [Label], RichTextLabel doesn't have a [i]property[/i] to horizontally align text to the center. Instead, enable [member bbcode_enabled] and surround the text in a [code][center][/code] tag as follows: [code][center]Example[/center][/code]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [member fit_content_height] property.
</description>
<tutorials>
@@ -34,18 +35,18 @@
Adds raw non-BBCode-parsed text to the tag stack.
</description>
</method>
- <method name="append_bbcode">
+ <method name="append_text">
<return type="int" enum="Error" />
<argument index="0" name="bbcode" type="String" />
<description>
Parses [code]bbcode[/code] and adds tags to the tag stack as needed. Returns the result of the parsing, [constant OK] if successful.
- [b]Note:[/b] Using this method, you can't close a tag that was opened in a previous [method append_bbcode] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member bbcode_text] instead of using [method append_bbcode].
+ [b]Note:[/b] Using this method, you can't close a tag that was opened in a previous [method append_text] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member text] instead of using [method append_text].
</description>
</method>
<method name="clear">
<return type="void" />
<description>
- Clears the tag stack and sets [member bbcode_text] to an empty string.
+ Clears the tag stack and sets [member text] to an empty string.
</description>
</method>
<method name="get_content_height" qualifiers="const">
@@ -66,6 +67,12 @@
Returns the total number of paragraphs (newlines or [code]p[/code] tags in the tag stack's text tags). Considers wrapped text as one paragraph.
</description>
</method>
+ <method name="get_parsed_text" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the text without BBCode mark-up.
+ </description>
+ </method>
<method name="get_selected_text" qualifiers="const">
<return type="String" />
<description>
@@ -125,7 +132,7 @@
<return type="int" enum="Error" />
<argument index="0" name="bbcode" type="String" />
<description>
- The assignment version of [method append_bbcode]. Clears the tag stack and inserts the new content. Returns [constant OK] if parses [code]bbcode[/code] successfully.
+ The assignment version of [method append_text]. Clears the tag stack and inserts the new content. Returns [constant OK] if parses [code]bbcode[/code] successfully.
</description>
</method>
<method name="parse_expressions_for_values">
@@ -367,10 +374,6 @@
<member name="bbcode_enabled" type="bool" setter="set_use_bbcode" getter="is_using_bbcode" default="false">
If [code]true[/code], the label uses BBCode formatting.
</member>
- <member name="bbcode_text" type="String" setter="set_bbcode" getter="get_bbcode" default="&quot;&quot;">
- The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited.
- [b]Note:[/b] It is unadvised to use the [code]+=[/code] operator with [code]bbcode_text[/code] (e.g. [code]bbcode_text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_bbcode] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
- </member>
<member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[]">
The currently installed custom effects. This is an array of [RichTextEffect]s.
To add a custom effect, it's more convenient to use [method install_effect].
@@ -412,8 +415,8 @@
The number of spaces associated with a single tab length. Does not affect [code]\t[/code] in text tags, only indent tags.
</member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
- The raw text of the label.
- When set, clears the tag stack and adds a raw text tag to the top of it. Does not parse BBCodes. Does not modify [member bbcode_text].
+ The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited.
+ [b]Note:[/b] If [member bbcode_enabled] is [code]true[/code], it is unadvised to use the [code]+=[/code] operator with [code]text[/code] (e.g. [code]text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_text] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
</member>
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
Base text writing direction.
diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidDynamicBody2D.xml
index db16552db3..059379242b 100644
--- a/doc/classes/RigidBody2D.xml
+++ b/doc/classes/RigidDynamicBody2D.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="RigidBody2D" inherits="PhysicsBody2D" version="4.0">
+<class name="RigidDynamicBody2D" inherits="PhysicsBody2D" version="4.0">
<brief_description>
- A body that is controlled by the 2D physics engine.
+ Physics Body which is moved by 2D physics simulation. Useful for objects that have gravity and can be pushed by other objects.
</brief_description>
<description>
- This node implements simulated 2D physics. You do not control a RigidBody2D directly. Instead, you apply forces to it (gravity, impulses, etc.) and the physics simulation calculates the resulting movement based on its mass, friction, and other physical properties.
- A RigidBody2D has 4 behavior [member mode]s: Dynamic, Static, DynamicLocked, and Kinematic.
- [b]Note:[/b] You should not change a RigidBody2D's [code]position[/code] or [code]linear_velocity[/code] every frame or even very often. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state.
+ This node implements simulated 2D physics. You do not control a RigidDynamicBody2D directly. Instead, you apply forces to it (gravity, impulses, etc.) and the physics simulation calculates the resulting movement based on its mass, friction, and other physical properties.
+ A RigidDynamicBody2D has 4 behavior [member mode]s: Dynamic, Static, DynamicLocked, and Kinematic.
+ [b]Note:[/b] You should not change a RigidDynamicBody2D's [code]position[/code] or [code]linear_velocity[/code] every frame or even very often. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state.
Please also keep in mind that physics bodies manage their own transform which overwrites the ones you set. So any direct or indirect transformation (including scaling of the node or its parent) will be visible in the editor only, and immediately reset at runtime.
If you need to override the default physics behavior or add a transformation at runtime, you can write a custom force integration. See [member custom_integrator].
The center of mass is always located at the node's origin without taking into account the [CollisionShape2D] centroid offsets.
@@ -99,14 +99,21 @@
<member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true">
If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping].
</member>
+ <member name="center_of_mass" type="Vector2" setter="set_center_of_mass" getter="get_center_of_mass" default="Vector2(0, 0)">
+ The body's custom center of mass, relative to the body's origin position, when [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration.
+ When [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed.
+ </member>
+ <member name="center_of_mass_mode" type="int" setter="set_center_of_mass_mode" getter="get_center_of_mass_mode" enum="RigidDynamicBody2D.CenterOfMassMode" default="0">
+ Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values.
+ </member>
<member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false">
- If [code]true[/code], the body will emit signals when it collides with another RigidBody2D. See also [member contacts_reported].
+ If [code]true[/code], the body will emit signals when it collides with another RigidDynamicBody2D. See also [member contacts_reported].
</member>
<member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" default="0">
The maximum number of contacts that will be recorded. Requires [member contact_monitor] to be set to [code]true[/code].
[b]Note:[/b] The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end).
</member>
- <member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" enum="RigidBody2D.CCDMode" default="0">
+ <member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" enum="RigidDynamicBody2D.CCDMode" default="0">
Continuous collision detection mode.
Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See [enum CCDMode] for details.
</member>
@@ -116,8 +123,9 @@
<member name="gravity_scale" type="float" setter="set_gravity_scale" getter="get_gravity_scale" default="1.0">
Multiplies the gravity applied to the body. The body's gravity is calculated from the [b]Default Gravity[/b] value in [b]Project &gt; Project Settings &gt; Physics &gt; 2d[/b] and/or any additional gravity vector applied by [Area2D]s.
</member>
- <member name="inertia" type="float" setter="set_inertia" getter="get_inertia">
- The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this function allows you to set a custom value. Set 0 inertia to return to automatically computing it.
+ <member name="inertia" type="float" setter="set_inertia" getter="get_inertia" default="0.0">
+ The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value.
+ If set to [code]0[/code], inertia is automatically computed (default value).
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="-1.0">
Damps the body's [member linear_velocity]. If [code]-1[/code], the body will use the [b]Default Linear Damp[/b] in [b]Project &gt; Project Settings &gt; Physics &gt; 2d[/b].
@@ -129,8 +137,9 @@
<member name="mass" type="float" setter="set_mass" getter="get_mass" default="1.0">
The body's mass.
</member>
- <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidBody2D.Mode" default="0">
+ <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidDynamicBody2D.Mode" default="0">
The body's mode. See [enum Mode] for possible values.
+ For a body that uses only Static or Kinematic mode, use [StaticBody2D] or [AnimatableBody2D] instead.
</member>
<member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override">
The physics material override for the body.
@@ -161,11 +170,11 @@
<argument index="2" name="body_shape" type="int" />
<argument index="3" name="local_shape" type="int" />
<description>
- Emitted when one of this RigidBody2D's [Shape2D]s collides with another [PhysicsBody2D] or [TileMap]'s [Shape2D]s. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
+ Emitted when one of this RigidDynamicBody2D's [Shape2D]s collides with another [PhysicsBody2D] or [TileMap]'s [Shape2D]s. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body_id[/code] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D].
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
[code]body_shape[/code] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D].
- [code]local_shape[/code] the index of the [Shape2D] of this RigidBody2D used by the [PhysicsServer2D].
+ [code]local_shape[/code] the index of the [Shape2D] of this RigidDynamicBody2D used by the [PhysicsServer2D].
</description>
</signal>
<signal name="body_shape_exited">
@@ -174,11 +183,11 @@
<argument index="2" name="body_shape" type="int" />
<argument index="3" name="local_shape" type="int" />
<description>
- Emitted when the collision between one of this RigidBody2D's [Shape2D]s and another [PhysicsBody2D] or [TileMap]'s [Shape2D]s ends. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
+ Emitted when the collision between one of this RigidDynamicBody2D's [Shape2D]s and another [PhysicsBody2D] or [TileMap]'s [Shape2D]s ends. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body_id[/code] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D].
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
[code]body_shape[/code] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D].
- [code]local_shape[/code] the index of the [Shape2D] of this RigidBody2D used by the [PhysicsServer2D].
+ [code]local_shape[/code] the index of the [Shape2D] of this RigidDynamicBody2D used by the [PhysicsServer2D].
</description>
</signal>
<signal name="sleeping_state_changed">
@@ -199,7 +208,13 @@
Locked dynamic body mode. Similar to [constant MODE_DYNAMIC], but the body can not rotate.
</constant>
<constant name="MODE_KINEMATIC" value="3" enum="Mode">
- Kinematic body mode. The body behaves like a [StaticBody2D] with [member StaticBody2D.kinematic_motion] enabled, and must be moved by user code.
+ Kinematic body mode. The body behaves like a [AnimatableBody2D], and must be moved by code.
+ </constant>
+ <constant name="CENTER_OF_MASS_MODE_AUTO" value="0" enum="CenterOfMassMode">
+ In this mode, the body's center of mass is calculated automatically based on its shapes.
+ </constant>
+ <constant name="CENTER_OF_MASS_MODE_CUSTOM" value="1" enum="CenterOfMassMode">
+ In this mode, the body's center of mass is set through [member center_of_mass]. Defaults to the body's origin position.
</constant>
<constant name="CCD_MODE_DISABLED" value="0" enum="CCDMode">
Continuous collision detection disabled. This is the fastest way to detect body collisions, but can miss small, fast-moving objects.
diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidDynamicBody3D.xml
index f4299335bf..9b6bcd840b 100644
--- a/doc/classes/RigidBody3D.xml
+++ b/doc/classes/RigidDynamicBody3D.xml
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="RigidBody3D" inherits="PhysicsBody3D" version="4.0">
+<class name="RigidDynamicBody3D" inherits="PhysicsBody3D" version="4.0">
<brief_description>
- Physics Body whose position is determined through physics simulation in 3D space.
+ Physics Body which is moved by 3D physics simulation. Useful for objects that have gravity and can be pushed by other objects.
</brief_description>
<description>
- This is the node that implements full 3D physics. This means that you do not control a RigidBody3D directly. Instead, you can apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, collision, bouncing, rotating, etc.
- A RigidBody3D has 4 behavior [member mode]s: Dynamic, Static, DynamicLocked, and Kinematic.
- [b]Note:[/b] Don't change a RigidBody3D's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state.
+ This is the node that implements full 3D physics. This means that you do not control a RigidDynamicBody3D directly. Instead, you can apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, collision, bouncing, rotating, etc.
+ A RigidDynamicBody3D has 4 behavior [member mode]s: Dynamic, Static, DynamicLocked, and Kinematic.
+ [b]Note:[/b] Don't change a RigidDynamicBody3D's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state.
If you need to override the default physics behavior, you can write a custom force integration function. See [member custom_integrator].
- With Bullet physics (the default), the center of mass is the RigidBody3D center. With GodotPhysics, the center of mass is the average of the [CollisionShape3D] centers.
+ With Bullet physics (the default), the center of mass is the RigidDynamicBody3D center. With GodotPhysics, the center of mass is the average of the [CollisionShape3D] centers.
</description>
<tutorials>
<link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
@@ -80,7 +80,7 @@
<method name="get_inverse_inertia_tensor" qualifiers="const">
<return type="Basis" />
<description>
- Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the [RigidBody3D].
+ Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the [RigidDynamicBody3D].
</description>
</method>
<method name="set_axis_velocity">
@@ -93,17 +93,24 @@
</methods>
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="-1.0">
- Damps RigidBody3D's rotational forces.
+ Damps RigidDynamicBody3D's rotational forces.
See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping.
</member>
<member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3(0, 0, 0)">
- RigidBody3D's rotational velocity.
+ RigidDynamicBody3D's rotational velocity.
</member>
<member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true">
If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping].
</member>
+ <member name="center_of_mass" type="Vector3" setter="set_center_of_mass" getter="get_center_of_mass" default="Vector3(0, 0, 0)">
+ The body's custom center of mass, relative to the body's origin position, when [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration.
+ When [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed.
+ </member>
+ <member name="center_of_mass_mode" type="int" setter="set_center_of_mass_mode" getter="get_center_of_mass_mode" enum="RigidDynamicBody3D.CenterOfMassMode" default="0">
+ Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values.
+ </member>
<member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false">
- If [code]true[/code], the RigidBody3D will emit signals when it collides with another RigidBody3D. See also [member contacts_reported].
+ If [code]true[/code], the RigidDynamicBody3D will emit signals when it collides with another RigidDynamicBody3D. See also [member contacts_reported].
</member>
<member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" default="0">
The maximum number of contacts that will be recorded. Requires [member contact_monitor] to be set to [code]true[/code].
@@ -117,7 +124,11 @@
If [code]true[/code], internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] function, if defined.
</member>
<member name="gravity_scale" type="float" setter="set_gravity_scale" getter="get_gravity_scale" default="1.0">
- This is multiplied by the global 3D gravity setting found in [b]Project &gt; Project Settings &gt; Physics &gt; 3d[/b] to produce RigidBody3D's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object.
+ This is multiplied by the global 3D gravity setting found in [b]Project &gt; Project Settings &gt; Physics &gt; 3d[/b] to produce RigidDynamicBody3D's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object.
+ </member>
+ <member name="inertia" type="Vector3" setter="set_inertia" getter="get_inertia" default="Vector3(0, 0, 0)">
+ The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body on each axis. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value.
+ If set to [code]Vector3.ZERO[/code], inertia is automatically computed (default value).
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="-1.0">
The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0, any linear damp derived from the world or areas will be overridden.
@@ -129,8 +140,9 @@
<member name="mass" type="float" setter="set_mass" getter="get_mass" default="1.0">
The body's mass.
</member>
- <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidBody3D.Mode" default="0">
- The body mode. See [enum Mode] for possible values.
+ <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidDynamicBody3D.Mode" default="0">
+ The body's mode. See [enum Mode] for possible values.
+ For a body that uses only Static or Kinematic mode, use [StaticBody3D] or [AnimatableBody3D] instead.
</member>
<member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override">
The physics material override for the body.
@@ -161,11 +173,11 @@
<argument index="2" name="body_shape" type="int" />
<argument index="3" name="local_shape" type="int" />
<description>
- Emitted when one of this RigidBody3D's [Shape3D]s collides with another [PhysicsBody3D] or [GridMap]'s [Shape3D]s. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
+ Emitted when one of this RigidDynamicBody3D's [Shape3D]s collides with another [PhysicsBody3D] or [GridMap]'s [Shape3D]s. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
[code]body_id[/code] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D].
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap].
[code]body_shape[/code] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D].
- [code]local_shape[/code] the index of the [Shape3D] of this RigidBody3D used by the [PhysicsServer3D].
+ [code]local_shape[/code] the index of the [Shape3D] of this RigidDynamicBody3D used by the [PhysicsServer3D].
[b]Note:[/b] Bullet physics cannot identify the shape index when using a [ConcavePolygonShape3D]. Don't use multiple [CollisionShape3D]s when using a [ConcavePolygonShape3D] with Bullet physics if you need shape indices.
</description>
</signal>
@@ -175,11 +187,11 @@
<argument index="2" name="body_shape" type="int" />
<argument index="3" name="local_shape" type="int" />
<description>
- Emitted when the collision between one of this RigidBody3D's [Shape3D]s and another [PhysicsBody3D] or [GridMap]'s [Shape3D]s ends. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
+ Emitted when the collision between one of this RigidDynamicBody3D's [Shape3D]s and another [PhysicsBody3D] or [GridMap]'s [Shape3D]s ends. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
[code]body_id[/code] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D]. [GridMap]s are detected if the Meshes have [Shape3D]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap].
[code]body_shape[/code] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D].
- [code]local_shape[/code] the index of the [Shape3D] of this RigidBody3D used by the [PhysicsServer3D].
+ [code]local_shape[/code] the index of the [Shape3D] of this RigidDynamicBody3D used by the [PhysicsServer3D].
[b]Note:[/b] Bullet physics cannot identify the shape index when using a [ConcavePolygonShape3D]. Don't use multiple [CollisionShape3D]s when using a [ConcavePolygonShape3D] with Bullet physics if you need shape indices.
</description>
</signal>
@@ -201,7 +213,13 @@
Locked dynamic body mode. Similar to [constant MODE_DYNAMIC], but the body can not rotate.
</constant>
<constant name="MODE_KINEMATIC" value="3" enum="Mode">
- Kinematic body mode. The body behaves like a [StaticBody3D] with [member StaticBody3D.kinematic_motion] enabled, and can only move by user code.
+ Kinematic body mode. The body behaves like a [AnimatableBody3D], and can only move by user code.
+ </constant>
+ <constant name="CENTER_OF_MASS_MODE_AUTO" value="0" enum="CenterOfMassMode">
+ In this mode, the body's center of mass is calculated automatically based on its shapes.
+ </constant>
+ <constant name="CENTER_OF_MASS_MODE_CUSTOM" value="1" enum="CenterOfMassMode">
+ In this mode, the body's center of mass is set through [member center_of_mass]. Defaults to the body's origin position.
</constant>
</constants>
</class>
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index 59e3190213..9a38e52b23 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -215,11 +215,11 @@
</member>
<member name="multiplayer_poll" type="bool" setter="set_multiplayer_poll_enabled" getter="is_multiplayer_poll_enabled" default="true">
If [code]true[/code] (default value), enables automatic polling of the [MultiplayerAPI] for this SceneTree during [signal process_frame].
- If [code]false[/code], you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads.
+ If [code]false[/code], you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs. This allows running RPCs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads.
</member>
<member name="paused" type="bool" setter="set_pause" getter="is_paused" default="false">
If [code]true[/code], the [SceneTree] is paused. Doing so will have the following behavior:
- - 2D and 3D physics will be stopped.
+ - 2D and 3D physics will be stopped. This includes signals and collision detection.
- [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes.
</member>
<member name="root" type="Window" setter="" getter="get_root">
diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml
index 2f340adb9f..c2b514f232 100644
--- a/doc/classes/Skeleton3D.xml
+++ b/doc/classes/Skeleton3D.xml
@@ -216,7 +216,7 @@
<argument index="0" name="exception" type="RID" />
<description>
Adds a collision exception to the physical bone.
- Works just like the [RigidBody3D] node.
+ Works just like the [RigidDynamicBody3D] node.
</description>
</method>
<method name="physical_bones_remove_collision_exception">
@@ -224,7 +224,7 @@
<argument index="0" name="exception" type="RID" />
<description>
Removes a collision exception to the physical bone.
- Works just like the [RigidBody3D] node.
+ Works just like the [RigidDynamicBody3D] node.
</description>
</method>
<method name="physical_bones_start_simulation">
diff --git a/doc/classes/SoftBody3D.xml b/doc/classes/SoftDynamicBody3D.xml
index d5f0e3c95c..f999f77e78 100644
--- a/doc/classes/SoftBody3D.xml
+++ b/doc/classes/SoftDynamicBody3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="SoftBody3D" inherits="MeshInstance3D" version="4.0">
+<class name="SoftDynamicBody3D" inherits="MeshInstance3D" version="4.0">
<brief_description>
A soft mesh physics body.
</brief_description>
@@ -91,16 +91,16 @@
</methods>
<members>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
- The physics layers this SoftBody3D [b]is in[/b]. Collision objects can exist in one or more of 32 different layers. See also [member collision_mask].
+ The physics layers this SoftDynamicBody3D [b]is in[/b]. Collision objects can exist in one or more of 32 different layers. See also [member collision_mask].
[b]Note:[/b] Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The physics layers this SoftBody3D [b]scans[/b]. Collision objects can scan one or more of 32 different layers. See also [member collision_layer].
+ The physics layers this SoftDynamicBody3D [b]scans[/b]. Collision objects can scan one or more of 32 different layers. See also [member collision_layer].
[b]Note:[/b] Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.01">
</member>
- <member name="disable_mode" type="int" setter="set_disable_mode" getter="get_disable_mode" enum="SoftBody3D.DisableMode" default="0">
+ <member name="disable_mode" type="int" setter="set_disable_mode" getter="get_disable_mode" enum="SoftDynamicBody3D.DisableMode" default="0">
Defines the behavior in physics when [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED]. See [enum DisableMode] for more details about the different modes.
</member>
<member name="drag_coefficient" type="float" setter="set_drag_coefficient" getter="get_drag_coefficient" default="0.0">
@@ -108,23 +108,23 @@
<member name="linear_stiffness" type="float" setter="set_linear_stiffness" getter="get_linear_stiffness" default="0.5">
</member>
<member name="parent_collision_ignore" type="NodePath" setter="set_parent_collision_ignore" getter="get_parent_collision_ignore" default="NodePath(&quot;&quot;)">
- [NodePath] to a [CollisionObject3D] this SoftBody3D should avoid clipping.
+ [NodePath] to a [CollisionObject3D] this SoftDynamicBody3D should avoid clipping.
</member>
<member name="pressure_coefficient" type="float" setter="set_pressure_coefficient" getter="get_pressure_coefficient" default="0.0">
</member>
<member name="ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable" default="true">
- If [code]true[/code], the [SoftBody3D] will respond to [RayCast3D]s.
+ If [code]true[/code], the [SoftDynamicBody3D] will respond to [RayCast3D]s.
</member>
<member name="simulation_precision" type="int" setter="set_simulation_precision" getter="get_simulation_precision" default="5">
Increasing this value will improve the resulting simulation, but can affect performance. Use with care.
</member>
<member name="total_mass" type="float" setter="set_total_mass" getter="get_total_mass" default="1.0">
- The SoftBody3D's mass.
+ The SoftDynamicBody3D's mass.
</member>
</members>
<constants>
<constant name="DISABLE_MODE_REMOVE" value="0" enum="DisableMode">
- When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], remove from the physics simulation to stop all physics interactions with this [SoftBody3D].
+ When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], remove from the physics simulation to stop all physics interactions with this [SoftDynamicBody3D].
Automatically re-added to the physics simulation when the [Node] is processed again.
</constant>
<constant name="DISABLE_MODE_KEEP_ACTIVE" value="1" enum="DisableMode">
diff --git a/doc/classes/StaticBody2D.xml b/doc/classes/StaticBody2D.xml
index 326bf58e22..9cbe0bdb40 100644
--- a/doc/classes/StaticBody2D.xml
+++ b/doc/classes/StaticBody2D.xml
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="StaticBody2D" inherits="PhysicsBody2D" version="4.0">
<brief_description>
- Static body for 2D physics.
+ Physics body for 2D physics which is static or moves only by script. Useful for floor and walls.
</brief_description>
<description>
- Static body for 2D physics. A static body is a simple body that can't be moved by external forces or contacts. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidBody2D], they don't consume any CPU resources as long as they don't move.
- They however have extra functionalities to move and affect other bodies:
- [b]Constant velocity:[/b] [member constant_linear_velocity] and [member constant_angular_velocity] can be set for the static body, so even if it doesn't move, it affects other bodies as if it was moving (this is useful for simulating conveyor belts or conveyor wheels).
- [b]Transform change:[/b] Static bodies can be also moved by code. Unless [member kinematic_motion] is enabled, they are just teleported in this case and don't affect other bodies on their path.
- [b]Kinematic motion:[/b] Static bodies can have [member kinematic_motion] enabled to make them kinematic bodies that can be moved by code and push other bodies on their path.
+ Static body for 2D physics.
+ A static body is a simple body that can't be moved by external forces or contacts. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidDynamicBody2D], 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]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.
</description>
<tutorials>
</tutorials>
@@ -16,22 +16,15 @@
</methods>
<members>
<member name="constant_angular_velocity" type="float" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" default="0.0">
- The body's constant angular velocity. This does not rotate the body (unless [member kinematic_motion] is enabled), but affects other bodies that touch it, as if it were rotating.
+ The body's constant angular velocity. This does not rotate the body, but affects touching bodies, as if it were rotating.
</member>
<member name="constant_linear_velocity" type="Vector2" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" default="Vector2(0, 0)">
- The body's constant linear velocity. This does not move the body (unless [member kinematic_motion] is enabled), but affects other bodies that touch it, as if it were moving.
- </member>
- <member name="kinematic_motion" type="bool" setter="set_kinematic_motion_enabled" getter="is_kinematic_motion_enabled" default="false">
- If [code]true[/code], the body will act the same as a [RigidBody2D] in [constant RigidBody2D.MODE_KINEMATIC] mode.
- When the body is moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to [code]physics[/code]), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
+ The body's constant linear velocity. This does not move the body, but affects touching bodies, as if it were moving.
</member>
<member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override">
The physics material override for the body.
If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
</member>
- <member name="sync_to_physics" type="bool" setter="set_sync_to_physics" getter="is_sync_to_physics_enabled" default="false">
- If [code]true[/code] and [member kinematic_motion] is enabled, the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do [b]not[/b] use together with [method PhysicsBody2D.move_and_collide].
- </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/StaticBody3D.xml b/doc/classes/StaticBody3D.xml
index 69c123002f..6e2377def0 100644
--- a/doc/classes/StaticBody3D.xml
+++ b/doc/classes/StaticBody3D.xml
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="StaticBody3D" inherits="PhysicsBody3D" version="4.0">
<brief_description>
- Static body for 3D physics.
+ Physics body for 3D physics which is static or moves only by script. Useful for floor and walls.
</brief_description>
<description>
- Static body for 3D physics. A static body is a simple body that can't be moved by external forces or contacts. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidBody3D], they don't consume any CPU resources as long as they don't move.
- They however have extra functionalities to move and affect other bodies:
- [b]Constant velocity:[/b] [member constant_linear_velocity] and [member constant_angular_velocity] can be set for the static body, so even if it doesn't move, it affects other bodies as if it was moving (this is useful for simulating conveyor belts or conveyor wheels).
- [b]Transform change:[/b] Static bodies can be also moved by code. Unless [member kinematic_motion] is enabled, they are just teleported in this case and don't affect other bodies on their path.
- [b]Kinematic motion:[/b] Static bodies can have [member kinematic_motion] enabled to make them kinematic bodies that can be moved by code and push other bodies on their path.
+ Static body for 3D physics.
+ A static body is a simple body that can't be moved by external forces or contacts. It is ideal for implementing objects in the environment, such as walls or platforms. In contrast to [RigidDynamicBody3D], 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]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.
</description>
<tutorials>
<link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
@@ -19,22 +19,15 @@
</methods>
<members>
<member name="constant_angular_velocity" type="Vector3" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" default="Vector3(0, 0, 0)">
- The body's constant angular velocity. This does not rotate the body (unless [member kinematic_motion] is enabled), but affects other bodies that touch it, as if it were rotating.
+ The body's constant angular velocity. This does not rotate the body, but affects touching bodies, as if it were rotating.
</member>
<member name="constant_linear_velocity" type="Vector3" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" default="Vector3(0, 0, 0)">
- The body's constant linear velocity. This does not move the body (unless [member kinematic_motion] is enabled), but affects other bodies that touch it, as if it were moving.
- </member>
- <member name="kinematic_motion" type="bool" setter="set_kinematic_motion_enabled" getter="is_kinematic_motion_enabled" default="false">
- If [code]true[/code], the body will act the same as a [RigidBody3D] in [constant RigidBody3D.MODE_KINEMATIC] mode.
- When the body is moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to [code]physics[/code]), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
+ The body's constant linear velocity. This does not move the body, but affects touching bodies, as if it were moving.
</member>
<member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override">
The physics material override for the body.
If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
</member>
- <member name="sync_to_physics" type="bool" setter="set_sync_to_physics" getter="is_sync_to_physics_enabled" default="false">
- If [code]true[/code] and [member kinematic_motion] is enabled, the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do [b]not[/b] use together with [method PhysicsBody3D.move_and_collide].
- </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml
index 59ab724f48..40f6075528 100644
--- a/doc/classes/StyleBoxFlat.xml
+++ b/doc/classes/StyleBoxFlat.xml
@@ -120,6 +120,7 @@
<members>
<member name="anti_aliasing" type="bool" setter="set_anti_aliased" getter="is_anti_aliased" default="true">
Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners.
+ [b]Note:[/b] When using beveled corners with 45-degree angles ([member corner_detail] = 1), it is recommended to set [member anti_aliasing] to [code]false[/code] to ensure crisp visuals and avoid possible visual glitches.
</member>
<member name="anti_aliasing_size" type="float" setter="set_aa_size" getter="get_aa_size" default="0.625">
This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect.
diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml
index fbda005865..77bd7b1a0a 100644
--- a/doc/classes/TabContainer.xml
+++ b/doc/classes/TabContainer.xml
@@ -57,6 +57,13 @@
Returns the [Texture2D] for the tab at index [code]tab_idx[/code] or [code]null[/code] if the tab has no [Texture2D].
</description>
</method>
+ <method name="get_tab_idx_at_point" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="point" type="Vector2" />
+ <description>
+ Returns the index of the tab at local coordinates [code]point[/code]. Returns [code]-1[/code] if the point is outside the control boundaries or if there's no tab at the queried position.
+ </description>
+ </method>
<method name="get_tab_title" qualifiers="const">
<return type="String" />
<argument index="0" name="tab_idx" type="int" />
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index d7af2204cf..661c4f05ef 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -624,7 +624,8 @@
<argument index="0" name="font_rid" type="RID" />
<argument index="1" name="msdf" type="bool" />
<description>
- If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
+ If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. MSDF rendering allows displaying the font at any scaling factor without blurriness, and without incurring a CPU cost when the font size changes (since the font no longer needs to be rasterized on the CPU). As a downside, font hinting is not available with MSDF. The lack of font hinting may result in less crisp and less readable fonts at small sizes.
+ [b]Note:[/b] MSDF font rendering does not render glyphs with overlapping shapes correctly. Overlapping shapes are not valid per the OpenType standard, but are still commonly found in many font files, especially those converted by Google Fonts. To avoid issues with overlapping glyphs, consider downloading the font file directly from the type foundry instead of relying on Google Fonts.
</description>
</method>
<method name="font_set_oversampling">
diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml
index b553aad518..9c9119c664 100644
--- a/doc/classes/Thread.xml
+++ b/doc/classes/Thread.xml
@@ -40,6 +40,8 @@
<return type="Variant" />
<description>
Joins the [Thread] and waits for it to finish. Returns what the method called returned.
+ Should either be used when you want to retrieve the value returned from the method called by the [Thread] or before freeing the instance that contains the [Thread].
+ [b]Note:[/b] After the [Thread] finishes joining it will be disposed. If you want to use it again you will have to create a new instance of it.
</description>
</method>
</methods>
diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml
index b5031cfc63..b18ca29a8c 100644
--- a/doc/classes/TileData.xml
+++ b/doc/classes/TileData.xml
@@ -11,6 +11,7 @@
<return type="void" />
<argument index="0" name="layer_id" type="int" />
<description>
+ Adds a collision polygon to the tile on the given TileSet physics layer.
</description>
</method>
<method name="get_collision_polygon_one_way_margin" qualifiers="const">
@@ -18,6 +19,7 @@
<argument index="0" name="layer_id" type="int" />
<argument index="1" name="polygon_index" type="int" />
<description>
+ Returns the one-way margin (for one-way platforms) of the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code].
</description>
</method>
<method name="get_collision_polygon_points" qualifiers="const">
@@ -25,42 +27,49 @@
<argument index="0" name="layer_id" type="int" />
<argument index="1" name="polygon_index" type="int" />
<description>
+ Returns the points of the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code].
</description>
</method>
<method name="get_collision_polygons_count" qualifiers="const">
<return type="int" />
<argument index="0" name="layer_id" type="int" />
<description>
+ Returns how many polygons the tile has for TileSet physics layer with index [code]layer_id[/code].
</description>
</method>
<method name="get_custom_data" qualifiers="const">
<return type="Variant" />
<argument index="0" name="layer_name" type="String" />
<description>
+ Returns the custom data value for custom data layer named [code]layer_name[/code].
</description>
</method>
<method name="get_custom_data_by_layer_id" qualifiers="const">
<return type="Variant" />
<argument index="0" name="layer_id" type="int" />
<description>
+ Returns the custom data value for custom data layer with index [code]layer_id[/code].
</description>
</method>
<method name="get_navigation_polygon" qualifiers="const">
<return type="NavigationPolygon" />
<argument index="0" name="layer_id" type="int" />
<description>
+ Returns the navigation polygon of the tile for the TileSet navigation layer with index [code]layer_id[/code].
</description>
</method>
<method name="get_occluder" qualifiers="const">
<return type="OccluderPolygon2D" />
<argument index="0" name="layer_id" type="int" />
<description>
+ Returns the occluder polygon of the tile for the TileSet occlusion layer with index [code]layer_id[/code].
</description>
</method>
<method name="get_peering_bit_terrain" qualifiers="const">
<return type="int" />
<argument index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
<description>
+ Returns the tile's terrain bit for the given [code]peering_bit[/code] direction.
</description>
</method>
<method name="is_collision_polygon_one_way" qualifiers="const">
@@ -68,6 +77,7 @@
<argument index="0" name="layer_id" type="int" />
<argument index="1" name="polygon_index" type="int" />
<description>
+ Returns whether one-way collisions are enabled for the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code].
</description>
</method>
<method name="remove_collision_polygon">
@@ -75,6 +85,7 @@
<argument index="0" name="layer_id" type="int" />
<argument index="1" name="polygon_index" type="int" />
<description>
+ Removes the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code].
</description>
</method>
<method name="set_collision_polygon_one_way">
@@ -83,6 +94,7 @@
<argument index="1" name="polygon_index" type="int" />
<argument index="2" name="one_way" type="bool" />
<description>
+ Enables/disables one-way collisions on the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code].
</description>
</method>
<method name="set_collision_polygon_one_way_margin">
@@ -91,6 +103,7 @@
<argument index="1" name="polygon_index" type="int" />
<argument index="2" name="one_way_margin" type="float" />
<description>
+ Enables/disables one-way collisions on the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code].
</description>
</method>
<method name="set_collision_polygon_points">
@@ -99,6 +112,7 @@
<argument index="1" name="polygon_index" type="int" />
<argument index="2" name="polygon" type="PackedVector2Array" />
<description>
+ Sets the points of the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code].
</description>
</method>
<method name="set_collision_polygons_count">
@@ -106,6 +120,7 @@
<argument index="0" name="layer_id" type="int" />
<argument index="1" name="polygons_count" type="int" />
<description>
+ Sets the polygons count for TileSet physics layer with index [code]layer_id[/code].
</description>
</method>
<method name="set_custom_data">
@@ -113,6 +128,7 @@
<argument index="0" name="layer_name" type="String" />
<argument index="1" name="value" type="Variant" />
<description>
+ Sets the tile's custom data value for the TileSet custom data layer with name [code]layer_name[/code].
</description>
</method>
<method name="set_custom_data_by_layer_id">
@@ -120,6 +136,7 @@
<argument index="0" name="layer_id" type="int" />
<argument index="1" name="value" type="Variant" />
<description>
+ Sets the tile's custom data value for the TileSet custom data layer with index [code]layer_id[/code].
</description>
</method>
<method name="set_navigation_polygon">
@@ -127,6 +144,7 @@
<argument index="0" name="layer_id" type="int" />
<argument index="1" name="navigation_polygon" type="NavigationPolygon" />
<description>
+ Sets the navigation polygon for the TileSet navigation layer with index [code]layer_id[/code].
</description>
</method>
<method name="set_occluder">
@@ -134,6 +152,7 @@
<argument index="0" name="layer_id" type="int" />
<argument index="1" name="occluder_polygon" type="OccluderPolygon2D" />
<description>
+ Sets the occluder for the TileSet occlusion layer with index [code]layer_id[/code].
</description>
</method>
<method name="set_peering_bit_terrain">
@@ -141,17 +160,7 @@
<argument index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
<argument index="1" name="terrain" type="int" />
<description>
- </description>
- </method>
- <method name="tile_get_material" qualifiers="const">
- <return type="ShaderMaterial" />
- <description>
- </description>
- </method>
- <method name="tile_set_material">
- <return type="void" />
- <argument index="0" name="material" type="ShaderMaterial" />
- <description>
+ Sets the tile's terrain bit for the given [code]peering_bit[/code] direction.
</description>
</method>
</methods>
@@ -160,6 +169,8 @@
</member>
<member name="flip_v" type="bool" setter="set_flip_v" getter="get_flip_v" default="false">
</member>
+ <member name="material" type="ShaderMaterial" setter="set_material" getter="get_material">
+ </member>
<member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)">
</member>
<member name="probability" type="float" setter="set_probability" getter="get_probability" default="1.0">
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index f3c64c3c7d..4621d138ac 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -4,8 +4,7 @@
Node for 2D tile-based maps.
</brief_description>
<description>
- Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps.
- When doing physics queries against the tilemap, the cell coordinates are encoded as [code]metadata[/code] for each detected collision shape returned by methods such as [method PhysicsDirectSpaceState2D.intersect_shape], [method PhysicsDirectBodyState2D.get_contact_collider_shape_metadata] etc.
+ Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles which are used to create grid-based maps. A TileMap may have several layers, layouting tiles on top of each other.
</description>
<tutorials>
<link title="Using Tilemaps">https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link>
@@ -17,6 +16,13 @@
<link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
+ <method name="add_layer">
+ <return type="void" />
+ <argument index="0" name="to_position" type="int" />
+ <description>
+ Adds a layer at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array.
+ </description>
+ </method>
<method name="clear">
<return type="void" />
<description>
@@ -35,6 +41,7 @@
<argument index="1" name="coords" type="Vector2i" />
<argument index="2" name="use_proxies" type="bool" />
<description>
+ Returns the tile alternative ID of the cell on layer [code]layer[/code] at [code]coords[/code]. If [code]use_proxies[/code] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy].
</description>
</method>
<method name="get_cell_atlas_coords" qualifiers="const">
@@ -43,6 +50,7 @@
<argument index="1" name="coords" type="Vector2i" />
<argument index="2" name="use_proxies" type="bool" />
<description>
+ Returns the tile atlas coordinates ID of the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. If [code]use_proxies[/code] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy].
</description>
</method>
<method name="get_cell_source_id" qualifiers="const">
@@ -51,24 +59,33 @@
<argument index="1" name="coords" type="Vector2i" />
<argument index="2" name="use_proxies" type="bool" />
<description>
+ Returns the tile source ID of the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. If [code]use_proxies[/code] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy].
</description>
</method>
<method name="get_layer_name" qualifiers="const">
<return type="String" />
<argument index="0" name="layer" type="int" />
<description>
+ Returns a TileMap layer's name.
</description>
</method>
<method name="get_layer_y_sort_origin" qualifiers="const">
<return type="int" />
<argument index="0" name="layer" type="int" />
<description>
+ Returns a TileMap layer's Y sort origin.
</description>
</method>
- <method name="get_layer_z_indexd" qualifiers="const">
+ <method name="get_layer_z_index" qualifiers="const">
<return type="int" />
<argument index="0" name="layer" type="int" />
<description>
+ Returns a TileMap layer's Z-index value.
+ </description>
+ </method>
+ <method name="get_layers_count" qualifiers="const">
+ <return type="int" />
+ <description>
</description>
</method>
<method name="get_neighbor_cell" qualifiers="const">
@@ -76,37 +93,41 @@
<argument index="0" name="coords" type="Vector2i" />
<argument index="1" name="neighbor" type="int" enum="TileSet.CellNeighbor" />
<description>
+ Returns the neighboring cell to the one at coordinates [code]coords[/code], indentified by the [code]neighbor[/code] direction. This method takes into account the different layouts a TileMap can take.
</description>
</method>
<method name="get_surrounding_tiles">
<return type="Vector2i[]" />
<argument index="0" name="coords" type="Vector2i" />
<description>
+ Returns the list of all neighbourings cells to the one at [code]coords[/code]
</description>
</method>
<method name="get_used_cells" qualifiers="const">
<return type="Vector2i[]" />
<argument index="0" name="layer" type="int" />
<description>
- Returns a [Vector2] array with the positions of all cells containing a tile from the tileset (i.e. a tile index different from [code]-1[/code]).
+ Returns a [Vector2] array with the positions of all cells containing a tile in the given layer. A cell is considered empty if its source identifier equals -1, its atlas coordinates identifiers is [code]Vector2(-1, -1)[/code] and its alternative identifier is -1.
</description>
</method>
<method name="get_used_rect">
<return type="Rect2" />
<description>
- Returns a rectangle enclosing the used (non-empty) tiles of the map.
+ Returns a rectangle enclosing the used (non-empty) tiles of the map, including all layers.
</description>
</method>
<method name="is_layer_enabled" qualifiers="const">
<return type="bool" />
<argument index="0" name="layer" type="int" />
<description>
+ Returns if a layer is enabled.
</description>
</method>
<method name="is_layer_y_sort_enabled" qualifiers="const">
<return type="bool" />
<argument index="0" name="layer" type="int" />
<description>
+ Returns if a layer Y-sorts its tiles.
</description>
</method>
<method name="map_to_world" qualifiers="const">
@@ -116,6 +137,21 @@
Returns the local position corresponding to the given tilemap (grid-based) coordinates.
</description>
</method>
+ <method name="move_layer">
+ <return type="void" />
+ <argument index="0" name="layer" type="int" />
+ <argument index="1" name="to_position" type="int" />
+ <description>
+ Moves the layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array.
+ </description>
+ </method>
+ <method name="remove_layer">
+ <return type="void" />
+ <argument index="0" name="layer" type="int" />
+ <description>
+ Moves the layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array.
+ </description>
+ </method>
<method name="set_cell">
<return type="void" />
<argument index="0" name="layer" type="int" />
@@ -124,7 +160,10 @@
<argument index="3" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" />
<argument index="4" name="alternative_tile" type="int" default="-1" />
<description>
- Sets the tile index for the cell given by a Vector2i.
+ Sets the tile indentifiers for the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. Each tile of the [TileSet] is identified using three parts:
+ - The source indentifier [code]source_id[/code] identifies a [TileSetSource] identifier. See [method TileSet.set_source_id],
+ - The atlas coordinates identifier [code]atlas_coords[/code] identifies a tile coordinates in the atlas (if the source is a [TileSetAtlasSource]. For [TileSetScenesCollectionSource] it should be 0),
+ - The alternative tile identifier [code]alternative_tile[/code] identifies a tile alternative the source is a [TileSetAtlasSource], and the scene for a [TileSetScenesCollectionSource].
</description>
</method>
<method name="set_layer_enabled">
@@ -132,6 +171,7 @@
<argument index="0" name="layer" type="int" />
<argument index="1" name="enabled" type="bool" />
<description>
+ Enables or disables the layer [code]layer[/code]. A disabled layer is not processed at all (no rendering, no physics, etc...).
</description>
</method>
<method name="set_layer_name">
@@ -139,6 +179,7 @@
<argument index="0" name="layer" type="int" />
<argument index="1" name="name" type="String" />
<description>
+ Sets a layer's name. This is mostly useful in the editor.
</description>
</method>
<method name="set_layer_y_sort_enabled">
@@ -146,6 +187,8 @@
<argument index="0" name="layer" type="int" />
<argument index="1" name="y_sort_enabled" type="bool" />
<description>
+ Enables or disables a layer's Y-sorting. If a layer is Y-sorted, the layer will behave as a CanvasItem node where each of its tile gets Y-sorted.
+ Y-sorted layers should usually be on different Z-index values than not Y-sorted layers, otherwise, each of those layer will be Y-sorted as whole with the Y-sorted one. This is usually an undesired behvaior.
</description>
</method>
<method name="set_layer_y_sort_origin">
@@ -153,6 +196,8 @@
<argument index="0" name="layer" type="int" />
<argument index="1" name="y_sort_origin" type="int" />
<description>
+ Sets a layer's Y-sort origin value. This Y-sort origin value is added to each tile's Y-sort origin value.
+ This allows, for example, to fake a different height level on each layer. This can be useful for top-down view games.
</description>
</method>
<method name="set_layer_z_index">
@@ -160,6 +205,7 @@
<argument index="0" name="layer" type="int" />
<argument index="1" name="z_index" type="int" />
<description>
+ Sets a layers Z-index value. This Z-index is added to each tile's Z-index value.
</description>
</method>
<method name="world_to_map" qualifiers="const">
@@ -175,10 +221,10 @@
The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size.
</member>
<member name="collision_visibility_mode" type="int" setter="set_collision_visibility_mode" getter="get_collision_visibility_mode" enum="TileMap.VisibilityMode" default="0">
- </member>
- <member name="layers_count" type="int" setter="set_layers_count" getter="get_layers_count" default="1">
+ Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show collision debug settings.
</member>
<member name="navigation_visibility_mode" type="int" setter="set_navigation_visibility_mode" getter="get_navigation_visibility_mode" enum="TileMap.VisibilityMode" default="0">
+ Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show navigation debug settings.
</member>
<member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset">
The assigned [TileSet].
@@ -193,10 +239,13 @@
</signals>
<constants>
<constant name="VISIBILITY_MODE_DEFAULT" value="0" enum="VisibilityMode">
+ Use the debug settings to determine visibility.
</constant>
<constant name="VISIBILITY_MODE_FORCE_HIDE" value="2" enum="VisibilityMode">
+ Always hide.
</constant>
<constant name="VISIBILITY_MODE_FORCE_SHOW" value="1" enum="VisibilityMode">
+ Always show.
</constant>
</constants>
</class>
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index 439c6e3830..02baded019 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -4,8 +4,13 @@
Tile library for tilemaps.
</brief_description>
<description>
- A TileSet is a library of tiles for a [TileMap]. It contains a list of tiles, each consisting of a sprite and optional collision shapes.
- Tiles are referenced by a unique integer ID.
+ A TileSet is a library of tiles for a [TileMap]. A TileSet handles a list of [TileSetSource], each of them storing a set of tiles.
+ Tiles can either be from a [TileSetAtlasSource], that render tiles out of a texture with support for physics, navigation, etc... or from a [TileSetScenesCollectionSource] which exposes scene-based tiles.
+ Tiles are referenced by using three IDs: their source ID, their atlas coordinates ID and their alternative tile ID.
+
+ A TileSet can be configured so that its tiles expose more or less properties. To do so, the TileSet resources uses property layers, that you can add or remove depending on your needs.
+ For example, adding a physics layer allows giving collision shapes to your tiles. Each layer having dedicated properties (physics layer an mask), you may add several TileSet physics layers for each type of collision you need.
+ See the functions to add new layers for more information.
</description>
<tutorials>
<link title="Using Tilemaps">https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link>
@@ -17,21 +22,72 @@
<link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
+ <method name="add_custom_data_layer">
+ <return type="void" />
+ <argument index="0" name="to_position" type="int" default="-1" />
+ <description>
+ Adds a custom data layer to the TileSet at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array.
+ Custom data layers allow assigning custom properties to atlas tiles.
+ </description>
+ </method>
+ <method name="add_navigation_layer">
+ <return type="void" />
+ <argument index="0" name="to_position" type="int" default="-1" />
+ <description>
+ Adds a navigation layer to the TileSet at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array.
+ Navigation layers allow assigning a navigable area to atlas tiles.
+ </description>
+ </method>
+ <method name="add_occlusion_layer">
+ <return type="void" />
+ <argument index="0" name="to_position" type="int" default="-1" />
+ <description>
+ Adds an occlusion layer to the TileSet at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array.
+ Occlusion layers allow assigning occlusion polygons to atlas tiles.
+ </description>
+ </method>
+ <method name="add_physics_layer">
+ <return type="void" />
+ <argument index="0" name="to_position" type="int" default="-1" />
+ <description>
+ Adds a physics layer to the TileSet at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array.
+ Physics layers allow assigning collision polygons to atlas tiles.
+ </description>
+ </method>
<method name="add_source">
<return type="int" />
- <argument index="0" name="atlas_source_id_override" type="TileSetSource" />
- <argument index="1" name="arg1" type="int" default="-1" />
+ <argument index="0" name="source" type="TileSetSource" />
+ <argument index="1" name="atlas_source_id_override" type="int" default="-1" />
<description>
+ Adds a [TileSetSource] to the TileSet. If [code]atlas_source_id_override[/code] is not -1, also set its source ID. Otherwise, a unique identifier is automatically generated.
+ The function returns the added source source ID or -1 if the source could not be added.
+ </description>
+ </method>
+ <method name="add_terrain">
+ <return type="void" />
+ <argument index="0" name="terrain_set" type="int" />
+ <argument index="1" name="to_position" type="int" default="-1" />
+ <description>
+ Adds a new terrain to the given terrain set [code]terrain_set[/code] at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array.
+ </description>
+ </method>
+ <method name="add_terrain_set">
+ <return type="void" />
+ <argument index="0" name="to_position" type="int" default="-1" />
+ <description>
+ Adds a new terrain set at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array.
</description>
</method>
<method name="cleanup_invalid_tile_proxies">
<return type="void" />
<description>
+ Clears tile proxies pointing to invalid tiles.
</description>
</method>
<method name="clear_tile_proxies">
<return type="void" />
<description>
+ Clears all tile proxies.
</description>
</method>
<method name="get_alternative_level_tile_proxy">
@@ -40,6 +96,8 @@
<argument index="1" name="coords_from" type="Vector2i" />
<argument index="2" name="alternative_from" type="int" />
<description>
+ Returns the alternative-level proxy for the given identifiers. The returned array contains the three proxie's target identifiers (source ID, atlas coords ID and alternative tile ID).
+ If the TileSet has no proxy for the given identifiers, returns an empty Array.
</description>
</method>
<method name="get_coords_level_tile_proxy">
@@ -47,70 +105,108 @@
<argument index="0" name="source_from" type="int" />
<argument index="1" name="coords_from" type="Vector2i" />
<description>
+ Returns the coodinate-level proxy for the given identifiers. The returned array contains the two proxie's target identifiers (source ID and atlas coords ID).
+ If the TileSet has no proxy for the given identifiers, returns an empty Array.
+ </description>
+ </method>
+ <method name="get_custom_data_layers_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the custom data layers count.
</description>
</method>
<method name="get_navigation_layer_layers" qualifiers="const">
<return type="int" />
<argument index="0" name="layer_index" type="int" />
<description>
+ Returns the navigation layers (as in the Navigation server) of the gives TileSet navigation layer.
+ </description>
+ </method>
+ <method name="get_navigation_layers_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the navigation layers count.
</description>
</method>
<method name="get_next_source_id" qualifiers="const">
<return type="int" />
<description>
+ Returns a new unused source ID. This generated ID is the same that a call to [code]add_source[/code] would return.
</description>
</method>
<method name="get_occlusion_layer_light_mask" qualifiers="const">
<return type="int" />
- <argument index="0" name="arg0" type="int" />
+ <argument index="0" name="layer_index" type="int" />
<description>
+ Returns the light mask of the occlusion layer.
</description>
</method>
<method name="get_occlusion_layer_sdf_collision" qualifiers="const">
<return type="bool" />
- <argument index="0" name="arg0" type="int" />
+ <argument index="0" name="layer_index" type="int" />
+ <description>
+ Returns if the occluders from this layer use [code]sdf_collision[/code].
+ </description>
+ </method>
+ <method name="get_occlusion_layers_count" qualifiers="const">
+ <return type="int" />
<description>
+ Returns the occlusion layers count.
</description>
</method>
<method name="get_physics_layer_collision_layer" qualifiers="const">
<return type="int" />
<argument index="0" name="layer_index" type="int" />
<description>
+ Returns the collision layer (as in the physics server) bodies on the given TileSet's physics layer are in.
</description>
</method>
<method name="get_physics_layer_collision_mask" qualifiers="const">
<return type="int" />
<argument index="0" name="layer_index" type="int" />
<description>
+ Returns the collision mask of bodies on the given TileSet's physics layer.
</description>
</method>
<method name="get_physics_layer_physics_material" qualifiers="const">
<return type="PhysicsMaterial" />
<argument index="0" name="layer_index" type="int" />
<description>
+ Returns the physics material of bodies on the given TileSet's physics layer.
+ </description>
+ </method>
+ <method name="get_physics_layers_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the physics layers count.
</description>
</method>
<method name="get_source" qualifiers="const">
<return type="TileSetSource" />
- <argument index="0" name="index" type="int" />
+ <argument index="0" name="source_id" type="int" />
<description>
+ Returns the [TileSetSource] with ID [code]source_id[/code].
</description>
</method>
<method name="get_source_count" qualifiers="const">
<return type="int" />
<description>
+ Returns the number of [TileSetSource] in this TileSet.
</description>
</method>
<method name="get_source_id" qualifiers="const">
<return type="int" />
<argument index="0" name="index" type="int" />
<description>
+ Returns the source ID for source with index [code]index[/code].
</description>
</method>
<method name="get_source_level_tile_proxy">
<return type="int" />
<argument index="0" name="source_from" type="int" />
<description>
+ Returns the source-level proxy for the given source identifier.
+ If the TileSet has no proxy for the given identifier, returns -1.
</description>
</method>
<method name="get_terrain_color" qualifiers="const">
@@ -118,6 +214,7 @@
<argument index="0" name="terrain_set" type="int" />
<argument index="1" name="terrain_index" type="int" />
<description>
+ Returns a terrain's color.
</description>
</method>
<method name="get_terrain_name" qualifiers="const">
@@ -125,18 +222,27 @@
<argument index="0" name="terrain_set" type="int" />
<argument index="1" name="terrain_index" type="int" />
<description>
+ Returns a terrain's name.
</description>
</method>
<method name="get_terrain_set_mode" qualifiers="const">
<return type="int" enum="TileSet.TerrainMode" />
<argument index="0" name="terrain_set" type="int" />
<description>
+ Returns a terrain set mode.
+ </description>
+ </method>
+ <method name="get_terrain_sets_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the terrain sets count.
</description>
</method>
<method name="get_terrains_count" qualifiers="const">
<return type="int" />
<argument index="0" name="terrain_set" type="int" />
<description>
+ Returns the number of terrains in the given terrain set.
</description>
</method>
<method name="has_alternative_level_tile_proxy">
@@ -145,6 +251,7 @@
<argument index="1" name="coords_from" type="Vector2i" />
<argument index="2" name="alternative_from" type="int" />
<description>
+ Returns if there is and alternative-level proxy for the given identifiers.
</description>
</method>
<method name="has_coords_level_tile_proxy">
@@ -152,18 +259,21 @@
<argument index="0" name="source_from" type="int" />
<argument index="1" name="coords_from" type="Vector2i" />
<description>
+ Returns if there is a coodinates-level proxy for the given identifiers.
</description>
</method>
<method name="has_source" qualifiers="const">
<return type="bool" />
- <argument index="0" name="index" type="int" />
+ <argument index="0" name="source_id" type="int" />
<description>
+ Returns if this TileSet has a source for the given source ID.
</description>
</method>
<method name="has_source_level_tile_proxy">
<return type="bool" />
<argument index="0" name="source_from" type="int" />
<description>
+ Returns if there is a source-level proxy for the given source ID.
</description>
</method>
<method name="map_tile_proxy" qualifiers="const">
@@ -172,6 +282,58 @@
<argument index="1" name="coords_from" type="Vector2i" />
<argument index="2" name="alternative_from" type="int" />
<description>
+ According to the configured proxies, maps the provided indentifiers to a new set of identifiers. The source ID, atlas coordinates ID and alternative tile ID are returned as a 3 elements Array.
+ This function first look for matching alternative-level proxies, then coordinates-level proxies, then source-level proxies.
+ If no proxy corresponding to provided identifiers are found, returns the same values the ones used as arguments.
+ </description>
+ </method>
+ <method name="move_custom_data_layer">
+ <return type="void" />
+ <argument index="0" name="layer_index" type="int" />
+ <argument index="1" name="to_position" type="int" />
+ <description>
+ Moves the custom data layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly.
+ </description>
+ </method>
+ <method name="move_navigation_layer">
+ <return type="void" />
+ <argument index="0" name="layer_index" type="int" />
+ <argument index="1" name="to_position" type="int" />
+ <description>
+ Moves the navigation layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly.
+ </description>
+ </method>
+ <method name="move_occlusion_layer">
+ <return type="void" />
+ <argument index="0" name="layer_index" type="int" />
+ <argument index="1" name="to_position" type="int" />
+ <description>
+ Moves the occlusion layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly.
+ </description>
+ </method>
+ <method name="move_physics_layer">
+ <return type="void" />
+ <argument index="0" name="layer_index" type="int" />
+ <argument index="1" name="to_position" type="int" />
+ <description>
+ Moves the physics layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly.
+ </description>
+ </method>
+ <method name="move_terrain">
+ <return type="void" />
+ <argument index="0" name="terrain_set" type="int" />
+ <argument index="1" name="terrain_index" type="int" />
+ <argument index="2" name="to_position" type="int" />
+ <description>
+ Moves the terrain at index [code]terrain_index[/code] for terrain set [code]terrain_set[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly.
+ </description>
+ </method>
+ <method name="move_terrain_set">
+ <return type="void" />
+ <argument index="0" name="terrain_set" type="int" />
+ <argument index="1" name="to_position" type="int" />
+ <description>
+ Moves the terrain set at index [code]terrain_set[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly.
</description>
</method>
<method name="remove_alternative_level_tile_proxy">
@@ -180,6 +342,7 @@
<argument index="1" name="coords_from" type="Vector2i" />
<argument index="2" name="alternative_from" type="int" />
<description>
+ Removes an alternative-level proxy for the given identifiers.
</description>
</method>
<method name="remove_coords_level_tile_proxy">
@@ -187,18 +350,64 @@
<argument index="0" name="source_from" type="int" />
<argument index="1" name="coords_from" type="Vector2i" />
<description>
+ Removes a coordinates-level proxy for the given identifiers.
+ </description>
+ </method>
+ <method name="remove_custom_data_layer">
+ <return type="void" />
+ <argument index="0" name="layer_index" type="int" />
+ <description>
+ Removes the custom data layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly.
+ </description>
+ </method>
+ <method name="remove_navigation_layer">
+ <return type="void" />
+ <argument index="0" name="layer_index" type="int" />
+ <description>
+ Removes the navigation layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly.
+ </description>
+ </method>
+ <method name="remove_occlusion_layer">
+ <return type="void" />
+ <argument index="0" name="layer_index" type="int" />
+ <description>
+ Removes the occlusion layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly.
+ </description>
+ </method>
+ <method name="remove_physics_layer">
+ <return type="void" />
+ <argument index="0" name="layer_index" type="int" />
+ <description>
+ Removes the physics layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly.
</description>
</method>
<method name="remove_source">
<return type="void" />
<argument index="0" name="source_id" type="int" />
<description>
+ Removes the source with the given source ID.
</description>
</method>
<method name="remove_source_level_tile_proxy">
<return type="void" />
<argument index="0" name="source_from" type="int" />
<description>
+ Removes a source-level tile proxy.
+ </description>
+ </method>
+ <method name="remove_terrain">
+ <return type="void" />
+ <argument index="0" name="terrain_set" type="int" />
+ <argument index="1" name="terrain_index" type="int" />
+ <description>
+ Removes the terrain at index [code]terrain_index[/code] in the given terrain set [code]terrain_set[/code]. Also updates the atlas tiles accordingly.
+ </description>
+ </method>
+ <method name="remove_terrain_set">
+ <return type="void" />
+ <argument index="0" name="terrain_set" type="int" />
+ <description>
+ Removes the terrain set at index [code]terrain_set[/code]. Also updates the atlas tiles accordingly.
</description>
</method>
<method name="set_alternative_level_tile_proxy">
@@ -210,6 +419,9 @@
<argument index="4" name="coords_to" type="Vector2i" />
<argument index="5" name="alternative_to" type="int" />
<description>
+ Create an alternative-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers.
+ This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available.
+ Proxied tiles can be automatically replaced in TileMap nodes using the editor.
</description>
</method>
<method name="set_coords_level_tile_proxy">
@@ -219,6 +431,9 @@
<argument index="2" name="source_to" type="int" />
<argument index="3" name="coords_to" type="Vector2i" />
<description>
+ Creates a coordinates-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers. The alternative tile ID is kept the same when using coordinates-level proxies.
+ This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available.
+ Proxied tiles can be automatically replaced in TileMap nodes using the editor.
</description>
</method>
<method name="set_navigation_layer_layers">
@@ -226,6 +441,7 @@
<argument index="0" name="layer_index" type="int" />
<argument index="1" name="layers" type="int" />
<description>
+ Sets the navigation layers (as in the navigation server) for navigation regions is the given TileSet navigation layer.
</description>
</method>
<method name="set_occlusion_layer_light_mask">
@@ -233,13 +449,15 @@
<argument index="0" name="layer_index" type="int" />
<argument index="1" name="light_mask" type="int" />
<description>
+ Sets the occlusion layer (as in the rendering server) for occluders in the given TileSet occlusion layer.
</description>
</method>
<method name="set_occlusion_layer_sdf_collision">
<return type="void" />
<argument index="0" name="layer_index" type="int" />
- <argument index="1" name="sdf_collision" type="int" />
+ <argument index="1" name="sdf_collision" type="bool" />
<description>
+ Enables or disables sdf collision for occluders in the given TileSet occlusion layer.
</description>
</method>
<method name="set_physics_layer_collision_layer">
@@ -247,6 +465,7 @@
<argument index="0" name="layer_index" type="int" />
<argument index="1" name="layer" type="int" />
<description>
+ Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer.
</description>
</method>
<method name="set_physics_layer_collision_mask">
@@ -254,6 +473,7 @@
<argument index="0" name="layer_index" type="int" />
<argument index="1" name="mask" type="int" />
<description>
+ Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer.
</description>
</method>
<method name="set_physics_layer_physics_material">
@@ -261,13 +481,15 @@
<argument index="0" name="layer_index" type="int" />
<argument index="1" name="physics_material" type="PhysicsMaterial" />
<description>
+ Sets the physics material for bodies in the given TileSet physics layer.
</description>
</method>
<method name="set_source_id">
<return type="void" />
<argument index="0" name="source_id" type="int" />
- <argument index="1" name="arg1" type="int" />
+ <argument index="1" name="new_source_id" type="int" />
<description>
+ Changes a source's ID.
</description>
</method>
<method name="set_source_level_tile_proxy">
@@ -275,6 +497,9 @@
<argument index="0" name="source_from" type="int" />
<argument index="1" name="source_to" type="int" />
<description>
+ Creates a source-level proxy for the given source ID. A proxy will map set of tile identifiers to another set of identifiers. Both the atlac coordinates ID and the alternative tile ID are kept the same when using source-level proxies.
+ This can be used to replace a source in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target source when one is available.
+ Proxied tiles can be automatically replaced in TileMap nodes using the editor.
</description>
</method>
<method name="set_terrain_color">
@@ -283,6 +508,7 @@
<argument index="1" name="terrain_index" type="int" />
<argument index="2" name="color" type="Color" />
<description>
+ Sets a terrain's color. This color is used for identifying the different terrains in the TileSet editor.
</description>
</method>
<method name="set_terrain_name">
@@ -291,6 +517,7 @@
<argument index="1" name="terrain_index" type="int" />
<argument index="2" name="name" type="String" />
<description>
+ Sets a terrain's name.
</description>
</method>
<method name="set_terrain_set_mode">
@@ -298,103 +525,120 @@
<argument index="0" name="terrain_set" type="int" />
<argument index="1" name="mode" type="int" enum="TileSet.TerrainMode" />
<description>
- </description>
- </method>
- <method name="set_terrains_count">
- <return type="void" />
- <argument index="0" name="terrain_set" type="int" />
- <argument index="1" name="terrains_count" type="int" />
- <description>
+ Sets a terrain mode. Each mode determines which bits of a tile shape is used to match the neighbouring tiles' terrains.
</description>
</method>
</methods>
<members>
- <member name="custom_data_layers_count" type="int" setter="set_custom_data_layers_count" getter="get_custom_data_layers_count" default="0">
- </member>
- <member name="navigation_layers_count" type="int" setter="set_navigation_layers_count" getter="get_navigation_layers_count" default="0">
- </member>
- <member name="occlusion_layers_count" type="int" setter="set_occlusion_layers_count" getter="get_occlusion_layers_count" default="0">
- </member>
- <member name="physics_layers_count" type="int" setter="set_physics_layers_count" getter="get_physics_layers_count" default="0">
- </member>
- <member name="terrains_sets_count" type="int" setter="set_terrain_sets_count" getter="get_terrain_sets_count" default="0">
- </member>
<member name="tile_layout" type="int" setter="set_tile_layout" getter="get_tile_layout" enum="TileSet.TileLayout" default="0">
+ For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), changes the way tiles are indexed in the TileMap grid.
</member>
<member name="tile_offset_axis" type="int" setter="set_tile_offset_axis" getter="get_tile_offset_axis" enum="TileSet.TileOffsetAxis" default="0">
+ For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), determines the offset axis.
</member>
<member name="tile_shape" type="int" setter="set_tile_shape" getter="get_tile_shape" enum="TileSet.TileShape" default="0">
+ The tile shape.
</member>
<member name="tile_size" type="Vector2i" setter="set_tile_size" getter="get_tile_size" default="Vector2i(16, 16)">
+ The tile size, in pixels. For all tile shapes, this size corresponds to the encompassing rectangle of the tile shape. This is thus the minimal cell size required in an atlas.
</member>
<member name="uv_clipping" type="bool" setter="set_uv_clipping" getter="is_uv_clipping" default="false">
+ Enables/Disable uv clipping when rendering the tiles.
</member>
</members>
<constants>
<constant name="TILE_SHAPE_SQUARE" value="0" enum="TileShape">
- Orthogonal orientation mode.
+ Rectangular tile shape.
</constant>
<constant name="TILE_SHAPE_ISOMETRIC" value="1" enum="TileShape">
- Isometric orientation mode.
+ Diamond tile shape (for isometric look).
</constant>
<constant name="TILE_SHAPE_HALF_OFFSET_SQUARE" value="2" enum="TileShape">
+ Rectangular tile shape with one row/colum out of two offset by half a tile.
</constant>
<constant name="TILE_SHAPE_HEXAGON" value="3" enum="TileShape">
- Hexagon orientation mode.
+ Hexagonal tile shape.
</constant>
<constant name="TILE_LAYOUT_STACKED" value="0" enum="TileLayout">
+ Tile coordinates layout where both axis stay consistent with their respective local horizontal and vertical axis.
</constant>
<constant name="TILE_LAYOUT_STACKED_OFFSET" value="1" enum="TileLayout">
+ Same as [code]TILE_LAYOUT_STAKED[/code], but the first half-offset is negative instead of positive.
</constant>
<constant name="TILE_LAYOUT_STAIRS_RIGHT" value="2" enum="TileLayout">
+ Tile coordinates layout where the horizontal axis stay horizontal, and the vertical one goes down-right.
</constant>
<constant name="TILE_LAYOUT_STAIRS_DOWN" value="3" enum="TileLayout">
+ Tile coordinates layout where the vertical axis stay vertical, and the horizontal one goes down-right.
</constant>
<constant name="TILE_LAYOUT_DIAMOND_RIGHT" value="4" enum="TileLayout">
+ Tile coordinates layout where the horizontal axis goes up-right, and the vertical one goes down-right.
</constant>
<constant name="TILE_LAYOUT_DIAMOND_DOWN" value="5" enum="TileLayout">
+ Tile coordinates layout where the horizontal axis goes down-right, and the vertical one goes down-left.
</constant>
<constant name="TILE_OFFSET_AXIS_HORIZONTAL" value="0" enum="TileOffsetAxis">
+ Horizontal half-offset.
</constant>
<constant name="TILE_OFFSET_AXIS_VERTICAL" value="1" enum="TileOffsetAxis">
+ Vertical half-offset.
</constant>
<constant name="CELL_NEIGHBOR_RIGHT_SIDE" value="0" enum="CellNeighbor">
+ Neighbor on the right side.
</constant>
<constant name="CELL_NEIGHBOR_RIGHT_CORNER" value="1" enum="CellNeighbor">
+ Neighbor in the right corner.
</constant>
<constant name="CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE" value="2" enum="CellNeighbor">
+ Neighbor on the bottom right side.
</constant>
<constant name="CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER" value="3" enum="CellNeighbor">
+ Neighbor in the bottom right corner.
</constant>
<constant name="CELL_NEIGHBOR_BOTTOM_SIDE" value="4" enum="CellNeighbor">
+ Neighbor on the bottom side.
</constant>
<constant name="CELL_NEIGHBOR_BOTTOM_CORNER" value="5" enum="CellNeighbor">
+ Neighbor in the bottom corner.
</constant>
<constant name="CELL_NEIGHBOR_BOTTOM_LEFT_SIDE" value="6" enum="CellNeighbor">
+ Neighbor on the bottom left side.
</constant>
<constant name="CELL_NEIGHBOR_BOTTOM_LEFT_CORNER" value="7" enum="CellNeighbor">
+ Neighbor in the bottom left corner.
</constant>
<constant name="CELL_NEIGHBOR_LEFT_SIDE" value="8" enum="CellNeighbor">
+ Neighbor on the left side.
</constant>
<constant name="CELL_NEIGHBOR_LEFT_CORNER" value="9" enum="CellNeighbor">
+ Neighbor in the left corner.
</constant>
<constant name="CELL_NEIGHBOR_TOP_LEFT_SIDE" value="10" enum="CellNeighbor">
+ Neighbor on the top left side.
</constant>
<constant name="CELL_NEIGHBOR_TOP_LEFT_CORNER" value="11" enum="CellNeighbor">
+ Neighbor in the top left corner.
</constant>
<constant name="CELL_NEIGHBOR_TOP_SIDE" value="12" enum="CellNeighbor">
+ Neighbor on the top side.
</constant>
<constant name="CELL_NEIGHBOR_TOP_CORNER" value="13" enum="CellNeighbor">
+ Neighbor in the top corner.
</constant>
<constant name="CELL_NEIGHBOR_TOP_RIGHT_SIDE" value="14" enum="CellNeighbor">
+ Neighbor on the top right side.
</constant>
<constant name="CELL_NEIGHBOR_TOP_RIGHT_CORNER" value="15" enum="CellNeighbor">
+ Neighbor in the top right corner.
</constant>
<constant name="TERRAIN_MODE_MATCH_CORNERS_AND_SIDES" value="0" enum="TerrainMode">
+ Requires both corners and side to match with neighboring tiles' terrains.
</constant>
<constant name="TERRAIN_MODE_MATCH_CORNERS" value="1" enum="TerrainMode">
+ Requires corners to match with neighboring tiles' terrains.
</constant>
<constant name="TERRAIN_MODE_MATCH_SIDES" value="2" enum="TerrainMode">
+ Requires sides to match with neighboring tiles' terrains.
</constant>
</constants>
</class>
diff --git a/doc/classes/TileSetAtlasSource.xml b/doc/classes/TileSetAtlasSource.xml
index 8caa3a7c39..fd3dbd1e4d 100644
--- a/doc/classes/TileSetAtlasSource.xml
+++ b/doc/classes/TileSetAtlasSource.xml
@@ -1,8 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="TileSetAtlasSource" inherits="TileSetSource" version="4.0">
<brief_description>
+ Exposes a 2D atlas texture as a set of tiles for a [TileSet] resource.
</brief_description>
<description>
+ An atlas is a grid of tiles laid out on a texture. Each tile in the grid must be exposed using [method create_tile]. Those tiles are then indexed using their coordinates in the grid.
+ Each tile can also have a size in the grid coordinates, making it more or less cells in the atlas.
+
+ Alternatives version of a tile can be created using [method create_alternative_tile], which are then indexed using an alternative ID. The main tile (the one in the grid), is accessed with an alternative ID equal to 0.
+
+ Each tile alternate has a set of properties that is defined by the source's [TileSet] layers. Those properties are stored in a TileData object that can be accessed and modified using [method get_tile_data].
+ As TileData properties are stored directly in the TileSetAtlasSource resource, their properties might also be set using [code]TileSetAtlasSource.set("&lt;coords_x&gt;:&lt;coords_y&gt;/&lt;alternative_id&gt;/&lt;tile_data_property&gt;")[/code].
</description>
<tutorials>
</tutorials>
@@ -13,11 +21,14 @@
<argument index="1" name="new_atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" />
<argument index="2" name="new_size" type="Vector2i" default="Vector2i(-1, -1)" />
<description>
+ Returns true if the tile at the [code]atlas_coords[/code] coordinates can be moved to the [code]new_atlas_coords[/code] coordinates with the [code]new_size[/code] size. This functions returns false if a tile is already present in the given area, or if this area is outside the atlas boundaries.
+ If [code]new_atlas_coords[/code] is [code]Vector2i(-1, -1)[/code], keeps the tile's coordinates. If [code]new_size[/code] is [code]Vector2i(-1, -1)[/code], keeps the tile's size.
</description>
</method>
<method name="clear_tiles_outside_texture">
<return type="void" />
<description>
+ Clears all tiles that are defined outside the texture boundaries.
</description>
</method>
<method name="create_alternative_tile">
@@ -25,6 +36,8 @@
<argument index="0" name="atlas_coords" type="Vector2i" />
<argument index="1" name="alternative_id_override" type="int" default="-1" />
<description>
+ Creates an alternative tile for the tile at coords [code]atlas_coords[/code]. If [code]alternative_id_override[/code] is -1, give it an automatically generated unique ID, or assigns it the given ID otherwise.
+ Returns the new alternative identifier, or -1 if the alternative could not be created with a provided [code]alternative_id_override[/code].
</description>
</method>
<method name="create_tile">
@@ -32,84 +45,55 @@
<argument index="0" name="atlas_coords" type="Vector2i" />
<argument index="1" name="size" type="Vector2i" default="Vector2i(1, 1)" />
<description>
- </description>
- </method>
- <method name="get_alternative_tile_id" qualifiers="const">
- <return type="int" />
- <argument index="0" name="atlas_coords" type="Vector2i" />
- <argument index="1" name="index" type="int" />
- <description>
- </description>
- </method>
- <method name="get_alternative_tiles_count" qualifiers="const">
- <return type="int" />
- <argument index="0" name="atlas_coords" type="Vector2i" />
- <description>
+ Creates a new tile at coords [code]atlas_coords[/code] with size [code]size[/code].
</description>
</method>
<method name="get_atlas_grid_size" qualifiers="const">
<return type="Vector2i" />
<description>
+ Returns the atlas grid size, which depends on how many tiles can fit in the texture. It thus depends on the Texture's size, the atlas [code]margins[/code] the tiles' [code]texture_region_size[/code].
</description>
</method>
<method name="get_next_alternative_tile_id" qualifiers="const">
<return type="int" />
<argument index="0" name="atlas_coords" type="Vector2i" />
<description>
+ Returns the alternative ID a following call to [method create_alternative_tile] would return.
</description>
</method>
<method name="get_tile_at_coords" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="atlas_coords" type="Vector2i" />
<description>
+ If there is a tile covering the [code]atlas_coords[/code] coordinates, returns the top-left coordinates of the tile (thus its coordinate ID). Returns [code]Vector2i(-1, -1)[/code] otherwise.
</description>
</method>
<method name="get_tile_data" qualifiers="const">
<return type="Object" />
<argument index="0" name="atlas_coords" type="Vector2i" />
- <argument index="1" name="index" type="int" />
- <description>
- </description>
- </method>
- <method name="get_tile_id" qualifiers="const">
- <return type="Vector2i" />
- <argument index="0" name="index" type="int" />
+ <argument index="1" name="alternative_tile" type="int" />
<description>
+ Returns the [TileData] object for the given atlas coordinates and alternative ID.
</description>
</method>
<method name="get_tile_size_in_atlas" qualifiers="const">
<return type="Vector2i" />
<argument index="0" name="atlas_coords" type="Vector2i" />
<description>
+ Returns the size of the tile (in the grid coordinates system) at coordinates [code]atlas_coords[/code].
</description>
</method>
<method name="get_tile_texture_region" qualifiers="const">
<return type="Rect2i" />
<argument index="0" name="atlas_coords" type="Vector2i" />
<description>
- </description>
- </method>
- <method name="get_tiles_count" qualifiers="const">
- <return type="int" />
- <description>
- </description>
- </method>
- <method name="has_alternative_tile" qualifiers="const">
- <return type="bool" />
- <argument index="0" name="atlas_coords" type="Vector2i" />
- <argument index="1" name="alternative_tile" type="int" />
- <description>
- </description>
- </method>
- <method name="has_tile" qualifiers="const">
- <return type="bool" />
- <argument index="0" name="atlas_coords" type="Vector2i" />
- <description>
+ Returns a tile's texture region in the atlas texture.
</description>
</method>
<method name="has_tiles_outside_texture">
<return type="bool" />
<description>
+ Returns if this atlas has tiles outside of its texture.
</description>
</method>
<method name="move_tile_in_atlas">
@@ -118,6 +102,9 @@
<argument index="1" name="new_atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" />
<argument index="2" name="new_size" type="Vector2i" default="Vector2i(-1, -1)" />
<description>
+ Move the tile and its alternatives at the [code]atlas_coords[/code] coordinates to the [code]new_atlas_coords[/code] coordinates with the [code]new_size[/code] size. This functions will fail if a tile is already present in the given area.
+ If [code]new_atlas_coords[/code] is [code]Vector2i(-1, -1)[/code], keeps the tile's coordinates. If [code]new_size[/code] is [code]Vector2i(-1, -1)[/code], keeps the tile's size.
+ To avoid an error, first check if a move is possible using [method can_move_tile_in_atlas].
</description>
</method>
<method name="remove_alternative_tile">
@@ -125,12 +112,15 @@
<argument index="0" name="atlas_coords" type="Vector2i" />
<argument index="1" name="alternative_tile" type="int" />
<description>
+ Remove a tile's alternative with alternative ID [code]alternative_tile[/code].
+ Calling this function with [code]alternative_tile[/code] equals to 0 will fail, as the base tile alternative cannot be removed.
</description>
</method>
<method name="remove_tile">
<return type="void" />
<argument index="0" name="atlas_coords" type="Vector2i" />
<description>
+ Remove a tile and its alternative at coordinates [code]atlas_coords[/code].
</description>
</method>
<method name="set_alternative_tile_id">
@@ -139,17 +129,23 @@
<argument index="1" name="alternative_tile" type="int" />
<argument index="2" name="new_id" type="int" />
<description>
+ Change a tile's alternative ID from [code]alternative_tile[/code] to [code]new_id[/code].
+ Calling this function with [code]alternative_id[/code] equals to 0 will fail, as the base tile alternative cannot be moved.
</description>
</method>
</methods>
<members>
<member name="margins" type="Vector2i" setter="set_margins" getter="get_margins" default="Vector2i(0, 0)">
+ Margins, in pixels, to offset the origin of the grid in the texture.
</member>
<member name="separation" type="Vector2i" setter="set_separation" getter="get_separation" default="Vector2i(0, 0)">
+ Separation, in pixels, between each tile texture region of the grid.
</member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
+ The atlas texture.
</member>
- <member name="tile_size" type="Vector2i" setter="set_texture_region_size" getter="get_texture_region_size" default="Vector2i(16, 16)">
+ <member name="texture_region_size" type="Vector2i" setter="set_texture_region_size" getter="get_texture_region_size" default="Vector2i(16, 16)">
+ The base tile size in the texture (in pixel). This size must be bigger than the TileSet's [code]tile_size[/code] value.
</member>
</members>
<constants>
diff --git a/doc/classes/TileSetScenesCollectionSource.xml b/doc/classes/TileSetScenesCollectionSource.xml
index a44f519a4c..119a04c25f 100644
--- a/doc/classes/TileSetScenesCollectionSource.xml
+++ b/doc/classes/TileSetScenesCollectionSource.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="TileSetScenesCollectionSource" inherits="TileSetSource" version="4.0">
<brief_description>
+ Exposes a set of scenes as tiles for a [TileSet] resource.
</brief_description>
<description>
+ When placed on a [TileMap], tiles from [TileSetScenesCollectionSource] will automatically instanciate an assiciated scene at the cell's position in the TileMap.
+ Scenes are instanciated as children of the [TileMap] when it enters the tree. If you add/remove a scene tile in the [TileMap] that is already inside the tree, the [TileMap] will automatically instanciate/free the scene accordingly.
</description>
<tutorials>
</tutorials>
@@ -12,83 +15,55 @@
<argument index="0" name="packed_scene" type="PackedScene" />
<argument index="1" name="id_override" type="int" default="-1" />
<description>
- </description>
- </method>
- <method name="get_alternative_tile_id" qualifiers="const">
- <return type="int" />
- <argument index="0" name="atlas_coords" type="Vector2i" />
- <argument index="1" name="index" type="int" />
- <description>
- </description>
- </method>
- <method name="get_alternative_tiles_count" qualifiers="const">
- <return type="int" />
- <argument index="0" name="atlas_coords" type="Vector2i" />
- <description>
+ Creates a scene-based tile out of the given scene.
+ Returns a newly generated unique ID.
</description>
</method>
<method name="get_next_scene_tile_id" qualifiers="const">
<return type="int" />
<description>
+ Returns the scene ID a following call to [method create_scene_tile] would return.
</description>
</method>
<method name="get_scene_tile_display_placeholder" qualifiers="const">
<return type="bool" />
<argument index="0" name="id" type="int" />
<description>
+ Returns whether the scene tile with id [code]id[/code] displays a placeholder in the editor.
</description>
</method>
<method name="get_scene_tile_id">
<return type="int" />
<argument index="0" name="index" type="int" />
<description>
+ Returns the scene tile ID of the scene tile at index [code]index[/code].
</description>
</method>
<method name="get_scene_tile_scene" qualifiers="const">
<return type="PackedScene" />
<argument index="0" name="id" type="int" />
<description>
+ Returns the [PackedScene] resource of scene tile with id [code]id[/code].
</description>
</method>
<method name="get_scene_tiles_count">
<return type="int" />
<description>
- </description>
- </method>
- <method name="get_tile_id" qualifiers="const">
- <return type="Vector2i" />
- <argument index="0" name="index" type="int" />
- <description>
- </description>
- </method>
- <method name="get_tiles_count" qualifiers="const">
- <return type="int" />
- <description>
- </description>
- </method>
- <method name="has_alternative_tile" qualifiers="const">
- <return type="bool" />
- <argument index="0" name="atlas_coords" type="Vector2i" />
- <argument index="1" name="alternative_tile" type="int" />
- <description>
+ Returns the number or scene tiles this TileSet source has.
</description>
</method>
<method name="has_scene_tile_id">
<return type="bool" />
<argument index="0" name="id" type="int" />
<description>
- </description>
- </method>
- <method name="has_tile" qualifiers="const">
- <return type="bool" />
- <argument index="0" name="atlas_coords" type="Vector2i" />
- <description>
+ Returns whether this TileSet source has a scene tile with id [code]id[/code].
</description>
</method>
<method name="remove_scene_tile">
<return type="void" />
<argument index="0" name="id" type="int" />
<description>
+ Remove the scene tile with id [code]id[/code].
</description>
</method>
<method name="set_scene_tile_display_placeholder">
@@ -96,6 +71,7 @@
<argument index="0" name="id" type="int" />
<argument index="1" name="display_placeholder" type="bool" />
<description>
+ Sets whether or not the scene tile with id [code]id[/code] should display a placeholder in the editor. This might be useful for scenes that are not visible.
</description>
</method>
<method name="set_scene_tile_id">
@@ -103,6 +79,7 @@
<argument index="0" name="id" type="int" />
<argument index="1" name="new_id" type="int" />
<description>
+ Changes a scene tile's ID from [code]id[/code] to [code]new_id[/code]. This will fail if there is already a tile with a ID equal to [code]new_id[/code].
</description>
</method>
<method name="set_scene_tile_scene">
@@ -110,6 +87,7 @@
<argument index="0" name="id" type="int" />
<argument index="1" name="packed_scene" type="PackedScene" />
<description>
+ Assigns a [PackedScene] resource to the scene tile with id [code]id[/code]. This will fail if the scene does not extend CanvasItem, as positionning properties are needed to place the scene on the TileMap.
</description>
</method>
</methods>
diff --git a/doc/classes/TileSetSource.xml b/doc/classes/TileSetSource.xml
index 6a3029bb3f..442d845f6c 100644
--- a/doc/classes/TileSetSource.xml
+++ b/doc/classes/TileSetSource.xml
@@ -1,12 +1,63 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="TileSetSource" inherits="Resource" version="4.0">
<brief_description>
+ Exposes a set of tiles for a [TileSet] resource.
</brief_description>
<description>
+ Exposes a set of tiles for a [TileSet] resource.
+ Tiles in a source are indexed with two IDs, coordinates ID (of type Vector2i) and an alternative ID (of type int), named according to their use in the [TileSetAtlasSource] class.
+ Depending on the TileSet source type, those IDs might have restrictions on their values, this is why the base [TileSetSource] class only exposes getters for them.
+
+ You can iterate over all tiles exposed by a TileSetSource by first iterating over coordinates IDs using [method get_tiles_count] and [method get_tile_id], then over alternative IDs using [method get_alternative_tiles_count] and [method get_alternative_tile_id].
</description>
<tutorials>
</tutorials>
<methods>
+ <method name="get_alternative_tile_id" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="atlas_coords" type="Vector2i" />
+ <argument index="1" name="index" type="int" />
+ <description>
+ Returns the alternative ID for the tile with coordinates ID [code]atlas_coords[/code] at index [code]index[/code].
+ </description>
+ </method>
+ <method name="get_alternative_tiles_count" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="atlas_coords" type="Vector2i" />
+ <description>
+ Returns the number of alternatives tiles for the coordinates ID [code]atlas_coords[/code].
+ For [TileSetAtlasSource], this always return at least 1, as the base tile with ID 0 is always part of the alternatives list.
+ Returns -1 if there is not tile at the given coords.
+ </description>
+ </method>
+ <method name="get_tile_id" qualifiers="const">
+ <return type="Vector2i" />
+ <argument index="0" name="index" type="int" />
+ <description>
+ Returns the tile coordinates ID of the tile with index [code]index[/code].
+ </description>
+ </method>
+ <method name="get_tiles_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns how many tiles this atlas source defines (not including alternative tiles).
+ </description>
+ </method>
+ <method name="has_alternative_tile" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="atlas_coords" type="Vector2i" />
+ <argument index="1" name="alternative_tile" type="int" />
+ <description>
+ Returns if the base tile at coordinates [code]atlas_coords[/code] has an alternative with ID [code]alternative_tile[/code].
+ </description>
+ </method>
+ <method name="has_tile" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="atlas_coords" type="Vector2i" />
+ <description>
+ Returns if this atlas has a tile with coordinates ID [code]atlas_coordinates[/code].
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml
index 029848be33..a002166664 100644
--- a/doc/classes/TranslationServer.xml
+++ b/doc/classes/TranslationServer.xml
@@ -27,13 +27,14 @@
<method name="get_loaded_locales" qualifiers="const">
<return type="Array" />
<description>
- Returns an Array of all loaded locales of the game.
+ Returns an array of all loaded locales of the project.
</description>
</method>
<method name="get_locale" qualifiers="const">
<return type="String" />
<description>
- Returns the current locale of the game.
+ Returns the current locale of the project.
+ See also [method OS.get_locale] and [method OS.get_locale_language] to query the locale of the user system.
</description>
</method>
<method name="get_locale_name" qualifiers="const">
@@ -75,7 +76,8 @@
<return type="void" />
<argument index="0" name="locale" type="String" />
<description>
- Sets the locale of the game.
+ Sets the locale of the project. The [code]locale[/code] string will be standardized to match known locales (e.g. [code]en-US[/code] would be matched to [code]en_US[/code]).
+ If translations have been loaded beforehand for the new locale, they will be applied.
</description>
</method>
<method name="translate" qualifiers="const">
diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml
index 372a6e7ebf..ede6e2fdd5 100644
--- a/doc/classes/Tween.xml
+++ b/doc/classes/Tween.xml
@@ -58,8 +58,8 @@
[codeblock]
var tween = create_tween().set_parallel(true)
tween.tween_property(...)
- tween.tween_property(...) #will run parallelly with above
- tween.chain().tween_property(...) #will run after two above are finished
+ tween.tween_property(...) # Will run parallelly with above.
+ tween.chain().tween_property(...) # Will run after two above are finished.
[/codeblock]
</description>
</method>
@@ -215,11 +215,9 @@
Creates and appends an [IntervalTweener]. This method can be used to create delays in the tween animation, as an alternative for using the delay in other [Tweener]s or when there's no animation (in which case the [Tween] acts as a timer). [code]time[/code] is the length of the interval, in seconds.
Example: creating an interval in code execution.
[codeblock]
- #... some code
- var tween = create_tween()
- tween.tween_interval(2)
- await tween.finished
- #... more code
+ # ... some code
+ await create_tween().tween_interval(2).finished
+ # ... more code
[/codeblock]
Example: creating an object that moves back and forth and jumps every few seconds.
[codeblock]
@@ -236,15 +234,15 @@
<method name="tween_method">
<return type="MethodTweener" />
<argument index="0" name="method" type="Callable" />
- <argument index="1" name="from" type="float" />
- <argument index="2" name="to" type="float" />
+ <argument index="1" name="from" type="Variant" />
+ <argument index="2" name="to" type="Variant" />
<argument index="3" name="duration" type="float" />
<description>
Creates and appends a [MethodTweener]. This method is similar to a combination of [method tween_callback] and [method tween_property]. It calls a method over time with a tweened value provided as an argument. The value is tweened between [code]from[/code] and [code]to[/code] over the time specified by [code]duration[/code], in seconds. Use [method Callable.bind] to bind additional arguments for the call. You can use [method MethodTweener.set_ease] and [method MethodTweener.set_trans] to tweak the easing and transition of the value or [method MethodTweener.set_delay] to delay the tweening.
Example: making a 3D object look from one point to another point.
[codeblock]
var tween = create_tween()
- tween.tween_method(look_at.bind(Vector3.UP), Vector3(-1, 0, -1), Vector3(1, 0, -1), 1) #the look_at() method takes up vector as second argument
+ tween.tween_method(look_at.bind(Vector3.UP), Vector3(-1, 0, -1), Vector3(1, 0, -1), 1) # The look_at() method takes up vector as second argument.
[/codeblock]
Example: setting a text of a [Label], using an intermediate method and after a delay.
[codeblock]
diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml
index 98a0aea0c7..519cc9c137 100644
--- a/doc/classes/VScrollBar.xml
+++ b/doc/classes/VScrollBar.xml
@@ -23,6 +23,9 @@
<theme_item name="decrement_highlight" data_type="icon" type="Texture2D">
Displayed when the mouse cursor hovers over the decrement button.
</theme_item>
+ <theme_item name="decrement_pressed" data_type="icon" type="Texture2D">
+ Displayed when the decrement button is being pressed.
+ </theme_item>
<theme_item name="grabber" data_type="style" type="StyleBox">
Used as texture for the grabber, the draggable element representing current scroll.
</theme_item>
@@ -38,6 +41,9 @@
<theme_item name="increment_highlight" data_type="icon" type="Texture2D">
Displayed when the mouse cursor hovers over the increment button.
</theme_item>
+ <theme_item name="increment_pressed" data_type="icon" type="Texture2D">
+ Displayed when the increment button is being pressed.
+ </theme_item>
<theme_item name="scroll" data_type="style" type="StyleBox">
Used as background of this [ScrollBar].
</theme_item>
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index ab4d0e181a..e61f1fe951 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -56,6 +56,7 @@
<description>
Returns this vector's angle with respect to the positive X axis, or [code](1, 0)[/code] vector, in radians.
For example, [code]Vector2.RIGHT.angle()[/code] will return zero, [code]Vector2.DOWN.angle()[/code] will return [code]PI / 2[/code] (a quarter turn, or 90 degrees), and [code]Vector2(1, -1).angle()[/code] will return [code]-PI / 4[/code] (a negative eighth turn, or -45 degrees).
+ [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/vector2_angle.png]Illustration of the returned angle.[/url]
Equivalent to the result of [method @GlobalScope.atan2] when called with the vector's [member y] and [member x] as parameters: [code]atan2(y, x)[/code].
</description>
</method>
@@ -64,6 +65,7 @@
<argument index="0" name="to" type="Vector2" />
<description>
Returns the angle to the given vector, in radians.
+ [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/vector2_angle_to.png]Illustration of the returned angle.[/url]
</description>
</method>
<method name="angle_to_point" qualifiers="const">
@@ -71,6 +73,7 @@
<argument index="0" name="to" type="Vector2" />
<description>
Returns the angle between the line connecting the two points and the X axis, in radians.
+ [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/vector2_angle_to_point.png]Illustration of the returned angle.[/url]
</description>
</method>
<method name="aspect" qualifiers="const">
diff --git a/doc/classes/VehicleBody3D.xml b/doc/classes/VehicleBody3D.xml
index 90d0591949..21a37f7b53 100644
--- a/doc/classes/VehicleBody3D.xml
+++ b/doc/classes/VehicleBody3D.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="VehicleBody3D" inherits="RigidBody3D" version="4.0">
+<class name="VehicleBody3D" inherits="RigidDynamicBody3D" version="4.0">
<brief_description>
Physics body that simulates the behavior of a car.
</brief_description>
@@ -15,10 +15,10 @@
</methods>
<members>
<member name="brake" type="float" setter="set_brake" getter="get_brake" default="0.0">
- Slows down the vehicle by applying a braking force. The vehicle is only slowed down if the wheels are in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [member RigidBody3D.mass] of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking.
+ Slows down the vehicle by applying a braking force. The vehicle is only slowed down if the wheels are in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [member RigidDynamicBody3D.mass] of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking.
</member>
<member name="engine_force" type="float" setter="set_engine_force" getter="get_engine_force" default="0.0">
- Accelerates the vehicle by applying an engine force. The vehicle is only speed up if the wheels that have [member VehicleWheel3D.use_as_traction] set to [code]true[/code] and are in contact with a surface. The [member RigidBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration.
+ Accelerates the vehicle by applying an engine force. The vehicle is only speed up if the wheels that have [member VehicleWheel3D.use_as_traction] set to [code]true[/code] and are in contact with a surface. The [member RigidDynamicBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration.
[b]Note:[/b] The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears.
A negative value will result in the vehicle reversing.
</member>
diff --git a/doc/classes/VehicleWheel3D.xml b/doc/classes/VehicleWheel3D.xml
index 35f1189a06..5b4511beab 100644
--- a/doc/classes/VehicleWheel3D.xml
+++ b/doc/classes/VehicleWheel3D.xml
@@ -32,7 +32,7 @@
</methods>
<members>
<member name="brake" type="float" setter="set_brake" getter="get_brake" default="0.0">
- Slows down the wheel by applying a braking force. The wheel is only slowed down if it is in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [member RigidBody3D.mass] of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking.
+ Slows down the wheel by applying a braking force. The wheel is only slowed down if it is in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [member RigidDynamicBody3D.mass] of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking.
</member>
<member name="damping_compression" type="float" setter="set_damping_compression" getter="get_damping_compression" default="0.83">
The damping applied to the spring when the spring is being compressed. This value should be between 0.0 (no damping) and 1.0. A value of 0.0 means the car will keep bouncing as the spring keeps its energy. A good value for this is around 0.3 for a normal car, 0.5 for a race car.
@@ -41,7 +41,7 @@
The damping applied to the spring when relaxing. This value should be between 0.0 (no damping) and 1.0. This value should always be slightly higher than the [member damping_compression] property. For a [member damping_compression] value of 0.3, try a relaxation value of 0.5.
</member>
<member name="engine_force" type="float" setter="set_engine_force" getter="get_engine_force" default="0.0">
- Accelerates the wheel by applying an engine force. The wheel is only speed up if it is in contact with a surface. The [member RigidBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration.
+ Accelerates the wheel by applying an engine force. The wheel is only speed up if it is in contact with a surface. The [member RigidDynamicBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration.
[b]Note:[/b] The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears.
A negative value will result in the wheel reversing.
</member>
@@ -49,7 +49,7 @@
The steering angle for the wheel. Setting this to a non-zero value will result in the vehicle turning when it's moving.
</member>
<member name="suspension_max_force" type="float" setter="set_suspension_max_force" getter="get_suspension_max_force" default="6000.0">
- The maximum force the spring can resist. This value should be higher than a quarter of the [member RigidBody3D.mass] of the [VehicleBody3D] or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3× to 4× this number.
+ The maximum force the spring can resist. This value should be higher than a quarter of the [member RigidDynamicBody3D.mass] of the [VehicleBody3D] or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3× to 4× this number.
</member>
<member name="suspension_stiffness" type="float" setter="set_suspension_stiffness" getter="get_suspension_stiffness" default="5.88">
This value defines the stiffness of the suspension. Use a value lower than 50 for an off-road car, a value between 50 and 100 for a race car and try something around 200 for something like a Formula 1 car.
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 46f38e91f7..06a7177bfc 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -134,6 +134,7 @@
<return type="void" />
<argument index="0" name="text" type="String" />
<description>
+ Returns [code]true[/code] if the viewport is currently embedding windows.
</description>
</method>
<method name="push_unhandled_input">
@@ -320,10 +321,7 @@
<constant name="MSAA_8X" value="3" enum="MSAA">
Use 8× Multisample Antialiasing. This has a very high performance cost. The difference between 4× and 8× MSAA may not always be visible in real gameplay conditions. Likely unsupported on low-end and older hardware.
</constant>
- <constant name="MSAA_16X" value="4" enum="MSAA">
- Use 16× Multisample Antialiasing. This has a very high performance cost. The difference between 8× and 16× MSAA may not always be visible in real gameplay conditions. Likely unsupported on medium and low-end hardware.
- </constant>
- <constant name="MSAA_MAX" value="5" enum="MSAA">
+ <constant name="MSAA_MAX" value="4" enum="MSAA">
Represents the size of the [enum MSAA] enum.
</constant>
<constant name="SCREEN_SPACE_AA_DISABLED" value="0" enum="ScreenSpaceAA">
diff --git a/doc/classes/VisibleOnScreenEnabler3D.xml b/doc/classes/VisibleOnScreenEnabler3D.xml
index 3205d6b415..f781ef9749 100644
--- a/doc/classes/VisibleOnScreenEnabler3D.xml
+++ b/doc/classes/VisibleOnScreenEnabler3D.xml
@@ -4,7 +4,7 @@
Enables certain nodes only when approximately visible.
</brief_description>
<description>
- The VisibleOnScreenEnabler3D will disable [RigidBody3D] and [AnimationPlayer] nodes when they are not visible. It will only affect other nodes within the same scene as the VisibleOnScreenEnabler3D itself.
+ The VisibleOnScreenEnabler3D will disable [RigidDynamicBody3D] and [AnimationPlayer] nodes when they are not visible. It will only affect other nodes within the same scene as the VisibleOnScreenEnabler3D itself.
If you just want to receive notifications, use [VisibleOnScreenNotifier3D] instead.
[b]Note:[/b] VisibleOnScreenEnabler3D uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account. The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area3D] node as a child of a [Camera3D] node and/or [method Vector3.dot].
[b]Note:[/b] VisibleOnScreenEnabler3D will not affect nodes added after scene initialization.
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index d7b156cc57..15d844aacb 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Window" inherits="Viewport" version="4.0">
<brief_description>
+ Base class for all windows.
</brief_description>
<description>
+ A node that creates a window.
</description>
<tutorials>
</tutorials>
@@ -10,6 +12,7 @@
<method name="can_draw" qualifiers="const">
<return type="bool" />
<description>
+ Returns whether the window is being drawn to the screen.
</description>
</method>
<method name="child_controls_changed">
@@ -27,6 +30,7 @@
<return type="bool" />
<argument index="0" name="flag" type="int" enum="Window.Flags" />
<description>
+ Returns [code]true[/code] if the flag is set.
</description>
</method>
<method name="get_layout_direction" qualifiers="const">
@@ -38,6 +42,7 @@
<method name="get_real_size" qualifiers="const">
<return type="Vector2i" />
<description>
+ Returns the window's size including its border.
</description>
</method>
<method name="get_theme_color" qualifiers="const">
@@ -87,11 +92,13 @@
<method name="grab_focus">
<return type="void" />
<description>
+ Causes the window to grab focus, allowing it to receive user input.
</description>
</method>
<method name="has_focus" qualifiers="const">
<return type="bool" />
<description>
+ Returns [code]true[/code] if the window is focused.
</description>
</method>
<method name="has_theme_color" qualifiers="const">
@@ -148,6 +155,7 @@
<method name="is_embedded" qualifiers="const">
<return type="bool" />
<description>
+ Returns [code]true[/code] if the window is currently embedded in another window.
</description>
</method>
<method name="is_layout_rtl" qualifiers="const">
@@ -212,6 +220,7 @@
<argument index="0" name="flag" type="int" enum="Window.Flags" />
<argument index="1" name="enabled" type="bool" />
<description>
+ Sets a specified window flag.
</description>
</method>
<method name="set_ime_active">
@@ -247,11 +256,13 @@
</methods>
<members>
<member name="always_on_top" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], the window will be on top of all other windows.
</member>
<member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" default="true">
Toggles if any text should automatically change to its translated version depending on the current locale.
</member>
<member name="borderless" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], the window will have no borders.
</member>
<member name="content_scale_aspect" type="int" setter="set_content_scale_aspect" getter="get_content_scale_aspect" enum="Window.ContentScaleAspect" default="0">
</member>
@@ -260,6 +271,7 @@
<member name="content_scale_size" type="Vector2i" setter="set_content_scale_size" getter="get_content_scale_size" default="Vector2i(0, 0)">
</member>
<member name="current_screen" type="int" setter="set_current_screen" getter="get_current_screen" default="0">
+ The screen the window is currently on.
</member>
<member name="exclusive" type="bool" setter="set_exclusive" getter="is_exclusive" default="false">
</member>
@@ -268,16 +280,21 @@
<member name="min_size" type="Vector2i" setter="set_min_size" getter="get_min_size" default="Vector2i(0, 0)">
</member>
<member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Window.Mode" default="0">
+ Set's the window's current mode.
+ [b]Note:[/b] Fullscreen mode is not exclusive fullscreen on Windows and Linux.
</member>
<member name="position" type="Vector2i" setter="set_position" getter="get_position" default="Vector2i(0, 0)">
+ The window's position in pixels.
</member>
<member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(100, 100)">
+ The window's size in pixels.
</member>
<member name="theme" type="Theme" setter="set_theme" getter="get_theme">
</member>
<member name="theme_type_variation" type="StringName" setter="set_theme_type_variation" getter="get_theme_type_variation" default="&amp;&quot;&quot;">
</member>
<member name="title" type="String" setter="set_title" getter="get_title" default="&quot;&quot;">
+ The window's title.
</member>
<member name="transient" type="bool" setter="set_transient" getter="is_transient" default="false">
</member>
@@ -286,8 +303,10 @@
<member name="unfocusable" type="bool" setter="set_flag" getter="get_flag" default="false">
</member>
<member name="unresizable" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], the window can't be resized.
</member>
<member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true">
+ If [code]true[/code], the window is visible.
</member>
<member name="wrap_controls" type="bool" setter="set_wrap_controls" getter="is_wrapping_controls" default="false">
</member>
@@ -340,20 +359,26 @@
<constant name="NOTIFICATION_VISIBILITY_CHANGED" value="30">
</constant>
<constant name="MODE_WINDOWED" value="0" enum="Mode">
+ Windowed mode.
</constant>
<constant name="MODE_MINIMIZED" value="1" enum="Mode">
+ Minimized window mode.
</constant>
<constant name="MODE_MAXIMIZED" value="2" enum="Mode">
+ Maximized window mode.
</constant>
<constant name="MODE_FULLSCREEN" value="3" enum="Mode">
Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
</constant>
<constant name="FLAG_RESIZE_DISABLED" value="0" enum="Flags">
+ The window's ability to be resized.
</constant>
<constant name="FLAG_BORDERLESS" value="1" enum="Flags">
+ Borderless window.
</constant>
<constant name="FLAG_ALWAYS_ON_TOP" value="2" enum="Flags">
+ Flag for making the window always on top of all other windows.
</constant>
<constant name="FLAG_TRANSPARENT" value="3" enum="Flags">
</constant>
diff --git a/doc/classes/WorldMarginShape2D.xml b/doc/classes/WorldBoundaryShape2D.xml
index 1839ab16ad..190f289601 100644
--- a/doc/classes/WorldMarginShape2D.xml
+++ b/doc/classes/WorldBoundaryShape2D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="WorldMarginShape2D" inherits="Shape2D" version="4.0">
+<class name="WorldBoundaryShape2D" inherits="Shape2D" version="4.0">
<brief_description>
- Line shape for 2D collisions.
+ World boundary shape for 2D collisions.
</brief_description>
<description>
- Line shape for 2D collisions. It works like a 2D plane and will not allow any physics body to go to the negative side. Not recommended for rigid bodies, and usually not recommended for static bodies either because it forces checks against it on every frame.
+ World boundary shape for 2D collisions. It works like a 2D plane and will not allow any physics body to go to the negative side. Not recommended for rigid bodies, and usually not recommended for static bodies either because it forces checks against it on every frame.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/WorldBoundaryShape3D.xml b/doc/classes/WorldBoundaryShape3D.xml
new file mode 100644
index 0000000000..837b023a58
--- /dev/null
+++ b/doc/classes/WorldBoundaryShape3D.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="WorldBoundaryShape3D" inherits="Shape3D" version="4.0">
+ <brief_description>
+ World boundary shape for 3D collisions.
+ </brief_description>
+ <description>
+ World boundary shape for 3D collisions. It works like an infinite plane and will not allow any physics body to go to the negative side. Note that the [Plane]'s normal matters; anything "below" the plane will collide with it. If the [WorldBoundaryShape3D] is used in a [PhysicsBody3D], it will cause colliding objects placed "below" it to teleport "above" the plane.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="plane" type="Plane" setter="set_plane" getter="get_plane" default="Plane(0, 1, 0, 0)">
+ The [Plane] used by the [WorldBoundaryShape3D] for collision.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/WorldMarginShape3D.xml b/doc/classes/WorldMarginShape3D.xml
deleted file mode 100644
index 9a26f254f1..0000000000
--- a/doc/classes/WorldMarginShape3D.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="WorldMarginShape3D" inherits="Shape3D" version="4.0">
- <brief_description>
- Infinite plane shape for 3D collisions.
- </brief_description>
- <description>
- An infinite plane shape for 3D collisions. Note that the [Plane]'s normal matters; anything "below" the plane will collide with it. If the [WorldMarginShape3D] is used in a [PhysicsBody3D], it will cause colliding objects placed "below" it to teleport "above" the plane.
- </description>
- <tutorials>
- </tutorials>
- <methods>
- </methods>
- <members>
- <member name="plane" type="Plane" setter="set_plane" getter="get_plane" default="Plane(0, 1, 0, 0)">
- The [Plane] used by the [WorldMarginShape3D] for collision.
- </member>
- </members>
- <constants>
- </constants>
-</class>
diff --git a/doc/classes/XRInterfaceExtension.xml b/doc/classes/XRInterfaceExtension.xml
index 46d8d7e4e8..fb79926043 100644
--- a/doc/classes/XRInterfaceExtension.xml
+++ b/doc/classes/XRInterfaceExtension.xml
@@ -11,8 +11,8 @@
<methods>
<method name="_commit_views" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="" type="RID" />
- <argument index="1" name="" type="Rect2" />
+ <argument index="0" name="render_target" type="RID" />
+ <argument index="1" name="screen_rect" type="Rect2" />
<description>
</description>
</method>
@@ -107,19 +107,26 @@
<method name="add_blit">
<return type="void" />
<argument index="0" name="render_target" type="RID" />
- <argument index="1" name="rect" type="Rect2i" />
- <argument index="2" name="use_layer" type="bool" />
- <argument index="3" name="layer" type="int" />
- <argument index="4" name="apply_lens_distortion" type="bool" />
- <argument index="5" name="eye_center" type="Vector2" />
- <argument index="6" name="k1" type="float" />
- <argument index="7" name="k2" type="float" />
- <argument index="8" name="upscale" type="float" />
- <argument index="9" name="aspect_ratio" type="float" />
+ <argument index="1" name="src_rect" type="Rect2" />
+ <argument index="2" name="dst_rect" type="Rect2i" />
+ <argument index="3" name="use_layer" type="bool" />
+ <argument index="4" name="layer" type="int" />
+ <argument index="5" name="apply_lens_distortion" type="bool" />
+ <argument index="6" name="eye_center" type="Vector2" />
+ <argument index="7" name="k1" type="float" />
+ <argument index="8" name="k2" type="float" />
+ <argument index="9" name="upscale" type="float" />
+ <argument index="10" name="aspect_ratio" type="float" />
<description>
Blits our render results to screen optionally applying lens distortion. This can only be called while processing [code]_commit_views[/code].
</description>
</method>
+ <method name="get_render_target_texture">
+ <return type="RID" />
+ <argument index="0" name="render_target" type="RID" />
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>