summaryrefslogtreecommitdiffstats
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/@GlobalScope.xml55
-rw-r--r--doc/classes/AABB.xml8
-rw-r--r--doc/classes/AStar2D.xml10
-rw-r--r--doc/classes/AStar3D.xml8
-rw-r--r--doc/classes/AStarGrid2D.xml11
-rw-r--r--doc/classes/AnimatedSprite2D.xml6
-rw-r--r--doc/classes/AnimatedSprite3D.xml6
-rw-r--r--doc/classes/Animation.xml84
-rw-r--r--doc/classes/AnimationMixer.xml32
-rw-r--r--doc/classes/AnimationNode.xml2
-rw-r--r--doc/classes/AnimationNodeAnimation.xml1
-rw-r--r--doc/classes/AnimationNodeBlendSpace2D.xml4
-rw-r--r--doc/classes/AnimationNodeStateMachine.xml1
-rw-r--r--doc/classes/AnimationNodeStateMachinePlayback.xml1
-rw-r--r--doc/classes/AnimationNodeStateMachineTransition.xml4
-rw-r--r--doc/classes/AnimationPlayer.xml91
-rw-r--r--doc/classes/Area2D.xml4
-rw-r--r--doc/classes/Area3D.xml4
-rw-r--r--doc/classes/Array.xml596
-rw-r--r--doc/classes/ArrayMesh.xml3
-rw-r--r--doc/classes/AtlasTexture.xml4
-rw-r--r--doc/classes/AudioEffectFilter.xml5
-rw-r--r--doc/classes/AudioEffectSpectrumAnalyzer.xml1
-rw-r--r--doc/classes/AudioEffectSpectrumAnalyzerInstance.xml10
-rw-r--r--doc/classes/AudioEffectStereoEnhance.xml4
-rw-r--r--doc/classes/AudioServer.xml12
-rw-r--r--doc/classes/AudioStreamPlayback.xml48
-rw-r--r--doc/classes/AudioStreamPlaybackPolyphonic.xml2
-rw-r--r--doc/classes/AudioStreamPlayer.xml4
-rw-r--r--doc/classes/AudioStreamPlayer2D.xml2
-rw-r--r--doc/classes/AudioStreamPlayer3D.xml2
-rw-r--r--doc/classes/AudioStreamWAV.xml19
-rw-r--r--doc/classes/BackBufferCopy.xml1
-rw-r--r--doc/classes/BaseButton.xml3
-rw-r--r--doc/classes/BaseMaterial3D.xml3
-rw-r--r--doc/classes/Basis.xml5
-rw-r--r--doc/classes/BoneAttachment3D.xml6
-rw-r--r--doc/classes/Button.xml11
-rw-r--r--doc/classes/CPUParticles2D.xml2
-rw-r--r--doc/classes/CPUParticles3D.xml10
-rw-r--r--doc/classes/Callable.xml23
-rw-r--r--doc/classes/CallbackTweener.xml4
-rw-r--r--doc/classes/CameraAttributes.xml4
-rw-r--r--doc/classes/CameraAttributesPhysical.xml2
-rw-r--r--doc/classes/CameraFeed.xml72
-rw-r--r--doc/classes/CameraServer.xml2
-rw-r--r--doc/classes/CanvasItem.xml27
-rw-r--r--doc/classes/CanvasModulate.xml1
-rw-r--r--doc/classes/CharFXTransform.xml1
-rw-r--r--doc/classes/CharacterBody2D.xml2
-rw-r--r--doc/classes/ClassDB.xml48
-rw-r--r--doc/classes/CodeEdit.xml3
-rw-r--r--doc/classes/Color.xml13
-rw-r--r--doc/classes/Compositor.xml1
-rw-r--r--doc/classes/CompositorEffect.xml16
-rw-r--r--doc/classes/Control.xml70
-rw-r--r--doc/classes/Cubemap.xml23
-rw-r--r--doc/classes/Curve2D.xml2
-rw-r--r--doc/classes/Dictionary.xml110
-rw-r--r--doc/classes/DirAccess.xml1
-rw-r--r--doc/classes/DisplayServer.xml73
-rw-r--r--doc/classes/EditorContextMenuPlugin.xml95
-rw-r--r--doc/classes/EditorDebuggerPlugin.xml32
-rw-r--r--doc/classes/EditorDebuggerSession.xml2
-rw-r--r--doc/classes/EditorExportPlatform.xml248
-rw-r--r--doc/classes/EditorExportPlatformExtension.xml310
-rw-r--r--doc/classes/EditorExportPlugin.xml43
-rw-r--r--doc/classes/EditorExportPreset.xml192
-rw-r--r--doc/classes/EditorFeatureProfile.xml5
-rw-r--r--doc/classes/EditorFileSystem.xml6
-rw-r--r--doc/classes/EditorFileSystemImportFormatSupportQuery.xml2
-rw-r--r--doc/classes/EditorImportPlugin.xml13
-rw-r--r--doc/classes/EditorInspector.xml1
-rw-r--r--doc/classes/EditorInterface.xml38
-rw-r--r--doc/classes/EditorNode3DGizmoPlugin.xml2
-rw-r--r--doc/classes/EditorPlugin.xml48
-rw-r--r--doc/classes/EditorProperty.xml7
-rw-r--r--doc/classes/EditorResourcePreview.xml4
-rw-r--r--doc/classes/EditorResourcePreviewGenerator.xml6
-rw-r--r--doc/classes/EditorScenePostImport.xml2
-rw-r--r--doc/classes/EditorScenePostImportPlugin.xml6
-rw-r--r--doc/classes/EditorScript.xml2
-rw-r--r--doc/classes/EditorSettings.xml307
-rw-r--r--doc/classes/EditorSpinSlider.xml8
-rw-r--r--doc/classes/EditorToaster.xml34
-rw-r--r--doc/classes/EditorTranslationParserPlugin.xml3
-rw-r--r--doc/classes/EditorUndoRedoManager.xml24
-rw-r--r--doc/classes/Engine.xml4
-rw-r--r--doc/classes/EngineDebugger.xml5
-rw-r--r--doc/classes/Environment.xml8
-rw-r--r--doc/classes/ExternalTexture.xml36
-rw-r--r--doc/classes/FileAccess.xml6
-rw-r--r--doc/classes/FileDialog.xml35
-rw-r--r--doc/classes/Font.xml2
-rw-r--r--doc/classes/FontFile.xml2
-rw-r--r--doc/classes/FontVariation.xml4
-rw-r--r--doc/classes/GDExtensionManager.xml14
-rw-r--r--doc/classes/GPUParticles2D.xml2
-rw-r--r--doc/classes/GPUParticles3D.xml4
-rw-r--r--doc/classes/GPUParticlesCollision3D.xml4
-rw-r--r--doc/classes/Geometry2D.xml44
-rw-r--r--doc/classes/GraphEdit.xml6
-rw-r--r--doc/classes/GraphNode.xml2
-rw-r--r--doc/classes/HTTPClient.xml11
-rw-r--r--doc/classes/HTTPRequest.xml8
-rw-r--r--doc/classes/HashingContext.xml10
-rw-r--r--doc/classes/Image.xml15
-rw-r--r--doc/classes/ImporterMesh.xml7
-rw-r--r--doc/classes/Input.xml2
-rw-r--r--doc/classes/InputEvent.xml6
-rw-r--r--doc/classes/InputEventKey.xml5
-rw-r--r--doc/classes/InputEventMouseMotion.xml8
-rw-r--r--doc/classes/InputEventShortcut.xml2
-rw-r--r--doc/classes/InputMap.xml2
-rw-r--r--doc/classes/ItemList.xml34
-rw-r--r--doc/classes/JSON.xml35
-rw-r--r--doc/classes/JavaClass.xml26
-rw-r--r--doc/classes/JavaClassWrapper.xml9
-rw-r--r--doc/classes/JavaObject.xml21
-rw-r--r--doc/classes/JavaScriptBridge.xml14
-rw-r--r--doc/classes/JavaScriptObject.xml1
-rw-r--r--doc/classes/Label.xml6
-rw-r--r--doc/classes/Label3D.xml4
-rw-r--r--doc/classes/LabelSettings.xml2
-rw-r--r--doc/classes/Light3D.xml3
-rw-r--r--doc/classes/LightmapGI.xml8
-rw-r--r--doc/classes/LineEdit.xml73
-rw-r--r--doc/classes/LinkButton.xml1
-rw-r--r--doc/classes/LookAtModifier3D.xml156
-rw-r--r--doc/classes/Material.xml2
-rw-r--r--doc/classes/MenuBar.xml8
-rw-r--r--doc/classes/Mesh.xml1
-rw-r--r--doc/classes/MeshDataTool.xml3
-rw-r--r--doc/classes/MeshInstance3D.xml10
-rw-r--r--doc/classes/MultiMesh.xml31
-rw-r--r--doc/classes/MultiplayerAPI.xml2
-rw-r--r--doc/classes/MultiplayerAPIExtension.xml10
-rw-r--r--doc/classes/MultiplayerPeer.xml2
-rw-r--r--doc/classes/NavigationLink2D.xml13
-rw-r--r--doc/classes/NavigationLink3D.xml13
-rw-r--r--doc/classes/NavigationMesh.xml2
-rw-r--r--doc/classes/NavigationMeshSourceGeometryData2D.xml6
-rw-r--r--doc/classes/NavigationMeshSourceGeometryData3D.xml6
-rw-r--r--doc/classes/NavigationPolygon.xml12
-rw-r--r--doc/classes/NavigationServer2D.xml20
-rw-r--r--doc/classes/NavigationServer3D.xml51
-rw-r--r--doc/classes/Node.xml27
-rw-r--r--doc/classes/Node2D.xml27
-rw-r--r--doc/classes/Node3D.xml8
-rw-r--r--doc/classes/NodePath.xml7
-rw-r--r--doc/classes/OS.xml75
-rw-r--r--doc/classes/Object.xml88
-rw-r--r--doc/classes/OccluderInstance3D.xml2
-rw-r--r--doc/classes/OptimizedTranslation.xml1
-rw-r--r--doc/classes/PCKPacker.xml15
-rw-r--r--doc/classes/PackedByteArray.xml7
-rw-r--r--doc/classes/PackedColorArray.xml7
-rw-r--r--doc/classes/PackedFloat32Array.xml7
-rw-r--r--doc/classes/PackedFloat64Array.xml7
-rw-r--r--doc/classes/PackedInt32Array.xml7
-rw-r--r--doc/classes/PackedInt64Array.xml7
-rw-r--r--doc/classes/PackedScene.xml10
-rw-r--r--doc/classes/PackedStringArray.xml7
-rw-r--r--doc/classes/PackedVector2Array.xml9
-rw-r--r--doc/classes/PackedVector3Array.xml7
-rw-r--r--doc/classes/PackedVector4Array.xml7
-rw-r--r--doc/classes/PacketPeerUDP.xml27
-rw-r--r--doc/classes/Parallax2D.xml1
-rw-r--r--doc/classes/ParticleProcessMaterial.xml7
-rw-r--r--doc/classes/PathFollow2D.xml1
-rw-r--r--doc/classes/PathFollow3D.xml1
-rw-r--r--doc/classes/Performance.xml20
-rw-r--r--doc/classes/PhysicalBone3D.xml20
-rw-r--r--doc/classes/PhysicsPointQueryParameters2D.xml1
-rw-r--r--doc/classes/PhysicsPointQueryParameters3D.xml1
-rw-r--r--doc/classes/PhysicsRayQueryParameters2D.xml1
-rw-r--r--doc/classes/PhysicsRayQueryParameters3D.xml1
-rw-r--r--doc/classes/PhysicsServer2D.xml11
-rw-r--r--doc/classes/PhysicsServer2DExtension.xml2
-rw-r--r--doc/classes/PhysicsServer3D.xml11
-rw-r--r--doc/classes/PhysicsShapeQueryParameters2D.xml1
-rw-r--r--doc/classes/PhysicsShapeQueryParameters3D.xml1
-rw-r--r--doc/classes/Polygon2D.xml3
-rw-r--r--doc/classes/PolygonPathFinder.xml45
-rw-r--r--doc/classes/PopupMenu.xml12
-rw-r--r--doc/classes/PopupPanel.xml2
-rw-r--r--doc/classes/PortableCompressedTexture2D.xml2
-rw-r--r--doc/classes/PrimitiveMesh.xml3
-rw-r--r--doc/classes/ProjectSettings.xml195
-rw-r--r--doc/classes/Projection.xml3
-rw-r--r--doc/classes/PropertyTweener.xml10
-rw-r--r--doc/classes/Quaternion.xml1
-rw-r--r--doc/classes/RDPipelineDepthStencilState.xml8
-rw-r--r--doc/classes/RDShaderSource.xml1
-rw-r--r--doc/classes/RDTextureFormat.xml2
-rw-r--r--doc/classes/RDTextureView.xml2
-rw-r--r--doc/classes/Rect2.xml7
-rw-r--r--doc/classes/RenderData.xml2
-rw-r--r--doc/classes/RenderDataExtension.xml7
-rw-r--r--doc/classes/RenderSceneBuffersRD.xml46
-rw-r--r--doc/classes/RenderingDevice.xml164
-rw-r--r--doc/classes/RenderingServer.xml202
-rw-r--r--doc/classes/Resource.xml60
-rw-r--r--doc/classes/ResourceFormatLoader.xml1
-rw-r--r--doc/classes/ResourceImporterDynamicFont.xml5
-rw-r--r--doc/classes/ResourceImporterImageFont.xml2
-rw-r--r--doc/classes/ResourceImporterOBJ.xml16
-rw-r--r--doc/classes/ResourceImporterScene.xml3
-rw-r--r--doc/classes/ResourceImporterTexture.xml4
-rw-r--r--doc/classes/ResourceImporterWAV.xml26
-rw-r--r--doc/classes/ResourceLoader.xml21
-rw-r--r--doc/classes/ResourceSaver.xml8
-rw-r--r--doc/classes/ResourceUID.xml2
-rw-r--r--doc/classes/RichTextLabel.xml47
-rw-r--r--doc/classes/RigidBody3D.xml2
-rw-r--r--doc/classes/SceneTree.xml2
-rw-r--r--doc/classes/Script.xml7
-rw-r--r--doc/classes/ScriptEditor.xml15
-rw-r--r--doc/classes/ScriptEditorBase.xml2
-rw-r--r--doc/classes/ScriptLanguageExtension.xml7
-rw-r--r--doc/classes/ScrollContainer.xml3
-rw-r--r--doc/classes/Semaphore.xml3
-rw-r--r--doc/classes/Shader.xml14
-rw-r--r--doc/classes/ShapeCast2D.xml20
-rw-r--r--doc/classes/ShapeCast3D.xml20
-rw-r--r--doc/classes/Shortcut.xml4
-rw-r--r--doc/classes/Signal.xml12
-rw-r--r--doc/classes/Skeleton3D.xml47
-rw-r--r--doc/classes/SkeletonIK3D.xml2
-rw-r--r--doc/classes/SkeletonModification2DTwoBoneIK.xml2
-rw-r--r--doc/classes/SkeletonModifier3D.xml3
-rw-r--r--doc/classes/Slider.xml4
-rw-r--r--doc/classes/SoftBody3D.xml1
-rw-r--r--doc/classes/SpinBox.xml97
-rw-r--r--doc/classes/SplitContainer.xml59
-rw-r--r--doc/classes/SpringArm3D.xml1
-rw-r--r--doc/classes/Sprite2D.xml6
-rw-r--r--doc/classes/SpriteFrames.xml8
-rw-r--r--doc/classes/String.xml60
-rw-r--r--doc/classes/StringName.xml73
-rw-r--r--doc/classes/StyleBoxFlat.xml3
-rw-r--r--doc/classes/StyleBoxTexture.xml6
-rw-r--r--doc/classes/SurfaceTool.xml4
-rw-r--r--doc/classes/SyntaxHighlighter.xml9
-rw-r--r--doc/classes/TextEdit.xml26
-rw-r--r--doc/classes/TextMesh.xml4
-rw-r--r--doc/classes/TextParagraph.xml7
-rw-r--r--doc/classes/TextServer.xml19
-rw-r--r--doc/classes/TextServerExtension.xml8
-rw-r--r--doc/classes/Theme.xml2
-rw-r--r--doc/classes/TileData.xml57
-rw-r--r--doc/classes/TileMap.xml33
-rw-r--r--doc/classes/TileMapLayer.xml45
-rw-r--r--doc/classes/TileSet.xml21
-rw-r--r--doc/classes/TileSetScenesCollectionSource.xml26
-rw-r--r--doc/classes/Timer.xml3
-rw-r--r--doc/classes/TouchScreenButton.xml2
-rw-r--r--doc/classes/Transform2D.xml134
-rw-r--r--doc/classes/Transform3D.xml5
-rw-r--r--doc/classes/TranslationDomain.xml105
-rw-r--r--doc/classes/TranslationServer.xml45
-rw-r--r--doc/classes/Tree.xml15
-rw-r--r--doc/classes/TreeItem.xml47
-rw-r--r--doc/classes/Tween.xml38
-rw-r--r--doc/classes/Tweener.xml2
-rw-r--r--doc/classes/Vector4i.xml2
-rw-r--r--doc/classes/VehicleWheel3D.xml18
-rw-r--r--doc/classes/VideoStreamPlayback.xml6
-rw-r--r--doc/classes/Viewport.xml43
-rw-r--r--doc/classes/ViewportTexture.xml5
-rw-r--r--doc/classes/VisibleOnScreenNotifier2D.xml2
-rw-r--r--doc/classes/VisibleOnScreenNotifier3D.xml2
-rw-r--r--doc/classes/VisualShaderNodeCompare.xml4
-rw-r--r--doc/classes/VisualShaderNodeCubemap.xml2
-rw-r--r--doc/classes/VisualShaderNodeIntParameter.xml8
-rw-r--r--doc/classes/VisualShaderNodeRemap.xml30
-rw-r--r--doc/classes/VisualShaderNodeTexture2DArray.xml2
-rw-r--r--doc/classes/Window.xml32
-rw-r--r--doc/classes/XRCamera3D.xml2
-rw-r--r--doc/classes/XRController3D.xml4
-rw-r--r--doc/classes/XRHandTracker.xml5
-rw-r--r--doc/classes/XRInterface.xml4
-rw-r--r--doc/classes/XRNode3D.xml6
-rw-r--r--doc/classes/XRPose.xml10
284 files changed, 5497 insertions, 1043 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index bcab80ea94..ce64bcc17c 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -6,7 +6,7 @@
<description>
A list of global scope enumerated constants and built-in functions. This is all that resides in the globals, constants regarding error codes, keycodes, property hints, etc.
Singletons are also documented here, since they can be accessed from anywhere.
- For the entries related to GDScript which can be accessed in any script see [@GDScript].
+ For the entries that can only be accessed from scripts written in GDScript, see [@GDScript].
</description>
<tutorials>
<link title="Random number generation">$DOCS_URL/tutorials/math/random_number_generation.html</link>
@@ -90,7 +90,7 @@
<param index="0" name="from" type="float" />
<param index="1" name="to" type="float" />
<description>
- Returns the difference between the two angles, in the range of [code][-PI, +PI][/code]. When [param from] and [param to] are opposite, returns [code]-PI[/code] if [param from] is smaller than [param to], or [code]PI[/code] otherwise.
+ Returns the difference between the two angles (in radians), in the range of [code][-PI, +PI][/code]. When [param from] and [param to] are opposite, returns [code]-PI[/code] if [param from] is smaller than [param to], or [code]PI[/code] otherwise.
</description>
</method>
<method name="asin">
@@ -621,13 +621,13 @@
<param index="1" name="to" type="Variant" />
<param index="2" name="weight" type="Variant" />
<description>
- Linearly interpolates between two values by the factor defined in [param weight]. To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method clamp] on the result of this function.
- Both [param from] and [param to] must be the same type. Supported types: [int], [float], [Vector2], [Vector3], [Vector4], [Color], [Quaternion], [Basis].
+ Linearly interpolates between two values by the factor defined in [param weight]. To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method clampf] to limit [param weight].
+ Both [param from] and [param to] must be the same type. Supported types: [int], [float], [Vector2], [Vector3], [Vector4], [Color], [Quaternion], [Basis], [Transform2D], [Transform3D].
[codeblock]
lerp(0, 4, 0.75) # Returns 3.0
[/codeblock]
See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep]. See also [method remap] to map a continuous series of values to another.
- [b]Note:[/b] For better type safety, use [method lerpf], [method Vector2.lerp], [method Vector3.lerp], [method Vector4.lerp], [method Color.lerp], [method Quaternion.slerp] or [method Basis.slerp].
+ [b]Note:[/b] For better type safety, use [method lerpf], [method Vector2.lerp], [method Vector3.lerp], [method Vector4.lerp], [method Color.lerp], [method Quaternion.slerp], [method Basis.slerp], [method Transform2D.interpolate_with], or [method Transform3D.interpolate_with].
</description>
</method>
<method name="lerp_angle" keywords="interpolate">
@@ -667,12 +667,9 @@
<return type="float" />
<param index="0" name="lin" type="float" />
<description>
- Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear).
- [b]Example:[/b]
+ Converts from linear energy to decibels (audio). Since volume is not normally linear, this can be used to implement volume sliders that behave as expected.
+ [b]Example:[/b] Change the Master bus's volume through a [Slider] node, which ranges from [code]0.0[/code] to [code]1.0[/code]:
[codeblock]
- # "Slider" refers to a node that inherits Range such as HSlider or VSlider.
- # Its range must be configured to go from 0 to 1.
- # Change the bus name if you'd like to change the volume of a specific bus only.
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear_to_db($Slider.value))
[/codeblock]
</description>
@@ -859,7 +856,7 @@
GD.Print("a", "b", a); // Prints ab[1, 2, 3]
[/csharp]
[/codeblocks]
- [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print] or [method print_rich]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed.
+ [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print] or [method print_rich]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. See also [member Engine.print_to_stdout] and [member ProjectSettings.application/run/disable_stdout].
</description>
</method>
<method name="print_rich" qualifiers="vararg">
@@ -994,8 +991,8 @@
[codeblock]
var a = rand_from_seed(4)
- print(a[0]) # Prints 2879024997
- print(a[1]) # Prints 4
+ print(a[0]) # Prints 2879024997
+ print(a[1]) # Prints 4
[/codeblock]
</description>
</method>
@@ -1212,7 +1209,7 @@
<return type="int" />
<param index="0" name="x" type="int" />
<description>
- Returns [code]-1[/code] if [param x] is negative, [code]1[/code] if [param x] is positive, and [code]0[/code] if if [param x] is zero.
+ Returns [code]-1[/code] if [param x] is negative, [code]1[/code] if [param x] is positive, and [code]0[/code] if [param x] is zero.
[codeblock]
signi(-6) # Returns -1
signi(0) # Returns 0
@@ -1248,8 +1245,9 @@
<param index="1" name="to" type="float" />
<param index="2" name="x" type="float" />
<description>
- Returns the result of smoothly interpolating the value of [param x] between [code]0[/code] and [code]1[/code], based on the where [param x] lies with respect to the edges [param from] and [param to].
- The return value is [code]0[/code] if [code]x &lt;= from[/code], and [code]1[/code] if [code]x &gt;= to[/code]. If [param x] lies between [param from] and [param to], the returned value follows an S-shaped curve that maps [param x] between [code]0[/code] and [code]1[/code].
+ Returns a smooth cubic Hermite interpolation between [code]0[/code] and [code]1[/code].
+ For positive ranges (when [code]from &lt;= to[/code]) the return value is [code]0[/code] when [code]x &lt;= from[/code], and [code]1[/code] when [code]x &gt;= to[/code]. If [param x] lies between [param from] and [param to], the return value follows an S-shaped curve that smoothly transitions from [code]0[/code] to [code]1[/code].
+ For negative ranges (when [code]from &gt; to[/code]) the function is mirrored and returns [code]1[/code] when [code]x &lt;= to[/code] and [code]0[/code] when [code]x &gt;= from[/code].
This S-shaped curve is the cubic Hermite interpolator, given by [code]f(y) = 3*y^2 - 2*y^3[/code] where [code]y = (x-from) / (to-from)[/code].
[codeblock]
smoothstep(0, 2, -5.0) # Returns 0.0
@@ -1259,6 +1257,7 @@
[/codeblock]
Compared to [method ease] with a curve value of [code]-1.6521[/code], [method smoothstep] returns the smoothest possible curve with no sudden changes in the derivative. If you need to perform more advanced transitions, use [Tween] or [AnimationPlayer].
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/smoothstep_ease_comparison.png]Comparison between smoothstep() and ease(x, -1.6521) return values[/url]
+ [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/smoothstep_range.webp]Smoothstep() return values with positive, zero, and negative ranges[/url]
</description>
</method>
<method name="snapped">
@@ -2601,8 +2600,7 @@
</constant>
<constant name="OK" value="0" enum="Error">
Methods that return [enum Error] return [constant OK] when no error occurred.
- Since [constant OK] has value 0, and all other error constants are positive integers, it can also be used in boolean checks.
- [b]Example:[/b]
+ Since [constant OK] has value [code]0[/code], and all other error constants are positive integers, it can also be used in boolean checks.
[codeblock]
var error = method_that_returns_error()
if error != OK:
@@ -2865,7 +2863,7 @@
hintString = $"{Variant.Type.Array:D}:{Variant.Type.Array:D}:{elemType:D}/{elemHint:D}:{elemHintString}";
[/csharp]
[/codeblocks]
- Examples:
+ [b]Examples:[/b]
[codeblocks]
[gdscript]
hint_string = "%d:" % [TYPE_INT] # Array of integers.
@@ -2917,6 +2915,9 @@
<constant name="PROPERTY_HINT_ARRAY_TYPE" value="31" enum="PropertyHint">
Hints that a property is an [Array] with the stored type specified in the hint string.
</constant>
+ <constant name="PROPERTY_HINT_DICTIONARY_TYPE" value="38" enum="PropertyHint">
+ Hints that a property is a [Dictionary] with the stored types specified in the hint string.
+ </constant>
<constant name="PROPERTY_HINT_LOCALE_ID" value="32" enum="PropertyHint">
Hints that a string property is a locale code. Editing it will show a locale dialog for picking language and country.
</constant>
@@ -2932,17 +2933,25 @@
<constant name="PROPERTY_HINT_PASSWORD" value="36" enum="PropertyHint">
Hints that a string property is a password, and every character is replaced with the secret character.
</constant>
- <constant name="PROPERTY_HINT_MAX" value="38" enum="PropertyHint">
+ <constant name="PROPERTY_HINT_TOOL_BUTTON" value="39" enum="PropertyHint">
+ Hints that a [Callable] property should be displayed as a clickable button. When the button is pressed, the callable is called. The hint string specifies the button text and optionally an icon from the [code]"EditorIcons"[/code] theme type.
+ [codeblock lang=text]
+ "Click me!" - A button with the text "Click me!" and the default "Callable" icon.
+ "Click me!,ColorRect" - A button with the text "Click me!" and the "ColorRect" icon.
+ [/codeblock]
+ [b]Note:[/b] A [Callable] cannot be properly serialized and stored in a file, so it is recommended to use [constant PROPERTY_USAGE_EDITOR] instead of [constant PROPERTY_USAGE_DEFAULT].
+ </constant>
+ <constant name="PROPERTY_HINT_MAX" value="40" enum="PropertyHint">
Represents the size of the [enum PropertyHint] enum.
</constant>
<constant name="PROPERTY_USAGE_NONE" value="0" enum="PropertyUsageFlags" is_bitfield="true">
The property is not stored, and does not display in the editor. This is the default for non-exported properties.
</constant>
<constant name="PROPERTY_USAGE_STORAGE" value="2" enum="PropertyUsageFlags" is_bitfield="true">
- The property is serialized and saved in the scene file (default).
+ The property is serialized and saved in the scene file (default for exported properties).
</constant>
<constant name="PROPERTY_USAGE_EDITOR" value="4" enum="PropertyUsageFlags" is_bitfield="true">
- The property is shown in the [EditorInspector] (default).
+ The property is shown in the [EditorInspector] (default for exported properties).
</constant>
<constant name="PROPERTY_USAGE_INTERNAL" value="8" enum="PropertyUsageFlags" is_bitfield="true">
The property is excluded from the class reference.
@@ -2983,7 +2992,7 @@
<constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="32768" enum="PropertyUsageFlags" is_bitfield="true" deprecated="This flag is not used by the engine.">
</constant>
<constant name="PROPERTY_USAGE_CLASS_IS_ENUM" value="65536" enum="PropertyUsageFlags" is_bitfield="true">
- The property is an enum, i.e. it only takes named integer constants from its associated enumeration.
+ The property is a variable of enum type, i.e. it only takes named integer constants from its associated enumeration.
</constant>
<constant name="PROPERTY_USAGE_NIL_IS_VARIANT" value="131072" enum="PropertyUsageFlags" is_bitfield="true">
If property has [code]nil[/code] as default value, its type will be [Variant].
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index 427d38d421..ae2de055cb 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -170,7 +170,7 @@
<method name="get_shortest_axis" qualifiers="const">
<return type="Vector3" />
<description>
- Returns the shortest normaalized axis of this bounding box's [member size], as a [Vector3] ([constant Vector3.RIGHT], [constant Vector3.UP], or [constant Vector3.BACK]).
+ Returns the shortest normalized axis of this bounding box's [member size], as a [Vector3] ([constant Vector3.RIGHT], [constant Vector3.UP], or [constant Vector3.BACK]).
[codeblocks]
[gdscript]
var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8))
@@ -206,7 +206,7 @@
</method>
<method name="get_support" qualifiers="const">
<return type="Vector3" />
- <param index="0" name="dir" type="Vector3" />
+ <param index="0" name="direction" type="Vector3" />
<description>
Returns the vertex's position of this bounding box that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms.
</description>
@@ -326,13 +326,13 @@
<return type="bool" />
<param index="0" name="aabb" type="AABB" />
<description>
- Returns [code]true[/code] if this bounding box and [param aabb] are approximately equal, by calling [method Vector2.is_equal_approx] on the [member position] and the [member size].
+ Returns [code]true[/code] if this bounding box and [param aabb] are approximately equal, by calling [method Vector3.is_equal_approx] on the [member position] and the [member size].
</description>
</method>
<method name="is_finite" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if this bounding box's values are finite, by calling [method Vector2.is_finite] on the [member position] and the [member size].
+ Returns [code]true[/code] if this bounding box's values are finite, by calling [method Vector3.is_finite] on the [member position] and the [member size].
</description>
</method>
<method name="merge" qualifiers="const">
diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml
index 2ea6aa15bd..044e1206e9 100644
--- a/doc/classes/AStar2D.xml
+++ b/doc/classes/AStar2D.xml
@@ -22,7 +22,7 @@
<method name="_estimate_cost" qualifiers="virtual const">
<return type="float" />
<param index="0" name="from_id" type="int" />
- <param index="1" name="to_id" type="int" />
+ <param index="1" name="end_id" type="int" />
<description>
Called when estimating the cost between a point and the path's ending point.
Note that this function is hidden in the default [AStar2D] class.
@@ -143,6 +143,7 @@
<description>
Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached.
+ [b]Note:[/b] When [param allow_partial_path] is [code]true[/code] and [param to_id] is disabled the search may take an unusually long time to finish.
[codeblocks]
[gdscript]
var astar = AStar2D.new()
@@ -169,7 +170,7 @@
astar.ConnectPoints(2, 3, false);
astar.ConnectPoints(4, 3, false);
astar.ConnectPoints(1, 4, false);
- int[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3]
+ long[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3]
[/csharp]
[/codeblocks]
If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2.
@@ -209,7 +210,7 @@
astar.ConnectPoints(1, 2, true);
astar.ConnectPoints(1, 3, true);
- int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3]
+ long[] neighbors = astar.GetPointConnections(1); // Returns [2, 3]
[/csharp]
[/codeblocks]
</description>
@@ -235,6 +236,7 @@
Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached.
[b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty array and will print an error message.
+ Additionally, when [param allow_partial_path] is [code]true[/code] and [param to_id] is disabled the search may take an unusually long time to finish.
</description>
</method>
<method name="get_point_position" qualifiers="const">
@@ -276,7 +278,7 @@
<return type="void" />
<param index="0" name="num_nodes" type="int" />
<description>
- Reserves space internally for [param num_nodes] points, useful if you're adding a known large number of points at once, such as points on a grid. New capacity must be greater or equals to old capacity.
+ Reserves space internally for [param num_nodes] points. Useful if you're adding a known large number of points at once, such as points on a grid. The new capacity must be greater or equal to the old capacity.
</description>
</method>
<method name="set_point_disabled">
diff --git a/doc/classes/AStar3D.xml b/doc/classes/AStar3D.xml
index 281f4edcc1..2e8ae37a20 100644
--- a/doc/classes/AStar3D.xml
+++ b/doc/classes/AStar3D.xml
@@ -51,7 +51,7 @@
<method name="_estimate_cost" qualifiers="virtual const">
<return type="float" />
<param index="0" name="from_id" type="int" />
- <param index="1" name="to_id" type="int" />
+ <param index="1" name="end_id" type="int" />
<description>
Called when estimating the cost between a point and the path's ending point.
Note that this function is hidden in the default [AStar3D] class.
@@ -172,6 +172,7 @@
<description>
Returns an array with the IDs of the points that form the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path.
If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached.
+ [b]Note:[/b] When [param allow_partial_path] is [code]true[/code] and [param to_id] is disabled the search may take an unusually long time to finish.
[codeblocks]
[gdscript]
var astar = AStar3D.new()
@@ -197,7 +198,7 @@
astar.ConnectPoints(2, 3, false);
astar.ConnectPoints(4, 3, false);
astar.ConnectPoints(1, 4, false);
- int[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3]
+ long[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3]
[/csharp]
[/codeblocks]
If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2.
@@ -236,7 +237,7 @@
astar.ConnectPoints(1, 2, true);
astar.ConnectPoints(1, 3, true);
- int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3]
+ long[] neighbors = astar.GetPointConnections(1); // Returns [2, 3]
[/csharp]
[/codeblocks]
</description>
@@ -262,6 +263,7 @@
Returns an array with the points that are in the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path.
If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached.
[b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty array and will print an error message.
+ Additionally, when [param allow_partial_path] is [code]true[/code] and [param to_id] is disabled the search may take an unusually long time to finish.
</description>
</method>
<method name="get_point_position" qualifiers="const">
diff --git a/doc/classes/AStarGrid2D.xml b/doc/classes/AStarGrid2D.xml
index 5ccc0c8f2a..8e1972af11 100644
--- a/doc/classes/AStarGrid2D.xml
+++ b/doc/classes/AStarGrid2D.xml
@@ -41,7 +41,7 @@
<method name="_estimate_cost" qualifiers="virtual const">
<return type="float" />
<param index="0" name="from_id" type="Vector2i" />
- <param index="1" name="to_id" type="Vector2i" />
+ <param index="1" name="end_id" type="Vector2i" />
<description>
Called when estimating the cost between a point and the path's ending point.
Note that this function is hidden in the default [AStarGrid2D] class.
@@ -79,6 +79,14 @@
<description>
Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached.
+ [b]Note:[/b] When [param allow_partial_path] is [code]true[/code] and [param to_id] is solid the search may take an unusually long time to finish.
+ </description>
+ </method>
+ <method name="get_point_data_in_region" qualifiers="const">
+ <return type="Dictionary[]" />
+ <param index="0" name="region" type="Rect2i" />
+ <description>
+ Returns an array of dictionaries with point data ([code]id[/code]: [Vector2i], [code]position[/code]: [Vector2], [code]solid[/code]: [bool], [code]weight_scale[/code]: [float]) within a [param region].
</description>
</method>
<method name="get_point_path">
@@ -90,6 +98,7 @@
Returns an array with the points that are in the path found by [AStarGrid2D] between the given points. The array is ordered from the starting point to the ending point of the path.
If there is no valid path to the target, and [param allow_partial_path] is [code]true[/code], returns a path to the point closest to the target that can be reached.
[b]Note:[/b] This method is not thread-safe. If called from a [Thread], it will return an empty array and will print an error message.
+ Additionally, when [param allow_partial_path] is [code]true[/code] and [param to_id] is solid the search may take an unusually long time to finish.
</description>
</method>
<method name="get_point_position" qualifiers="const">
diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml
index 012ae4fe29..cc1e9117f9 100644
--- a/doc/classes/AnimatedSprite2D.xml
+++ b/doc/classes/AnimatedSprite2D.xml
@@ -54,12 +54,10 @@
<param index="0" name="frame" type="int" />
<param index="1" name="progress" type="float" />
<description>
- The setter of [member frame] resets the [member frame_progress] to [code]0.0[/code] implicitly, but this method avoids that.
- This is useful when you want to carry over the current [member frame_progress] to another [member frame].
- [b]Example:[/b]
+ Sets [member frame] the [member frame_progress] to the given values. Unlike setting [member frame], this method does not reset the [member frame_progress] to [code]0.0[/code] implicitly.
+ [b]Example:[/b] Change the animation while keeping the same [member frame] and [member frame_progress]:
[codeblocks]
[gdscript]
- # Change the animation with keeping the frame index and progress.
var current_frame = animated_sprite.get_frame()
var current_progress = animated_sprite.get_frame_progress()
animated_sprite.play("walk_another_skin")
diff --git a/doc/classes/AnimatedSprite3D.xml b/doc/classes/AnimatedSprite3D.xml
index 5f0a6c3e8d..1b1f58e5f4 100644
--- a/doc/classes/AnimatedSprite3D.xml
+++ b/doc/classes/AnimatedSprite3D.xml
@@ -53,12 +53,10 @@
<param index="0" name="frame" type="int" />
<param index="1" name="progress" type="float" />
<description>
- The setter of [member frame] resets the [member frame_progress] to [code]0.0[/code] implicitly, but this method avoids that.
- This is useful when you want to carry over the current [member frame_progress] to another [member frame].
- [b]Example:[/b]
+ Sets [member frame] the [member frame_progress] to the given values. Unlike setting [member frame], this method does not reset the [member frame_progress] to [code]0.0[/code] implicitly.
+ [b]Example:[/b] Change the animation while keeping the same [member frame] and [member frame_progress]:
[codeblocks]
[gdscript]
- # Change the animation with keeping the frame index and progress.
var current_frame = animated_sprite.get_frame()
var current_progress = animated_sprite.get_frame_progress()
animated_sprite.play("walk_another_skin")
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml
index 3b7a6e66fe..609d7eff39 100644
--- a/doc/classes/Animation.xml
+++ b/doc/classes/Animation.xml
@@ -34,6 +34,14 @@
<link title="Animation documentation index">$DOCS_URL/tutorials/animation/index.html</link>
</tutorials>
<methods>
+ <method name="add_marker">
+ <return type="void" />
+ <param index="0" name="name" type="StringName" />
+ <param index="1" name="time" type="float" />
+ <description>
+ Adds a marker to this Animation.
+ </description>
+ </method>
<method name="add_track">
<return type="int" />
<param index="0" name="type" type="int" enum="Animation.TrackType" />
@@ -271,12 +279,60 @@
Returns the index of the specified track. If the track is not found, return -1.
</description>
</method>
+ <method name="get_marker_at_time" qualifiers="const">
+ <return type="StringName" />
+ <param index="0" name="time" type="float" />
+ <description>
+ Returns the name of the marker located at the given time.
+ </description>
+ </method>
+ <method name="get_marker_color" qualifiers="const">
+ <return type="Color" />
+ <param index="0" name="name" type="StringName" />
+ <description>
+ Returns the given marker's color.
+ </description>
+ </method>
+ <method name="get_marker_names" qualifiers="const">
+ <return type="PackedStringArray" />
+ <description>
+ Returns every marker in this Animation, sorted ascending by time.
+ </description>
+ </method>
+ <method name="get_marker_time" qualifiers="const">
+ <return type="float" />
+ <param index="0" name="name" type="StringName" />
+ <description>
+ Returns the given marker's time.
+ </description>
+ </method>
+ <method name="get_next_marker" qualifiers="const">
+ <return type="StringName" />
+ <param index="0" name="time" type="float" />
+ <description>
+ Returns the closest marker that comes after the given time. If no such marker exists, an empty string is returned.
+ </description>
+ </method>
+ <method name="get_prev_marker" qualifiers="const">
+ <return type="StringName" />
+ <param index="0" name="time" type="float" />
+ <description>
+ Returns the closest marker that comes before the given time. If no such marker exists, an empty string is returned.
+ </description>
+ </method>
<method name="get_track_count" qualifiers="const">
<return type="int" />
<description>
Returns the amount of tracks in the animation.
</description>
</method>
+ <method name="has_marker" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="name" type="StringName" />
+ <description>
+ Returns [code]true[/code] if this Animation contains a marker with the given name.
+ </description>
+ </method>
<method name="method_track_get_name" qualifiers="const">
<return type="StringName" />
<param index="0" name="track_idx" type="int" />
@@ -293,6 +349,15 @@
Returns the arguments values to be called on a method track for a given key in a given track.
</description>
</method>
+ <method name="optimize">
+ <return type="void" />
+ <param index="0" name="allowed_velocity_err" type="float" default="0.01" />
+ <param index="1" name="allowed_angular_err" type="float" default="0.01" />
+ <param index="2" name="precision" type="int" default="3" />
+ <description>
+ Optimize the animation and all its tracks in-place. This will preserve only as many keys as are necessary to keep the animation within the specified bounds.
+ </description>
+ </method>
<method name="position_track_insert_key">
<return type="int" />
<param index="0" name="track_idx" type="int" />
@@ -311,6 +376,13 @@
Returns the interpolated position value at the given time (in seconds). The [param track_idx] must be the index of a 3D position track.
</description>
</method>
+ <method name="remove_marker">
+ <return type="void" />
+ <param index="0" name="name" type="StringName" />
+ <description>
+ Removes the marker with the given name from this Animation.
+ </description>
+ </method>
<method name="remove_track">
<return type="void" />
<param index="0" name="track_idx" type="int" />
@@ -354,6 +426,14 @@
Returns the interpolated scale value at the given time (in seconds). The [param track_idx] must be the index of a 3D scale track.
</description>
</method>
+ <method name="set_marker_color">
+ <return type="void" />
+ <param index="0" name="name" type="StringName" />
+ <param index="1" name="color" type="Color" />
+ <description>
+ Sets the given marker's color.
+ </description>
+ </method>
<method name="track_find_key" qualifiers="const">
<return type="int" />
<param index="0" name="track_idx" type="int" />
@@ -560,7 +640,7 @@
<param index="0" name="track_idx" type="int" />
<param index="1" name="path" type="NodePath" />
<description>
- Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by [code]":"[/code].
+ Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the [member AnimationMixer.root_node] that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by [code]":"[/code].
For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code].
</description>
</method>
@@ -599,7 +679,7 @@
</method>
</methods>
<members>
- <member name="capture_included" type="bool" setter="_set_capture_included" getter="is_capture_included" default="false">
+ <member name="capture_included" type="bool" setter="" getter="is_capture_included" default="false">
Returns [code]true[/code] if the capture track is included. This is a cached readonly value for performance.
</member>
<member name="length" type="float" setter="set_length" getter="get_length" default="1.0">
diff --git a/doc/classes/AnimationMixer.xml b/doc/classes/AnimationMixer.xml
index c635eba2ab..d762ffa5a6 100644
--- a/doc/classes/AnimationMixer.xml
+++ b/doc/classes/AnimationMixer.xml
@@ -8,6 +8,7 @@
After instantiating the playback information data within the extended class, the blending is processed by the [AnimationMixer].
</description>
<tutorials>
+ <link title="Migrating Animations from Godot 4.0 to 4.3">https://godotengine.org/article/migrating-animations-from-godot-4-0-to-4-3/</link>
</tutorials>
<methods>
<method name="_post_process_key_value" qualifiers="virtual const">
@@ -27,6 +28,13 @@
<param index="1" name="library" type="AnimationLibrary" />
<description>
Adds [param library] to the animation player, under the key [param name].
+ AnimationMixer has a global library by default with an empty string as key. For adding an animation to the global library:
+ [codeblocks]
+ [gdscript]
+ var global_library = mixer.get_animation_library("")
+ global_library.add_animation("animation_name", animation_resource)
+ [/gdscript]
+ [/codeblocks]
</description>
</method>
<method name="advance">
@@ -115,7 +123,7 @@
move_and_slide()
[/gdscript]
[/codeblocks]
- By using this in combination with [method get_root_motion_position_accumulator], you can apply the root motion position more correctly to account for the rotation of the node.
+ By using this in combination with [method get_root_motion_rotation_accumulator], you can apply the root motion position more correctly to account for the rotation of the node.
[codeblocks]
[gdscript]
func _process(delta):
@@ -182,10 +190,10 @@
func _process(delta):
if Input.is_action_just_pressed("animate"):
state_machine.travel("Animate")
- var current_root_motion_rotation_accumulator: Quaternion = animation_tree.get_root_motion_Quaternion_accumulator()
+ var current_root_motion_rotation_accumulator: Quaternion = animation_tree.get_root_motion_rotation_accumulator()
var difference: Quaternion = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator
prev_root_motion_rotation_accumulator = current_root_motion_rotation_accumulator
- transform.basis *= difference
+ transform.basis *= Basis(difference)
[/gdscript]
[/codeblocks]
However, if the animation loops, an unintended discrete change may occur, so this is only useful for some simple use cases.
@@ -297,8 +305,8 @@
This makes it more convenient to preview and edit animations in the editor, as changes to the scene will not be saved as long as they are set in the reset animation.
</member>
<member name="root_motion_track" type="NodePath" setter="set_root_motion_track" getter="get_root_motion_track" default="NodePath(&quot;&quot;)">
- The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by [code]":"[/code]. For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code].
- If the track has type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_ROTATION_3D] or [constant Animation.TYPE_SCALE_3D] the transformation will be canceled visually, and the animation will appear to stay in place. See also [method get_root_motion_position], [method get_root_motion_rotation], [method get_root_motion_scale] and [RootMotionView].
+ The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. The [member root_motion_track] uses the same format as [method Animation.track_set_path], but note that a bone must be specified.
+ If the track has type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_ROTATION_3D], or [constant Animation.TYPE_SCALE_3D] the transformation will be canceled visually, and the animation will appear to stay in place. See also [method get_root_motion_position], [method get_root_motion_rotation], [method get_root_motion_scale], and [RootMotionView].
</member>
<member name="root_node" type="NodePath" setter="set_root_node" getter="get_root_node" default="NodePath(&quot;..&quot;)">
The node which node path references will travel from.
@@ -368,7 +376,19 @@
</constant>
<constant name="ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS" value="2" enum="AnimationCallbackModeDiscrete">
Always treat the [constant Animation.UPDATE_DISCRETE] track value as [constant Animation.UPDATE_CONTINUOUS] with [constant Animation.INTERPOLATION_NEAREST]. This is the default behavior for [AnimationTree].
- If a value track has non-numeric type key values, it is internally converted to use [constant ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE] with [constant Animation.UPDATE_DISCRETE].
+ If a value track has un-interpolatable type key values, it is internally converted to use [constant ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE] with [constant Animation.UPDATE_DISCRETE].
+ Un-interpolatable type list:
+ - [constant @GlobalScope.TYPE_NIL]
+ - [constant @GlobalScope.TYPE_NODE_PATH]
+ - [constant @GlobalScope.TYPE_RID]
+ - [constant @GlobalScope.TYPE_OBJECT]
+ - [constant @GlobalScope.TYPE_CALLABLE]
+ - [constant @GlobalScope.TYPE_SIGNAL]
+ - [constant @GlobalScope.TYPE_DICTIONARY]
+ - [constant @GlobalScope.TYPE_PACKED_BYTE_ARRAY]
+ [constant @GlobalScope.TYPE_BOOL] and [constant @GlobalScope.TYPE_INT] are treated as [constant @GlobalScope.TYPE_FLOAT] during blending and rounded when the result is retrieved.
+ It is same for arrays and vectors with them such as [constant @GlobalScope.TYPE_PACKED_INT32_ARRAY] or [constant @GlobalScope.TYPE_VECTOR2I], they are treated as [constant @GlobalScope.TYPE_PACKED_FLOAT32_ARRAY] or [constant @GlobalScope.TYPE_VECTOR2]. Also note that for arrays, the size is also interpolated.
+ [constant @GlobalScope.TYPE_STRING] and [constant @GlobalScope.TYPE_STRING_NAME] are interpolated between character codes and lengths, but note that there is a difference in algorithm between interpolation between keys and interpolation by blending.
</constant>
</constants>
</class>
diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml
index 4e093cb887..3b7cd9adad 100644
--- a/doc/classes/AnimationNode.xml
+++ b/doc/classes/AnimationNode.xml
@@ -63,7 +63,7 @@
When inheriting from [AnimationRootNode], implement this virtual method to return whether the [param parameter] is read-only. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.
</description>
</method>
- <method name="_process" qualifiers="virtual const" deprecated="Currently this is mostly useless as there is a lack of many APIs to extend AnimationNode by GDScript. It is planned that a more flexible API using structures will be provided in the future.">
+ <method name="_process" qualifiers="virtual" deprecated="Currently this is mostly useless as there is a lack of many APIs to extend AnimationNode by GDScript. It is planned that a more flexible API using structures will be provided in the future.">
<return type="float" />
<param index="0" name="time" type="float" />
<param index="1" name="seek" type="bool" />
diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml
index 0c85e8e670..70c3e5a26e 100644
--- a/doc/classes/AnimationNodeAnimation.xml
+++ b/doc/classes/AnimationNodeAnimation.xml
@@ -17,6 +17,7 @@
</member>
<member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" enum="Animation.LoopMode">
If [member use_custom_timeline] is [code]true[/code], override the loop settings of the original [Animation] resource with the value.
+ [b]Note:[/b] If the [member Animation.loop_mode] isn't set to looping, the [method Animation.track_set_interpolation_loop_wrap] option will not be respected. If you cannot get the expected behavior, consider duplicating the [Animation] resource and changing the loop settings.
</member>
<member name="play_mode" type="int" setter="set_play_mode" getter="get_play_mode" enum="AnimationNodeAnimation.PlayMode" default="0">
Determines the playback direction of the animation.
diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml
index 596767599c..da79e15be1 100644
--- a/doc/classes/AnimationNodeBlendSpace2D.xml
+++ b/doc/classes/AnimationNodeBlendSpace2D.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
A resource used by [AnimationNodeBlendTree].
- [AnimationNodeBlendSpace1D] represents a virtual 2D space on which [AnimationRootNode]s are placed. Outputs the linear blend of the three adjacent animations using a [Vector2] weight. Adjacent in this context means the three [AnimationRootNode]s making up the triangle that contains the current value.
+ [AnimationNodeBlendSpace2D] represents a virtual 2D space on which [AnimationRootNode]s are placed. Outputs the linear blend of the three adjacent animations using a [Vector2] weight. Adjacent in this context means the three [AnimationRootNode]s making up the triangle that contains the current value.
You can add vertices to the blend space with [method add_blend_point] and automatically triangulate it by setting [member auto_triangles] to [code]true[/code]. Otherwise, use [method add_triangle] and [method remove_triangle] to triangulate the blend space by hand.
</description>
<tutorials>
@@ -93,7 +93,7 @@
<param index="0" name="point" type="int" />
<param index="1" name="pos" type="Vector2" />
<description>
- Updates the position of the point at index [param point] on the blend axis.
+ Updates the position of the point at index [param point] in the blend space.
</description>
</method>
</methods>
diff --git a/doc/classes/AnimationNodeStateMachine.xml b/doc/classes/AnimationNodeStateMachine.xml
index 86311542ad..e80b1f00b0 100644
--- a/doc/classes/AnimationNodeStateMachine.xml
+++ b/doc/classes/AnimationNodeStateMachine.xml
@@ -5,7 +5,6 @@
</brief_description>
<description>
Contains multiple [AnimationRootNode]s representing animation states, connected in a graph. State transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the [AnimationNodeStateMachinePlayback] object from the [AnimationTree] node to control it programmatically.
- [b]Example:[/b]
[codeblocks]
[gdscript]
var state_machine = $AnimationTree.get("parameters/playback")
diff --git a/doc/classes/AnimationNodeStateMachinePlayback.xml b/doc/classes/AnimationNodeStateMachinePlayback.xml
index 943e6ed7d9..891dfa9f75 100644
--- a/doc/classes/AnimationNodeStateMachinePlayback.xml
+++ b/doc/classes/AnimationNodeStateMachinePlayback.xml
@@ -5,7 +5,6 @@
</brief_description>
<description>
Allows control of [AnimationTree] state machines created with [AnimationNodeStateMachine]. Retrieve with [code]$AnimationTree.get("parameters/playback")[/code].
- [b]Example:[/b]
[codeblocks]
[gdscript]
var state_machine = $AnimationTree.get("parameters/playback")
diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml
index 7bd0bd7e7e..c729eeebba 100644
--- a/doc/classes/AnimationNodeStateMachineTransition.xml
+++ b/doc/classes/AnimationNodeStateMachineTransition.xml
@@ -26,7 +26,7 @@
Use an expression as a condition for state machine transitions. It is possible to create complex animation advance conditions for switching between states and gives much greater flexibility for creating complex state machines by directly interfacing with the script code.
</member>
<member name="advance_mode" type="int" setter="set_advance_mode" getter="get_advance_mode" enum="AnimationNodeStateMachineTransition.AdvanceMode" default="1">
- Determines whether the transition should disabled, enabled when using [method AnimationNodeStateMachinePlayback.travel], or traversed automatically if the [member advance_condition] and [member advance_expression] checks are true (if assigned).
+ Determines whether the transition should be disabled, enabled when using [method AnimationNodeStateMachinePlayback.travel], or traversed automatically if the [member advance_condition] and [member advance_expression] checks are [code]true[/code] (if assigned).
</member>
<member name="break_loop_at_end" type="bool" setter="set_break_loop_at_end" getter="is_loop_broken_at_end" default="false">
If [code]true[/code], breaks the loop at the end of the loop cycle for transition, even if the animation is looping.
@@ -72,7 +72,7 @@
Only use this transition during [method AnimationNodeStateMachinePlayback.travel].
</constant>
<constant name="ADVANCE_MODE_AUTO" value="2" enum="AdvanceMode">
- Automatically use this transition if the [member advance_condition] and [member advance_expression] checks are true (if assigned).
+ Automatically use this transition if the [member advance_condition] and [member advance_expression] checks are [code]true[/code] (if assigned).
</constant>
</constants>
</class>
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml
index 302ca314bb..9aeb4b7162 100644
--- a/doc/classes/AnimationPlayer.xml
+++ b/doc/classes/AnimationPlayer.xml
@@ -75,6 +75,24 @@
Returns the node which node path references will travel from.
</description>
</method>
+ <method name="get_section_end_time" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the end time of the section currently being played.
+ </description>
+ </method>
+ <method name="get_section_start_time" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the start time of the section currently being played.
+ </description>
+ </method>
+ <method name="has_section" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if an animation is currently playing with section.
+ </description>
+ </method>
<method name="is_playing" qualifiers="const">
<return type="bool" />
<description>
@@ -110,6 +128,54 @@
This method is a shorthand for [method play] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], so see its description for more information.
</description>
</method>
+ <method name="play_section">
+ <return type="void" />
+ <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="1" name="start_time" type="float" default="-1" />
+ <param index="2" name="end_time" type="float" default="-1" />
+ <param index="3" name="custom_blend" type="float" default="-1" />
+ <param index="4" name="custom_speed" type="float" default="1.0" />
+ <param index="5" name="from_end" type="bool" default="false" />
+ <description>
+ Plays the animation with key [param name] and the section starting from [param start_time] and ending on [param end_time]. See also [method play].
+ Setting [param start_time] to a value outside the range of the animation means the start of the animation will be used instead, and setting [param end_time] to a value outside the range of the animation means the end of the animation will be used instead. [param start_time] cannot be equal to [param end_time].
+ </description>
+ </method>
+ <method name="play_section_backwards">
+ <return type="void" />
+ <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="1" name="start_time" type="float" default="-1" />
+ <param index="2" name="end_time" type="float" default="-1" />
+ <param index="3" name="custom_blend" type="float" default="-1" />
+ <description>
+ Plays the animation with key [param name] and the section starting from [param start_time] and ending on [param end_time] in reverse.
+ This method is a shorthand for [method play_section] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], see its description for more information.
+ </description>
+ </method>
+ <method name="play_section_with_markers">
+ <return type="void" />
+ <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="1" name="start_marker" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="2" name="end_marker" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="3" name="custom_blend" type="float" default="-1" />
+ <param index="4" name="custom_speed" type="float" default="1.0" />
+ <param index="5" name="from_end" type="bool" default="false" />
+ <description>
+ Plays the animation with key [param name] and the section starting from [param start_marker] and ending on [param end_marker].
+ If the start marker is empty, the section starts from the beginning of the animation. If the end marker is empty, the section ends on the end of the animation. See also [method play].
+ </description>
+ </method>
+ <method name="play_section_with_markers_backwards">
+ <return type="void" />
+ <param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="1" name="start_marker" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="2" name="end_marker" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="3" name="custom_blend" type="float" default="-1" />
+ <description>
+ Plays the animation with key [param name] and the section starting from [param start_marker] and ending on [param end_marker] in reverse.
+ This method is a shorthand for [method play_section_with_markers] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], see its description for more information.
+ </description>
+ </method>
<method name="play_with_capture">
<return type="void" />
<param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
@@ -135,10 +201,16 @@
<return type="void" />
<param index="0" name="name" type="StringName" />
<description>
- Queues an animation for playback once the current one is done.
+ Queues an animation for playback once the current animation and all previously queued animations are done.
[b]Note:[/b] If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow.
</description>
</method>
+ <method name="reset_section">
+ <return type="void" />
+ <description>
+ Resets the current section if section is set.
+ </description>
+ </method>
<method name="seek">
<return type="void" />
<param index="0" name="seconds" type="float" />
@@ -180,6 +252,23 @@
Sets the node which node path references will travel from.
</description>
</method>
+ <method name="set_section">
+ <return type="void" />
+ <param index="0" name="start_time" type="float" default="-1" />
+ <param index="1" name="end_time" type="float" default="-1" />
+ <description>
+ Changes the start and end times of the section being played. The current playback position will be clamped within the new section. See also [method play_section].
+ </description>
+ </method>
+ <method name="set_section_with_markers">
+ <return type="void" />
+ <param index="0" name="start_marker" type="StringName" default="&amp;&quot;&quot;" />
+ <param index="1" name="end_marker" type="StringName" default="&amp;&quot;&quot;" />
+ <description>
+ Changes the start and end markers of the section being played. The current playback position will be clamped within the new section. See also [method play_section_with_markers].
+ If the argument is empty, the section uses the beginning or end of the animation. If both are empty, it means that the section is not set.
+ </description>
+ </method>
<method name="stop">
<return type="void" />
<param index="0" name="keep_state" type="bool" default="false" />
diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml
index 4ad5db2b67..61a103f20d 100644
--- a/doc/classes/Area2D.xml
+++ b/doc/classes/Area2D.xml
@@ -132,7 +132,7 @@
<description>
Emitted when a [Shape2D] of the received [param area] enters a shape of this area. Requires [member monitoring] to be set to [code]true[/code].
[param local_shape_index] and [param area_shape_index] contain indices of the interacting shapes from this area and the other area, respectively. [param area_rid] contains the [RID] of the other area. These values can be used with the [PhysicsServer2D].
- [b]Example of getting the[/b] [CollisionShape2D] [b]node from the shape index:[/b]
+ [b]Example:[/b] Get the [CollisionShape2D] node from the shape index:
[codeblocks]
[gdscript]
var other_shape_owner = area.shape_find_owner(area_shape_index)
@@ -174,7 +174,7 @@
<description>
Emitted when a [Shape2D] of the received [param body] enters a shape of this area. [param body] can be a [PhysicsBody2D] or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision shapes configured. Requires [member monitoring] to be set to [code]true[/code].
[param local_shape_index] and [param body_shape_index] contain indices of the interacting shapes from this area and the interacting body, respectively. [param body_rid] contains the [RID] of the body. These values can be used with the [PhysicsServer2D].
- [b]Example of getting the[/b] [CollisionShape2D] [b]node from the shape index:[/b]
+ [b]Example:[/b] Get the [CollisionShape2D] node from the shape index:
[codeblocks]
[gdscript]
var body_shape_owner = body.shape_find_owner(body_shape_index)
diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml
index 8eedd3cdf2..aac98593ff 100644
--- a/doc/classes/Area3D.xml
+++ b/doc/classes/Area3D.xml
@@ -156,7 +156,7 @@
<description>
Emitted when a [Shape3D] of the received [param area] enters a shape of this area. Requires [member monitoring] to be set to [code]true[/code].
[param local_shape_index] and [param area_shape_index] contain indices of the interacting shapes from this area and the other area, respectively. [param area_rid] contains the [RID] of the other area. These values can be used with the [PhysicsServer3D].
- [b]Example of getting the[/b] [CollisionShape3D] [b]node from the shape index:[/b]
+ [b]Example:[/b] Get the [CollisionShape3D] node from the shape index:
[codeblocks]
[gdscript]
var other_shape_owner = area.shape_find_owner(area_shape_index)
@@ -198,7 +198,7 @@
<description>
Emitted when a [Shape3D] of the received [param body] enters a shape of this area. [param body] can be a [PhysicsBody3D] or a [GridMap]. [GridMap]s are detected if their [MeshLibrary] has collision shapes configured. Requires [member monitoring] to be set to [code]true[/code].
[param local_shape_index] and [param body_shape_index] contain indices of the interacting shapes from this area and the interacting body, respectively. [param body_rid] contains the [RID] of the body. These values can be used with the [PhysicsServer3D].
- [b]Example of getting the[/b] [CollisionShape3D] [b]node from the shape index:[/b]
+ [b]Example:[/b] Get the [CollisionShape3D] node from the shape index:
[codeblocks]
[gdscript]
var body_shape_owner = body.shape_find_owner(body_shape_index)
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index 326b71c588..1b7dbf7c41 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -4,41 +4,30 @@
A built-in data structure that holds a sequence of elements.
</brief_description>
<description>
- An array data structure that can contain a sequence of elements of any type. Elements are accessed by a numerical index starting at 0. Negative indices are used to count from the back (-1 is the last element, -2 is the second to last, etc.).
- [b]Example:[/b]
+ An array data structure that can contain a sequence of elements of any [Variant] type. Elements are accessed by a numerical index starting at [code]0[/code]. Negative indices are used to count from the back ([code]-1[/code] is the last element, [code]-2[/code] is the second to last, etc.).
[codeblocks]
[gdscript]
- var array = ["One", 2, 3, "Four"]
- print(array[0]) # One.
- print(array[2]) # 3.
- print(array[-1]) # Four.
- array[2] = "Three"
- print(array[-2]) # Three.
- [/gdscript]
- [csharp]
- var array = new Godot.Collections.Array{"One", 2, 3, "Four"};
- GD.Print(array[0]); // One.
- GD.Print(array[2]); // 3.
- GD.Print(array[array.Count - 1]); // Four.
- array[2] = "Three";
- GD.Print(array[array.Count - 2]); // Three.
- [/csharp]
- [/codeblocks]
- Arrays can be concatenated using the [code]+[/code] operator:
- [codeblocks]
- [gdscript]
- var array1 = ["One", 2]
- var array2 = [3, "Four"]
- print(array1 + array2) # ["One", 2, 3, "Four"]
+ var array = ["First", 2, 3, "Last"]
+ print(array[0]) # Prints "First"
+ print(array[2]) # Prints 3
+ print(array[-1]) # Prints "Last"
+
+ array[1] = "Second"
+ print(array[1]) # Prints "Second"
+ print(array[-3]) # Prints "Second"
[/gdscript]
[csharp]
- // Array concatenation is not possible with C# arrays, but is with Godot.Collections.Array.
- var array1 = new Godot.Collections.Array{"One", 2};
- var array2 = new Godot.Collections.Array{3, "Four"};
- GD.Print(array1 + array2); // Prints [One, 2, 3, Four]
+ var array = new Godot.Collections.Array{"First", 2, 3, "Last"};
+ GD.Print(array[0]); // Prints "First"
+ GD.Print(array[2]); // Prints 3
+ GD.Print(array[array.Count - 1]); // Prints "Last"
+
+ array[2] = "Second";
+ GD.Print(array[1]); // Prints "Second"
+ GD.Print(array[array.Count - 3]); // Prints "Second"
[/csharp]
[/codeblocks]
- [b]Note:[/b] Arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate].
+ [b]Note:[/b] Arrays are always passed by [b]reference[/b]. To get a copy of an array that can be modified independently of the original array, use [method duplicate].
[b]Note:[/b] Erasing elements while iterating over arrays is [b]not[/b] supported and will result in unpredictable behavior.
[b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedInt64Array] versus [code]Array[int][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays.
</description>
@@ -58,29 +47,32 @@
<param index="2" name="class_name" type="StringName" />
<param index="3" name="script" type="Variant" />
<description>
- Creates a typed array from the [param base] array. All arguments are required.
- - [param type] is the built-in type as a [enum Variant.Type] constant, for example [constant TYPE_INT].
- - [param class_name] is the [b]native[/b] class name, for example [Node]. If [param type] is not [constant TYPE_OBJECT], must be an empty string.
- - [param script] is the associated script. Must be a [Script] instance or [code]null[/code].
- Examples:
+ Creates a typed array from the [param base] array. A typed array can only contain elements of the given type, or that inherit from the given class, as described by this constructor's parameters:
+ - [param type] is the built-in [Variant] type, as one the [enum Variant.Type] constants.
+ - [param class_name] is the built-in class name (see [method Object.get_class]).
+ - [param script] is the associated script. It must be a [Script] instance or [code]null[/code].
+ If [param type] is not [constant TYPE_OBJECT], [param class_name] must be an empty [StringName] and [param script] must be [code]null[/code].
[codeblock]
- class_name MyNode
+ class_name Sword
extends Node
- class MyClass:
+ class Stats:
pass
func _ready():
- var a = Array([], TYPE_INT, &amp;"", null) # Array[int]
- var b = Array([], TYPE_OBJECT, &amp;"Node", null) # Array[Node]
- var c = Array([], TYPE_OBJECT, &amp;"Node", MyNode) # Array[MyNode]
- var d = Array([], TYPE_OBJECT, &amp;"RefCounted", MyClass) # Array[MyClass]
+ var a = Array([], TYPE_INT, "", null) # Array[int]
+ var b = Array([], TYPE_OBJECT, "Node", null) # Array[Node]
+ var c = Array([], TYPE_OBJECT, "Node", Sword) # Array[Sword]
+ var d = Array([], TYPE_OBJECT, "RefCounted", Stats) # Array[Stats]
[/codeblock]
- [b]Note:[/b] This constructor can be useful if you want to create a typed array on the fly, but you are not required to use it. In GDScript you can use a temporary variable with the static type you need and then pass it:
+ The [param base] array's elements are converted when necessary. If this is not possible or [param base] is already typed, this constructor fails and returns an empty [Array].
+ In GDScript, this constructor is usually not necessary, as it is possible to create a typed array through static typing:
[codeblock]
- func _ready():
- var a: Array[int] = []
- some_func(a)
+ var numbers: Array[float] = []
+ var children: Array[Node] = [$Node, $Sprite2D, $RigidBody3D]
+
+ var integers: Array[int] = [0.2, 4.5, -2.0]
+ print(integers) # Prints [0, 4, -2]
[/codeblock]
</description>
</constructor>
@@ -167,20 +159,44 @@
<return type="bool" />
<param index="0" name="method" type="Callable" />
<description>
- Calls the provided [Callable] on each element in the array and returns [code]true[/code] if the [Callable] returns [code]true[/code] for [i]all[/i] elements in the array. If the [Callable] returns [code]false[/code] for one array element or more, this method returns [code]false[/code].
- The callable's method should take one [Variant] parameter (the current array element) and return a boolean value.
- [codeblock]
+ Calls the given [Callable] on each element in the array and returns [code]true[/code] if the [Callable] returns [code]true[/code] for [i]all[/i] elements in the array. If the [Callable] returns [code]false[/code] for one array element or more, this method returns [code]false[/code].
+ The [param method] should take one [Variant] parameter (the current array element) and return a [bool].
+ [codeblocks]
+ [gdscript]
+ func greater_than_5(number):
+ return number &gt; 5
+
func _ready():
- print([6, 10, 6].all(greater_than_5)) # Prints True (3/3 elements evaluate to `true`).
- print([4, 10, 4].all(greater_than_5)) # Prints False (1/3 elements evaluate to `true`).
- print([4, 4, 4].all(greater_than_5)) # Prints False (0/3 elements evaluate to `true`).
- print([].all(greater_than_5)) # Prints True (0/0 elements evaluate to `true`).
+ print([6, 10, 6].all(greater_than_5)) # Prints true (3/3 elements evaluate to true).
+ print([4, 10, 4].all(greater_than_5)) # Prints false (1/3 elements evaluate to true).
+ print([4, 4, 4].all(greater_than_5)) # Prints false (0/3 elements evaluate to true).
+ print([].all(greater_than_5)) # Prints true (0/0 elements evaluate to true).
- print([6, 10, 6].all(func(number): return number &gt; 5)) # Prints True. Same as the first line above, but using lambda function.
+ # Same as the first line above, but using a lambda function.
+ print([6, 10, 6].all(func(element): return element &gt; 5)) # Prints true
+ [/gdscript]
+ [csharp]
+ private static bool GreaterThan5(int number)
+ {
+ return number &gt; 5;
+ }
- func greater_than_5(number):
- return number &gt; 5
- [/codeblock]
+ public override void _Ready()
+ {
+ // Prints true (3/3 elements evaluate to true).
+ GD.Print(new Godot.Collections.Array&gt;int&lt; { 6, 10, 6 }.All(GreaterThan5));
+ // Prints false (1/3 elements evaluate to true).
+ GD.Print(new Godot.Collections.Array&gt;int&lt; { 4, 10, 4 }.All(GreaterThan5));
+ // Prints false (0/3 elements evaluate to true).
+ GD.Print(new Godot.Collections.Array&gt;int&lt; { 4, 4, 4 }.All(GreaterThan5));
+ // Prints true (0/0 elements evaluate to true).
+ GD.Print(new Godot.Collections.Array&gt;int&lt; { }.All(GreaterThan5));
+
+ // Same as the first line above, but using a lambda function.
+ GD.Print(new Godot.Collections.Array&gt;int&lt; { 6, 10, 6 }.All(element =&gt; element &gt; 5)); // Prints true
+ }
+ [/csharp]
+ [/codeblocks]
See also [method any], [method filter], [method map] and [method reduce].
[b]Note:[/b] Unlike relying on the size of an array returned by [method filter], this method will return as early as possible to improve performance (especially with large arrays).
[b]Note:[/b] For an empty array, this method [url=https://en.wikipedia.org/wiki/Vacuous_truth]always[/url] returns [code]true[/code].
@@ -190,19 +206,20 @@
<return type="bool" />
<param index="0" name="method" type="Callable" />
<description>
- Calls the provided [Callable] on each element in the array and returns [code]true[/code] if the [Callable] returns [code]true[/code] for [i]one or more[/i] elements in the array. If the [Callable] returns [code]false[/code] for all elements in the array, this method returns [code]false[/code].
- The callable's method should take one [Variant] parameter (the current array element) and return a boolean value.
+ Calls the given [Callable] on each element in the array and returns [code]true[/code] if the [Callable] returns [code]true[/code] for [i]one or more[/i] elements in the array. If the [Callable] returns [code]false[/code] for all elements in the array, this method returns [code]false[/code].
+ The [param method] should take one [Variant] parameter (the current array element) and return a [bool].
[codeblock]
- func _ready():
- print([6, 10, 6].any(greater_than_5)) # Prints True (3 elements evaluate to `true`).
- print([4, 10, 4].any(greater_than_5)) # Prints True (1 elements evaluate to `true`).
- print([4, 4, 4].any(greater_than_5)) # Prints False (0 elements evaluate to `true`).
- print([].any(greater_than_5)) # Prints False (0 elements evaluate to `true`).
-
- print([6, 10, 6].any(func(number): return number &gt; 5)) # Prints True. Same as the first line above, but using lambda function.
-
func greater_than_5(number):
return number &gt; 5
+
+ func _ready():
+ print([6, 10, 6].any(greater_than_5)) # Prints true (3 elements evaluate to true).
+ print([4, 10, 4].any(greater_than_5)) # Prints true (1 elements evaluate to true).
+ print([4, 4, 4].any(greater_than_5)) # Prints false (0 elements evaluate to true).
+ print([].any(greater_than_5)) # Prints false (0 elements evaluate to true).
+
+ # Same as the first line above, but using a lambda function.
+ print([6, 10, 6].any(func(number): return number &gt; 5)) # Prints true
[/codeblock]
See also [method all], [method filter], [method map] and [method reduce].
[b]Note:[/b] Unlike relying on the size of an array returned by [method filter], this method will return as early as possible to improve performance (especially with large arrays).
@@ -213,19 +230,19 @@
<return type="void" />
<param index="0" name="value" type="Variant" />
<description>
- Appends an element at the end of the array (alias of [method push_back]).
+ Appends [param value] at the end of the array (alias of [method push_back]).
</description>
</method>
<method name="append_array">
<return type="void" />
<param index="0" name="array" type="Array" />
<description>
- Appends another array at the end of this array.
+ Appends another [param array] at the end of this array.
[codeblock]
- var array1 = [1, 2, 3]
- var array2 = [4, 5, 6]
- array1.append_array(array2)
- print(array1) # Prints [1, 2, 3, 4, 5, 6].
+ var numbers = [1, 2, 3]
+ var extra = [4, 5, 6]
+ numbers.append_array(extra)
+ print(numbers) # Prints [1, 2, 3, 4, 5, 6]
[/codeblock]
</description>
</method>
@@ -239,8 +256,8 @@
<method name="back" qualifiers="const">
<return type="Variant" />
<description>
- Returns the last element of the array. Prints an error and returns [code]null[/code] if the array is empty.
- [b]Note:[/b] Calling this function is not the same as writing [code]array[-1][/code]. If the array is empty, accessing by index will pause project execution when running from the editor.
+ Returns the last element of the array. If the array is empty, fails and returns [code]null[/code]. See also [method front].
+ [b]Note:[/b] Unlike with the [code][][/code] operator ([code]array[-1][/code]), an error is generated without stopping project execution.
</description>
</method>
<method name="bsearch" qualifiers="const">
@@ -248,13 +265,20 @@
<param index="0" name="value" type="Variant" />
<param index="1" name="before" type="bool" default="true" />
<description>
- Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [param before] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array.
+ Returns the index of [param value] in the sorted array. If it cannot be found, returns where [param value] should be inserted to keep the array sorted. The algorithm used is [url=https://en.wikipedia.org/wiki/Binary_search_algorithm]binary search[/url].
+ If [param before] is [code]true[/code] (as by default), the returned index comes before all existing elements equal to [param value] in the array.
[codeblock]
- var array = ["a", "b", "c", "c", "d", "e"]
- print(array.bsearch("c", true)) # Prints 2, at the first matching element.
- print(array.bsearch("c", false)) # Prints 4, after the last matching element, pointing to "d".
+ var numbers = [2, 4, 8, 10]
+ var idx = numbers.bsearch(7)
+
+ numbers.insert(idx, 7)
+ print(numbers) # Prints [2, 4, 7, 8, 10]
+
+ var fruits = ["Apple", "Lemon", "Lemon", "Orange"]
+ print(fruits.bsearch("Lemon", true)) # Prints 1, points at the first "Lemon".
+ print(fruits.bsearch("Lemon", false)) # Prints 3, points at "Orange".
[/codeblock]
- [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior.
+ [b]Note:[/b] Calling [method bsearch] on an [i]unsorted[/i] array will result in unexpected behavior. Use [method sort] before calling this method.
</description>
</method>
<method name="bsearch_custom" qualifiers="const">
@@ -263,15 +287,36 @@
<param index="1" name="func" type="Callable" />
<param index="2" name="before" type="bool" default="true" />
<description>
- Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search and a custom comparison method. Optionally, a [param before] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. The custom method receives two arguments (an element from the array and the value searched for) and must return [code]true[/code] if the first argument is less than the second, and return [code]false[/code] otherwise.
- [b]Note:[/b] The custom method must accept the two arguments in any order, you cannot rely on that the first argument will always be from the array.
- [b]Note:[/b] Calling [method bsearch_custom] on an unsorted array results in unexpected behavior.
+ Returns the index of [param value] in the sorted array. If it cannot be found, returns where [param value] should be inserted to keep the array sorted (using [param func] for the comparisons). The algorithm used is [url=https://en.wikipedia.org/wiki/Binary_search_algorithm]binary search[/url].
+ Similar to [method sort_custom], [param func] is called as many times as necessary, receiving one array element and [param value] as arguments. The function should return [code]true[/code] if the array element should be [i]behind[/i] [param value], otherwise it should return [code]false[/code].
+ If [param before] is [code]true[/code] (as by default), the returned index comes before all existing elements equal to [param value] in the array.
+ [codeblock]
+ func sort_by_amount(a, b):
+ if a[1] &lt; b[1]:
+ return true
+ return false
+
+ func _ready():
+ var my_items = [["Tomato", 2], ["Kiwi", 5], ["Rice", 9]]
+
+ var apple = ["Apple", 5]
+ # "Apple" is inserted before "Kiwi".
+ my_items.insert(my_items.bsearch_custom(apple, sort_by_amount, true), apple)
+
+ var banana = ["Banana", 5]
+ # "Banana" is inserted after "Kiwi".
+ my_items.insert(my_items.bsearch_custom(banana, sort_by_amount, false), banana)
+
+ # Prints [["Tomato", 2], ["Apple", 5], ["Kiwi", 5], ["Banana", 5], ["Rice", 9]]
+ print(my_items)
+ [/codeblock]
+ [b]Note:[/b] Calling [method bsearch_custom] on an [i]unsorted[/i] array will result in unexpected behavior. Use [method sort_custom] with [param func] before calling this method.
</description>
</method>
<method name="clear">
<return type="void" />
<description>
- Clears the array. This is equivalent to using [method resize] with a size of [code]0[/code].
+ Removes all elements from the array. This is equivalent to using [method resize] with a size of [code]0[/code].
</description>
</method>
<method name="count" qualifiers="const">
@@ -279,59 +324,64 @@
<param index="0" name="value" type="Variant" />
<description>
Returns the number of times an element is in the array.
+ To count how many elements in an array satisfy a condition, see [method reduce].
</description>
</method>
<method name="duplicate" qualifiers="const">
<return type="Array" />
<param index="0" name="deep" type="bool" default="false" />
<description>
- Returns a copy of the array.
- If [param deep] is [code]true[/code], a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If [code]false[/code], a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array. Note that any [Object]-derived elements will be shallow copied regardless of the [param deep] setting.
+ Returns a new copy of the array.
+ By default, a [b]shallow[/b] copy is returned: all nested [Array] and [Dictionary] elements are shared with the original array. Modifying them in one array will also affect them in the other.[br]If [param deep] is [code]true[/code], a [b]deep[/b] copy is returned: all nested arrays and dictionaries are also duplicated (recursively).
</description>
</method>
<method name="erase">
<return type="void" />
<param index="0" name="value" type="Variant" />
<description>
- Removes the first occurrence of a value from the array. If the value does not exist in the array, nothing happens. To remove an element by index, use [method remove_at] instead.
- [b]Note:[/b] This method acts in-place and doesn't return a modified array.
- [b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed.
- [b]Note:[/b] Do not erase entries while iterating over the array.
+ Finds and removes the first occurrence of [param value] from the array. If [param value] does not exist in the array, nothing happens. To remove an element by index, use [method remove_at] instead.
+ [b]Note:[/b] This method shifts every element's index after the removed [param value] back, which may have a noticeable performance cost, especially on larger arrays.
+ [b]Note:[/b] Erasing elements while iterating over arrays is [b]not[/b] supported and will result in unpredictable behavior.
</description>
</method>
<method name="fill">
<return type="void" />
<param index="0" name="value" type="Variant" />
<description>
- 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:
+ Assigns the given [param value] to all elements in the array.
+ This method can often be combined with [method resize] to create an array with a given size and initialized elements:
[codeblocks]
[gdscript]
var array = []
- array.resize(10)
- array.fill(0) # Initialize the 10 elements to 0.
+ array.resize(5)
+ array.fill(2)
+ print(array) # Prints [2, 2, 2, 2, 2]
[/gdscript]
[csharp]
var array = new Godot.Collections.Array();
- array.Resize(10);
- array.Fill(0); // Initialize the 10 elements to 0.
+ array.Resize(5);
+ array.Fill(2);
+ GD.Print(array); // Prints [2, 2, 2, 2, 2]
[/csharp]
[/codeblocks]
- [b]Note:[/b] If [param value] is of a reference type ([Object]-derived, [Array], [Dictionary], etc.) then the array is filled with the references to the same object, i.e. no duplicates are created.
+ [b]Note:[/b] If [param value] is a [Variant] passed by reference ([Object]-derived, [Array], [Dictionary], etc.), the array will be filled with references to the same [param value], which are not duplicates.
</description>
</method>
<method name="filter" qualifiers="const">
<return type="Array" />
<param index="0" name="method" type="Callable" />
<description>
- Calls the provided [Callable] on each element in the array and returns a new array with the elements for which the method returned [code]true[/code].
- The callable's method should take one [Variant] parameter (the current array element) and return a boolean value.
+ Calls the given [Callable] on each element in the array and returns a new, filtered [Array].
+ The [param method] receives one of the array elements as an argument, and should return [code]true[/code] to add the element to the filtered array, or [code]false[/code] to exclude it.
[codeblock]
+ func is_even(number):
+ return number % 2 == 0
+
func _ready():
- print([1, 2, 3].filter(remove_1)) # Prints [2, 3].
- print([1, 2, 3].filter(func(number): return number != 1)) # Same as above, but using lambda function.
+ print([1, 4, 5, 8].filter(is_even)) # Prints [4, 8]
- func remove_1(number):
- return number != 1
+ # Same as above, but using a lambda function.
+ print([1, 4, 5, 8].filter(func(number): return number % 2 == 0))
[/codeblock]
See also [method any], [method all], [method map] and [method reduce].
</description>
@@ -341,78 +391,96 @@
<param index="0" name="what" type="Variant" />
<param index="1" name="from" type="int" default="0" />
<description>
- Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
+ Returns the index of the [b]first[/b] occurrence of [param what] in this array, or [code]-1[/code] if there are none. The search's start can be specified with [param from], continuing to the end of the array.
+ [b]Note:[/b] If you just want to know whether the array contains [param what], use [method has] ([code]Contains[/code] in C#). In GDScript, you may also use the [code]in[/code] operator.
+ [b]Note:[/b] For performance reasons, the search is affected by [param what]'s [enum Variant.Type]. For example, [code]7[/code] ([int]) and [code]7.0[/code] ([float]) are not considered equal for this method.
+ </description>
+ </method>
+ <method name="find_custom" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="method" type="Callable" />
+ <param index="1" name="from" type="int" default="0" />
+ <description>
+ Returns the index of the [b]first[/b] element in the array that causes [param method] to return [code]true[/code], or [code]-1[/code] if there are none. The search's start can be specified with [param from], continuing to the end of the array.
+ [param method] is a callable that takes an element of the array, and returns a [bool].
+ [b]Note:[/b] If you just want to know whether the array contains [i]anything[/i] that satisfies [param method], use [method any].
+ [codeblocks]
+ [gdscript]
+ func is_even(number):
+ return number % 2 == 0
+
+ func _ready():
+ print([1, 3, 4, 7].find_custom(is_even.bind())) # prints 2
+ [/gdscript]
+ [/codeblocks]
</description>
</method>
<method name="front" qualifiers="const">
<return type="Variant" />
<description>
- Returns the first element of the array. Prints an error and returns [code]null[/code] if the array is empty.
- [b]Note:[/b] Calling this function is not the same as writing [code]array[0][/code]. If the array is empty, accessing by index will pause project execution when running from the editor.
+ Returns the first element of the array. If the array is empty, fails and returns [code]null[/code]. See also [method back].
+ [b]Note:[/b] Unlike with the [code][][/code] operator ([code]array[0][/code]), an error is generated without stopping project execution.
+ </description>
+ </method>
+ <method name="get" qualifiers="const">
+ <return type="Variant" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the element at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
</description>
</method>
<method name="get_typed_builtin" qualifiers="const">
<return type="int" />
<description>
- Returns the built-in type of the typed array as a [enum Variant.Type] constant. If the array is not typed, returns [constant TYPE_NIL].
+ Returns the built-in [Variant] type of the typed array as a [enum Variant.Type] constant. If the array is not typed, returns [constant TYPE_NIL]. See also [method is_typed].
</description>
</method>
<method name="get_typed_class_name" qualifiers="const">
<return type="StringName" />
<description>
- Returns the [b]native[/b] class name of the typed array if the built-in type is [constant TYPE_OBJECT]. Otherwise, this method returns an empty string.
+ Returns the [b]built-in[/b] class name of the typed array, if the built-in [Variant] type [constant TYPE_OBJECT]. Otherwise, returns an empty [StringName]. See also [method is_typed] and [method Object.get_class].
</description>
</method>
<method name="get_typed_script" qualifiers="const">
<return type="Variant" />
<description>
- Returns the script associated with the typed array. This method returns a [Script] instance or [code]null[/code].
+ Returns the [Script] instance associated with this typed array, or [code]null[/code] if it does not exist. See also [method is_typed].
</description>
</method>
<method name="has" qualifiers="const" keywords="includes, contains">
<return type="bool" />
<param index="0" name="value" type="Variant" />
<description>
- Returns [code]true[/code] if the array contains the given value.
+ Returns [code]true[/code] if the array contains the given [param value].
[codeblocks]
[gdscript]
- print(["inside", 7].has("inside")) # True
- print(["inside", 7].has("outside")) # False
- print(["inside", 7].has(7)) # True
- print(["inside", 7].has("7")) # False
+ print(["inside", 7].has("inside")) # Prints true
+ print(["inside", 7].has("outside")) # Prints false
+ print(["inside", 7].has(7)) # Prints true
+ print(["inside", 7].has("7")) # Prints false
[/gdscript]
[csharp]
var arr = new Godot.Collections.Array { "inside", 7 };
- // has is renamed to Contains
- GD.Print(arr.Contains("inside")); // True
- GD.Print(arr.Contains("outside")); // False
- GD.Print(arr.Contains(7)); // True
- GD.Print(arr.Contains("7")); // False
- [/csharp]
- [/codeblocks]
- [b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows:
- [codeblocks]
- [gdscript]
- # Will evaluate to `true`.
- if 2 in [2, 4, 6, 8]:
- print("Contains!")
- [/gdscript]
- [csharp]
- // As there is no "in" keyword in C#, you have to use Contains
- var array = new Godot.Collections.Array { 2, 4, 6, 8 };
- if (array.Contains(2))
- {
- GD.Print("Contains!");
- }
+ // By C# convention, this method is renamed to `Contains`.
+ GD.Print(arr.Contains("inside")); // Prints true
+ GD.Print(arr.Contains("outside")); // Prints false
+ GD.Print(arr.Contains(7)); // Prints true
+ GD.Print(arr.Contains("7")); // Prints false
[/csharp]
[/codeblocks]
+ In GDScript, this is equivalent to the [code]in[/code] operator:
+ [codeblock]
+ if 4 in [2, 4, 6, 8]:
+ print("4 is here!") # Will be printed.
+ [/codeblock]
+ [b]Note:[/b] For performance reasons, the search is affected by the [param value]'s [enum Variant.Type]. For example, [code]7[/code] ([int]) and [code]7.0[/code] ([float]) are not considered equal for this method.
</description>
</method>
<method name="hash" qualifiers="const">
<return type="int" />
<description>
Returns a hashed 32-bit integer value representing the array and its contents.
- [b]Note:[/b] [Array]s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does [i]not[/i] imply the arrays are equal, because different arrays can have identical hash values due to hash collisions.
+ [b]Note:[/b] Arrays with equal hash values are [i]not[/i] guaranteed to be the same, as a result of hash collisions. On the countrary, arrays with different hash values are guaranteed to be different.
</description>
</method>
<method name="insert">
@@ -420,55 +488,64 @@
<param index="0" name="position" type="int" />
<param index="1" name="value" type="Variant" />
<description>
- Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]pos == size()[/code]). Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
- [b]Note:[/b] This method acts in-place and doesn't return a modified array.
- [b]Note:[/b] On large arrays, this method will be slower if the inserted element is close to the beginning of the array (index 0). This is because all elements placed after the newly inserted element have to be reindexed.
+ Inserts a new element ([param value]) at a given index ([param position]) in the array. [param position] should be between [code]0[/code] and the array's [method size].
+ Returns [constant OK] on success, or one of the other [enum Error] constants if this method fails.
+ [b]Note:[/b] Every element's index after [param position] needs to be shifted forward, which may have a noticeable performance cost, especially on larger arrays.
</description>
</method>
<method name="is_empty" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the array is empty.
+ Returns [code]true[/code] if the array is empty ([code][][/code]). See also [method size].
</description>
</method>
<method name="is_read_only" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the array is read-only. See [method make_read_only]. Arrays are automatically read-only if declared with [code]const[/code] keyword.
+ Returns [code]true[/code] if the array is read-only. See [method make_read_only].
+ In GDScript, arrays are automatically read-only if declared with the [code]const[/code] keyword.
</description>
</method>
<method name="is_same_typed" qualifiers="const">
<return type="bool" />
<param index="0" name="array" type="Array" />
<description>
- Returns [code]true[/code] if the array is typed the same as [param array].
+ Returns [code]true[/code] if this array is typed the same as the given [param array]. See also [method is_typed].
</description>
</method>
<method name="is_typed" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the array is typed. Typed arrays can only store elements of their associated type and provide type safety for the [code][][/code] operator. Methods of typed array still return [Variant].
+ Returns [code]true[/code] if the array is typed. Typed arrays can only contain elements of a specific type, as defined by the typed array constructor. The methods of a typed array are still expected to return a generic [Variant].
+ In GDScript, it is possible to define a typed array with static typing:
+ [codeblock]
+ var numbers: Array[float] = [0.2, 4.2, -2.0]
+ print(numbers.is_typed()) # Prints true
+ [/codeblock]
</description>
</method>
<method name="make_read_only">
<return type="void" />
<description>
- Makes the array read-only, i.e. disabled modifying of the array's elements. Does not apply to nested content, e.g. content of nested arrays.
+ Makes the array read-only. The array's elements cannot be overridden with different values, and their order cannot change. Does not apply to nested elements, such as dictionaries.
+ In GDScript, arrays are automatically read-only if declared with the [code]const[/code] keyword.
</description>
</method>
<method name="map" qualifiers="const">
<return type="Array" />
<param index="0" name="method" type="Callable" />
<description>
- Calls the provided [Callable] for each element in the array and returns a new array filled with values returned by the method.
- The callable's method should take one [Variant] parameter (the current array element) and can return any [Variant].
+ Calls the given [Callable] for each element in the array and returns a new array filled with values returned by the [param method].
+ The [param method] should take one [Variant] parameter (the current array element) and can return any [Variant].
[codeblock]
+ func double(number):
+ return number * 2
+
func _ready():
- print([1, 2, 3].map(negate)) # Prints [-1, -2, -3].
- print([1, 2, 3].map(func(number): return -number)) # Same as above, but using lambda function.
+ print([1, 2, 3].map(double)) # Prints [2, 4, 6]
- func negate(number):
- return -number
+ # Same as above, but using a lambda function.
+ print([1, 2, 3].map(func(element): return element * 2))
[/codeblock]
See also [method filter], [method reduce], [method any] and [method all].
</description>
@@ -476,61 +553,52 @@
<method name="max" qualifiers="const">
<return type="Variant" />
<description>
- Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned.
- To find the maximum value using a custom comparator, you can use [method reduce]. In this example every array element is checked and the first maximum value is returned:
- [codeblock]
- func _ready():
- var arr = [Vector2(0, 1), Vector2(2, 0), Vector2(1, 1), Vector2(1, 0), Vector2(0, 2)]
- # In this example we compare the lengths.
- print(arr.reduce(func(max, val): return val if is_length_greater(val, max) else max))
-
- func is_length_greater(a, b):
- return a.length() &gt; b.length()
- [/codeblock]
+ Returns the maximum value contained in the array, if all elements can be compared. Otherwise, returns [code]null[/code]. See also [method min].
+ To find the maximum value using a custom comparator, you can use [method reduce].
</description>
</method>
<method name="min" qualifiers="const">
<return type="Variant" />
<description>
- Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned.
- See also [method max] for an example of using a custom comparator.
+ Returns the minimum value contained in the array, if all elements can be compared. Otherwise, returns [code]null[/code]. See also [method max].
</description>
</method>
<method name="pick_random" qualifiers="const">
<return type="Variant" />
<description>
- Returns a random value from the target array. Prints an error and returns [code]null[/code] if the array is empty.
+ Returns a random element from the array. Generates an error and returns [code]null[/code] if the array is empty.
[codeblocks]
[gdscript]
- var array: Array[int] = [1, 2, 3, 4]
- print(array.pick_random()) # Prints either of the four numbers.
+ # May print 1, 2, 3.25, or "Hi".
+ print([1, 2, 3.25, "Hi"].pick_random())
[/gdscript]
[csharp]
- var array = new Godot.Collections.Array { 1, 2, 3, 4 };
- GD.Print(array.PickRandom()); // Prints either of the four numbers.
+ var array = new Godot.Collections.Array { 1, 2, 3.25f, "Hi" };
+ GD.Print(array.PickRandom()); // May print 1, 2, 3.25, or "Hi".
[/csharp]
[/codeblocks]
+ [b]Note:[/b] Like many similar functions in the engine (such as [method @GlobalScope.randi] or [method shuffle]), this method uses a common, global random seed. To get a predictable outcome from this method, see [method @GlobalScope.seed].
</description>
</method>
<method name="pop_at">
<return type="Variant" />
<param index="0" name="position" type="int" />
<description>
- Removes and returns the element of the array at index [param position]. If negative, [param position] is considered relative to the end of the array. Leaves the array unchanged and returns [code]null[/code] if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty.
- [b]Note:[/b] On large arrays, this method can be slower than [method pop_back] as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower [method pop_at] will be.
+ Removes and returns the element of the array at index [param position]. If negative, [param position] is considered relative to the end of the array. Returns [code]null[/code] if the array is empty. If [param position] is out of bounds, an error message is also generated.
+ [b]Note:[/b] This method shifts every element's index after [param position] back, which may have a noticeable performance cost, especially on larger arrays.
</description>
</method>
<method name="pop_back">
<return type="Variant" />
<description>
- Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty, without printing an error message. See also [method pop_front].
+ Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty, without generating an error. See also [method pop_front].
</description>
</method>
<method name="pop_front">
<return type="Variant" />
<description>
- Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty, without printing an error message. See also [method pop_back].
- [b]Note:[/b] On large arrays, this method is much slower than [method pop_back] as it will reindex all the array's elements every time it's called. The larger the array, the slower [method pop_front] will be.
+ Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty, without generating an error. See also [method pop_back].
+ [b]Note:[/b] This method shifts every other element's index back, which may have a noticeable performance cost, especially on larger arrays.
</description>
</method>
<method name="push_back">
@@ -545,7 +613,7 @@
<param index="0" name="value" type="Variant" />
<description>
Adds an element at the beginning of the array. See also [method push_back].
- [b]Note:[/b] On large arrays, this method is much slower than [method push_back] as it will reindex all the array's elements every time it's called. The larger the array, the slower [method push_front] will be.
+ [b]Note:[/b] This method shifts every other element's index forward, which may have a noticeable performance cost, especially on larger arrays.
</description>
</method>
<method name="reduce" qualifiers="const">
@@ -553,15 +621,40 @@
<param index="0" name="method" type="Callable" />
<param index="1" name="accum" type="Variant" default="null" />
<description>
- Calls the provided [Callable] for each element in array and accumulates the result in [param accum].
- The callable's method takes two arguments: the current value of [param accum] and the current array element. If [param accum] is [code]null[/code] (default value), the iteration will start from the second element, with the first one used as initial value of [param accum].
+ Calls the given [Callable] for each element in array, accumulates the result in [param accum], then returns it.
+ The [param method] takes two arguments: the current value of [param accum] and the current array element. If [param accum] is [code]null[/code] (as by default), the iteration will start from the second element, with the first one used as initial value of [param accum].
[codeblock]
- func _ready():
- print([1, 2, 3].reduce(sum, 10)) # Prints 16.
- print([1, 2, 3].reduce(func(accum, number): return accum + number, 10)) # Same as above, but using lambda function.
-
func sum(accum, number):
return accum + number
+
+ func _ready():
+ print([1, 2, 3].reduce(sum, 0)) # Prints 6
+ print([1, 2, 3].reduce(sum, 10)) # Prints 16
+
+ # Same as above, but using a lambda function.
+ print([1, 2, 3].reduce(func(accum, number): return accum + number, 10))
+ [/codeblock]
+ If [method max] is not desirable, this method may also be used to implement a custom comparator:
+ [codeblock]
+ func _ready():
+ var arr = [Vector2(5, 0), Vector2(3, 4), Vector2(1, 2)]
+
+ var longest_vec = arr.reduce(func(max, vec): return vec if is_length_greater(vec, max) else max)
+ print(longest_vec) # Prints Vector2(3, 4).
+
+ func is_length_greater(a, b):
+ return a.length() &gt; b.length()
+ [/codeblock]
+ This method can also be used to count how many elements in an array satisfy a certain condition, similar to [method count]:
+ [codeblock]
+ func is_even(number):
+ return number % 2 == 0
+
+ func _ready():
+ var arr = [1, 2, 3, 4, 5]
+ # Increment count if it's even, else leaves count the same.
+ var even_count = arr.reduce(func(count, next): return count + 1 if is_even(next) else count, 0)
+ print(even_count) # Prints 2
[/codeblock]
See also [method map], [method filter], [method any] and [method all].
</description>
@@ -570,25 +663,25 @@
<return type="void" />
<param index="0" name="position" type="int" />
<description>
- Removes an element from the array by index. If the index does not exist in the array, nothing happens. To remove an element by searching for its value, use [method erase] instead.
- [b]Note:[/b] This method acts in-place and doesn't return a modified array.
- [b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed.
- [b]Note:[/b] [param position] cannot be negative. To remove an element relative to the end of the array, use [code]arr.remove_at(arr.size() - (i + 1))[/code]. To remove the last element from the array without returning the value, use [code]arr.resize(arr.size() - 1)[/code].
+ Removes the element from the array at the given index ([param position]). If the index is out of bounds, this method fails.
+ If you need to return the removed element, use [method pop_at]. To remove an element by value, use [method erase] instead.
+ [b]Note:[/b] This method shifts every element's index after [param position] back, which may have a noticeable performance cost, especially on larger arrays.
+ [b]Note:[/b] The [param position] cannot be negative. To remove an element relative to the end of the array, use [code]arr.remove_at(arr.size() - (i + 1))[/code]. To remove the last element from the array, use [code]arr.resize(arr.size() - 1)[/code].
</description>
</method>
<method name="resize">
<return type="int" />
<param index="0" name="size" type="int" />
<description>
- Resizes the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are [code]null[/code]. Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
- Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
- [b]Note:[/b] This method acts in-place and doesn't return a modified array.
+ Sets the array's number of elements to [param size]. If [param size] is smaller than the array's current size, the elements at the end are removed. If [param size] is greater, new default elements (usually [code]null[/code]) are added, depending on the array's type.
+ Returns [constant OK] on success, or one of the other [enum Error] constants if this method fails.
+ [b]Note:[/b] Calling this method once and assigning the new values is faster than calling [method append] for every new element.
</description>
</method>
<method name="reverse">
<return type="void" />
<description>
- Reverses the order of the elements in the array.
+ Reverses the order of all elements in the array.
</description>
</method>
<method name="rfind" qualifiers="const">
@@ -596,19 +689,36 @@
<param index="0" name="what" type="Variant" />
<param index="1" name="from" type="int" default="-1" />
<description>
- Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array.
+ Returns the index of the [b]last[/b] occurrence of [param what] in this array, or [code]-1[/code] if there are none. The search's start can be specified with [param from], continuing to the beginning of the array. This method is the reverse of [method find].
+ </description>
+ </method>
+ <method name="rfind_custom" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="method" type="Callable" />
+ <param index="1" name="from" type="int" default="-1" />
+ <description>
+ Returns the index of the [b]last[/b] element of the array that causes [param method] to return [code]true[/code], or [code]-1[/code] if there are none. The search's start can be specified with [param from], continuing to the beginning of the array. This method is the reverse of [method find_custom].
+ </description>
+ </method>
+ <method name="set">
+ <return type="void" />
+ <param index="0" name="index" type="int" />
+ <param index="1" name="value" type="Variant" />
+ <description>
+ Sets the value of the element at the given [param index] to the given [param value]. This will not change the size of the array, it only changes the value at an index already in the array. This is the same as using the [code][][/code] operator ([code]array[index] = value[/code]).
</description>
</method>
<method name="shuffle">
<return type="void" />
<description>
- Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [method @GlobalScope.randi]. Call [method @GlobalScope.randomize] to ensure that a new seed will be used each time if you want non-reproducible shuffling.
+ Shuffles all elements of the array in a random order.
+ [b]Note:[/b] Like many similar functions in the engine (such as [method @GlobalScope.randi] or [method pick_random]), this method uses a common, global random seed. To get a predictable outcome from this method, see [method @GlobalScope.seed].
</description>
</method>
<method name="size" qualifiers="const">
<return type="int" />
<description>
- Returns the number of elements in the array.
+ Returns the number of elements in the array. Empty arrays ([code][][/code]) always return [code]0[/code]. See also [method is_empty].
</description>
</method>
<method name="slice" qualifiers="const">
@@ -618,67 +728,71 @@
<param index="2" name="step" type="int" default="1" />
<param index="3" name="deep" type="bool" default="false" />
<description>
- Returns the slice of the [Array], from [param begin] (inclusive) to [param end] (exclusive), as a new [Array].
- The absolute value of [param begin] and [param end] will be clamped to the array size, so the default value for [param end] makes it slice to the size of the array by default (i.e. [code]arr.slice(1)[/code] is a shorthand for [code]arr.slice(1, arr.size())[/code]).
- If either [param begin] or [param end] are negative, they will be relative to the end of the array (i.e. [code]arr.slice(0, -2)[/code] is a shorthand for [code]arr.slice(0, arr.size() - 2)[/code]).
- If specified, [param step] is the relative index between source elements. It can be negative, then [param begin] must be higher than [param end]. For example, [code][0, 1, 2, 3, 4, 5].slice(5, 1, -2)[/code] returns [code][5, 3][/code].
- If [param deep] is true, each element will be copied by value rather than by reference.
- [b]Note:[/b] To include the first element when [param step] is negative, use [code]arr.slice(begin, -arr.size() - 1, step)[/code] (i.e. [code][0, 1, 2].slice(1, -4, -1)[/code] returns [code][1, 0][/code]).
+ Returns a new [Array] containing this array's elements, from index [param begin] (inclusive) to [param end] (exclusive), every [param step] elements.
+ If either [param begin] or [param end] are negative, their value is relative to the end of the array.
+ If [param step] is negative, this method iterates through the array in reverse, returning a slice ordered backwards. For this to work, [param begin] must be greater than [param end].
+ If [param deep] is [code]true[/code], all nested [Array] and [Dictionary] elements in the slice are duplicated from the original, recursively. See also [method duplicate]).
+ [codeblock]
+ var letters = ["A", "B", "C", "D", "E", "F"]
+
+ print(letters.slice(0, 2)) # Prints ["A", "B"]
+ print(letters.slice(2, -2)) # Prints ["C", "D"]
+ print(letters.slice(-2, 6)) # Prints ["E", "F"]
+
+ print(letters.slice(0, 6, 2)) # Prints ["A", "C", "E"]
+ print(letters.slice(4, 1, -1)) # Prints ["E", "D", "C"]
+ [/codeblock]
</description>
</method>
<method name="sort">
<return type="void" />
<description>
- Sorts the array.
- [b]Note:[/b] The sorting algorithm used is not [url=https://en.wikipedia.org/wiki/Sorting_algorithm#Stability]stable[/url]. This means that values considered equal may have their order changed when using [method sort].
- [b]Note:[/b] Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example:
+ Sorts the array in ascending order. The final order is dependent on the "less than" ([code]&lt;[/code]) comparison between elements.
[codeblocks]
[gdscript]
- var strings = ["string1", "string2", "string10", "string11"]
- strings.sort()
- print(strings) # Prints [string1, string10, string11, string2]
+ var numbers = [10, 5, 2.5, 8]
+ numbers.sort()
+ print(numbers) # Prints [2.5, 5, 8, 10]
[/gdscript]
[csharp]
- var strings = new Godot.Collections.Array { "string1", "string2", "string10", "string11" };
- strings.Sort();
- GD.Print(strings); // Prints [string1, string10, string11, string2]
+ var numbers = new Godot.Collections.Array { 10, 5, 2.5, 8 };
+ numbers.Sort();
+ GD.Print(numbers); // Prints [2.5, 5, 8, 10]
[/csharp]
[/codeblocks]
- To perform natural order sorting, you can use [method sort_custom] with [method String.naturalnocasecmp_to] as follows:
- [codeblock]
- var strings = ["string1", "string2", "string10", "string11"]
- strings.sort_custom(func(a, b): return a.naturalnocasecmp_to(b) &lt; 0)
- print(strings) # Prints [string1, string2, string10, string11]
- [/codeblock]
+ [b]Note:[/b] The sorting algorithm used is not [url=https://en.wikipedia.org/wiki/Sorting_algorithm#Stability]stable[/url]. This means that equivalent elements (such as [code]2[/code] and [code]2.0[/code]) may have their order changed when calling [method sort].
</description>
</method>
<method name="sort_custom">
<return type="void" />
<param index="0" name="func" type="Callable" />
<description>
- Sorts the array using a custom method. The custom method receives two arguments (a pair of elements from the array) and must return either [code]true[/code] or [code]false[/code]. For two elements [code]a[/code] and [code]b[/code], if the given method returns [code]true[/code], element [code]b[/code] will be after element [code]a[/code] in the array.
- [b]Note:[/b] The sorting algorithm used is not [url=https://en.wikipedia.org/wiki/Sorting_algorithm#Stability]stable[/url]. This means that values considered equal may have their order changed when using [method sort_custom].
- [b]Note:[/b] You cannot randomize the return value as the heapsort algorithm expects a deterministic result. Randomizing the return value will result in unexpected behavior.
- [codeblocks]
- [gdscript]
+ Sorts the array using a custom [Callable].
+ [param func] is called as many times as necessary, receiving two array elements as arguments. The function should return [code]true[/code] if the first element should be moved [i]before[/i] the second one, otherwise it should return [code]false[/code].
+ [codeblock]
func sort_ascending(a, b):
- if a[0] &lt; b[0]:
+ if a[1] &lt; b[1]:
return true
return false
func _ready():
- var my_items = [[5, "Potato"], [9, "Rice"], [4, "Tomato"]]
+ var my_items = [["Tomato", 5], ["Apple", 9], ["Rice", 4]]
my_items.sort_custom(sort_ascending)
- print(my_items) # Prints [[4, Tomato], [5, Potato], [9, Rice]].
+ print(my_items) # Prints [["Rice", 4], ["Tomato", 5], ["Apple", 9]]
- # Descending, lambda version.
- my_items.sort_custom(func(a, b): return a[0] &gt; b[0])
- print(my_items) # Prints [[9, Rice], [5, Potato], [4, Tomato]].
- [/gdscript]
- [csharp]
- // There is no custom sort support for Godot.Collections.Array
- [/csharp]
- [/codeblocks]
+ # Sort descending, using a lambda function.
+ my_items.sort_custom(func(a, b): return a[1] &gt; b[1])
+ print(my_items) # Prints [["Apple", 9], ["Tomato", 5], ["Rice", 4]]
+ [/codeblock]
+ It may also be necessary to use this method to sort strings by natural order, with [method String.naturalnocasecmp_to], as in the following example:
+ [codeblock]
+ var files = ["newfile1", "newfile2", "newfile10", "newfile11"]
+ files.sort_custom(func(a, b): return a.naturalnocasecmp_to(b) &lt; 0)
+ print(files) # Prints ["newfile1", "newfile2", "newfile10", "newfile11"]
+ [/codeblock]
+ [b]Note:[/b] In C#, this method is not supported.
+ [b]Note:[/b] The sorting algorithm used is not [url=https://en.wikipedia.org/wiki/Sorting_algorithm#Stability]stable[/url]. This means that values considered equal may have their order changed when calling this method.
+ [b]Note:[/b] You should not randomize the return value of [param func], as the heapsort algorithm expects a consistent result. Randomizing the return value will result in unexpected behavior.
</description>
</method>
</methods>
@@ -687,28 +801,44 @@
<return type="bool" />
<param index="0" name="right" type="Array" />
<description>
- Compares the left operand [Array] against the [param right] [Array]. Returns [code]true[/code] if the sizes or contents of the arrays are [i]not[/i] equal, [code]false[/code] otherwise.
+ Returns [code]true[/code] if the array's size or its elements are different than [param right]'s.
</description>
</operator>
<operator name="operator +">
<return type="Array" />
<param index="0" name="right" type="Array" />
<description>
- Concatenates two [Array]s together, with the [param right] [Array] being added to the end of the [Array] specified in the left operand. For example, [code][1, 2] + [3, 4][/code] results in [code][1, 2, 3, 4][/code].
+ Appends the [param right] array to the left operand, creating a new [Array]. This is also known as an array concatenation.
+ [codeblocks]
+ [gdscript]
+ var array1 = ["One", 2]
+ var array2 = [3, "Four"]
+ print(array1 + array2) # Prints ["One", 2, 3, "Four"]
+ [/gdscript]
+ [csharp]
+ // Note that concatenation is not possible with C#'s native Array type.
+ var array1 = new Godot.Collections.Array{"One", 2};
+ var array2 = new Godot.Collections.Array{3, "Four"};
+ GD.Print(array1 + array2); // Prints ["One", 2, 3, "Four"]
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] For existing arrays, [method append_array] is much more efficient than concatenation and assignment with the [code]+=[/code] operator.
</description>
</operator>
<operator name="operator &lt;">
<return type="bool" />
<param index="0" name="right" type="Array" />
<description>
- Performs a comparison for each index between the left operand [Array] and the [param right] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is less, or [code]false[/code] if the element is greater. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]false[/code] if the left operand [Array] has fewer elements, otherwise it returns [code]true[/code].
+ Compares the elements of both arrays in order, starting from index [code]0[/code] and ending on the last index in common between both arrays. For each pair of elements, returns [code]true[/code] if this array's element is less than [param right]'s, [code]false[/code] if this element is greater. Otherwise, continues to the next pair.
+ If all searched elements are equal, returns [code]true[/code] if this array's size is less than [param right]'s, otherwise returns [code]false[/code].
</description>
</operator>
<operator name="operator &lt;=">
<return type="bool" />
<param index="0" name="right" type="Array" />
<description>
- Performs a comparison for each index between the left operand [Array] and the [param right] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is less, or [code]false[/code] if the element is greater. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]true[/code] if the left operand [Array] has the same number of elements or fewer, otherwise it returns [code]false[/code].
+ Compares the elements of both arrays in order, starting from index [code]0[/code] and ending on the last index in common between both arrays. For each pair of elements, returns [code]true[/code] if this array's element is less than [param right]'s, [code]false[/code] if this element is greater. Otherwise, continues to the next pair.
+ If all searched elements are equal, returns [code]true[/code] if this array's size is less or equal to [param right]'s, otherwise returns [code]false[/code].
</description>
</operator>
<operator name="operator ==">
@@ -722,21 +852,23 @@
<return type="bool" />
<param index="0" name="right" type="Array" />
<description>
- Performs a comparison for each index between the left operand [Array] and the [param right] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is greater, or [code]false[/code] if the element is less. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]true[/code] if the [param right] [Array] has more elements, otherwise it returns [code]false[/code].
+ Compares the elements of both arrays in order, starting from index [code]0[/code] and ending on the last index in common between both arrays. For each pair of elements, returns [code]true[/code] if this array's element is greater than [param right]'s, [code]false[/code] if this element is less. Otherwise, continues to the next pair.
+ If all searched elements are equal, returns [code]true[/code] if this array's size is greater than [param right]'s, otherwise returns [code]false[/code].
</description>
</operator>
<operator name="operator &gt;=">
<return type="bool" />
<param index="0" name="right" type="Array" />
<description>
- Performs a comparison for each index between the left operand [Array] and the [param right] [Array], considering the highest common index of both arrays for this comparison: Returns [code]true[/code] on the first occurrence of an element that is greater, or [code]false[/code] if the element is less. Note that depending on the type of data stored, this function may be recursive. If all elements are equal, it compares the length of both arrays and returns [code]true[/code] if the [param right] [Array] has more or the same number of elements, otherwise it returns [code]false[/code].
+ Compares the elements of both arrays in order, starting from index [code]0[/code] and ending on the last index in common between both arrays. For each pair of elements, returns [code]true[/code] if this array's element is greater than [param right]'s, [code]false[/code] if this element is less. Otherwise, continues to the next pair.
+ If all searched elements are equal, returns [code]true[/code] if this array's size is greater or equal to [param right]'s, otherwise returns [code]false[/code].
</description>
</operator>
<operator name="operator []">
<return type="Variant" />
<param index="0" name="index" type="int" />
<description>
- Returns a reference to the element of type [Variant] at the specified location. Arrays start at index 0. [param index] can be a zero or positive value to start from the beginning, or a negative value to start from the end. Out-of-bounds array access causes a run-time error, which will result in an error being printed and the project execution pausing if run from the editor.
+ Returns the [Variant] element at the specified [param index]. Arrays start at index 0. If [param index] is greater or equal to [code]0[/code], the element is fetched starting from the beginning of the array. If [param index] is a negative value, the element is fetched starting from the end. Accessing an array out-of-bounds will cause a run-time error, pausing the project execution if run from the editor.
</description>
</operator>
</operators>
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index 0f6bf89cd7..c80dabb8c0 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -206,7 +206,8 @@
Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices.
</member>
<member name="shadow_mesh" type="ArrayMesh" setter="set_shadow_mesh" getter="get_shadow_mesh">
- An optional mesh which is used for rendering shadows and can be used for the depth prepass. Can be used to increase performance of shadow rendering by using a mesh that only contains vertex position data (without normals, UVs, colors, etc.).
+ An optional mesh which can be used for rendering shadows and the depth prepass. Can be used to increase performance by supplying a mesh with fused vertices and only vertex position data (without normals, UVs, colors, etc.).
+ [b]Note:[/b] This mesh must have exactly the same vertex positions as the source mesh (including the source mesh's LODs, if present). If vertex positions differ, then the mesh will not draw correctly.
</member>
</members>
</class>
diff --git a/doc/classes/AtlasTexture.xml b/doc/classes/AtlasTexture.xml
index cea8e13f4c..287f2cc19a 100644
--- a/doc/classes/AtlasTexture.xml
+++ b/doc/classes/AtlasTexture.xml
@@ -6,7 +6,7 @@
<description>
[Texture2D] resource that draws only part of its [member atlas] texture, as defined by the [member region]. An additional [member margin] can also be set, which is useful for small adjustments.
Multiple [AtlasTexture] resources can be cropped from the same [member atlas]. Packing many smaller textures into a singular large texture helps to optimize video memory costs and render calls.
- [b]Note:[/b] [AtlasTexture] cannot be used in an [AnimatedTexture], and may not tile properly in nodes such as [TextureRect], when inside other [AtlasTexture] resources.
+ [b]Note:[/b] [AtlasTexture] cannot be used in an [AnimatedTexture], and will not tile properly in nodes such as [TextureRect] or [Sprite2D]. To tile an [AtlasTexture], modify its [member region] instead.
</description>
<tutorials>
</tutorials>
@@ -21,7 +21,7 @@
The margin around the [member region]. Useful for small adjustments. If the [member Rect2.size] of this property ("w" and "h" in the editor) is set, the drawn texture is resized to fit within the margin.
</member>
<member name="region" type="Rect2" setter="set_region" getter="get_region" default="Rect2(0, 0, 0, 0)">
- The region used to draw the [member atlas].
+ The region used to draw the [member atlas]. If either dimension of the region's size is [code]0[/code], the value from [member atlas] size will be used for that axis instead.
</member>
<member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" />
</members>
diff --git a/doc/classes/AudioEffectFilter.xml b/doc/classes/AudioEffectFilter.xml
index e5c1f4ccf4..18540de736 100644
--- a/doc/classes/AudioEffectFilter.xml
+++ b/doc/classes/AudioEffectFilter.xml
@@ -14,6 +14,7 @@
Threshold frequency for the filter, in Hz.
</member>
<member name="db" type="int" setter="set_db" getter="get_db" enum="AudioEffectFilter.FilterDB" default="0">
+ Steepness of the cutoff curve in dB per octave, also known as the order of the filter. Higher orders have a more aggressive cutoff.
</member>
<member name="gain" type="float" setter="set_gain" getter="get_gain" default="1.0">
Gain amount of the frequencies after the filter.
@@ -24,12 +25,16 @@
</members>
<constants>
<constant name="FILTER_6DB" value="0" enum="FilterDB">
+ Cutting off at 6dB per octave.
</constant>
<constant name="FILTER_12DB" value="1" enum="FilterDB">
+ Cutting off at 12dB per octave.
</constant>
<constant name="FILTER_18DB" value="2" enum="FilterDB">
+ Cutting off at 18dB per octave.
</constant>
<constant name="FILTER_24DB" value="3" enum="FilterDB">
+ Cutting off at 24dB per octave.
</constant>
</constants>
</class>
diff --git a/doc/classes/AudioEffectSpectrumAnalyzer.xml b/doc/classes/AudioEffectSpectrumAnalyzer.xml
index fbc0c2275f..5cbf3fb1cb 100644
--- a/doc/classes/AudioEffectSpectrumAnalyzer.xml
+++ b/doc/classes/AudioEffectSpectrumAnalyzer.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
This audio effect does not affect sound output, but can be used for real-time audio visualizations.
+ This resource configures an [AudioEffectSpectrumAnalyzerInstance], which performs the actual analysis at runtime. An instance can be obtained with [method AudioServer.get_bus_effect_instance].
See also [AudioStreamGenerator] for procedurally generating sounds.
</description>
<tutorials>
diff --git a/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml b/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml
index e8c6394073..833ccafa6f 100644
--- a/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml
+++ b/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectSpectrumAnalyzerInstance" inherits="AudioEffectInstance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
+ Queryable instance of an [AudioEffectSpectrumAnalyzer].
</brief_description>
<description>
+ The runtime part of an [AudioEffectSpectrumAnalyzer], which can be used to query the magnitude of a frequency range on its host bus.
+ An instance of this class can be obtained with [method AudioServer.get_bus_effect_instance].
</description>
<tutorials>
+ <link title="Audio Spectrum Visualizer Demo">https://godotengine.org/asset-library/asset/2762</link>
</tutorials>
<methods>
<method name="get_magnitude_for_frequency_range" qualifiers="const">
@@ -13,15 +17,17 @@
<param index="1" name="to_hz" type="float" />
<param index="2" name="mode" type="int" enum="AudioEffectSpectrumAnalyzerInstance.MagnitudeMode" default="1" />
<description>
+ Returns the magnitude of the frequencies from [param from_hz] to [param to_hz] in linear energy as a Vector2. The [code]x[/code] component of the return value represents the left stereo channel, and [code]y[/code] represents the right channel.
+ [param mode] determines how the frequency range will be processed. See [enum MagnitudeMode].
</description>
</method>
</methods>
<constants>
<constant name="MAGNITUDE_AVERAGE" value="0" enum="MagnitudeMode">
- Use the average value as magnitude.
+ Use the average value across the frequency range as magnitude.
</constant>
<constant name="MAGNITUDE_MAX" value="1" enum="MagnitudeMode">
- Use the maximum value as magnitude.
+ Use the maximum value of the frequency range as magnitude.
</constant>
</constants>
</class>
diff --git a/doc/classes/AudioEffectStereoEnhance.xml b/doc/classes/AudioEffectStereoEnhance.xml
index f009bec5bb..459ae3ebc6 100644
--- a/doc/classes/AudioEffectStereoEnhance.xml
+++ b/doc/classes/AudioEffectStereoEnhance.xml
@@ -11,11 +11,13 @@
</tutorials>
<members>
<member name="pan_pullout" type="float" setter="set_pan_pullout" getter="get_pan_pullout" default="1.0">
- Values greater than 1.0 increase intensity of any panning on audio passing through this effect, whereas values less than 1.0 will decrease the panning intensity. A value of 0.0 will downmix audio to mono.
+ Amplifies the difference between stereo channels, increasing or decreasing existing panning. A value of 0.0 will downmix stereo to mono. Does not affect a mono signal.
</member>
<member name="surround" type="float" setter="set_surround" getter="get_surround" default="0.0">
+ Widens sound stage through phase shifting in conjunction with [member time_pullout_ms]. Just pans sound to the left channel if [member time_pullout_ms] is 0.
</member>
<member name="time_pullout_ms" type="float" setter="set_time_pullout" getter="get_time_pullout" default="0.0">
+ Widens sound stage through phase shifting in conjunction with [member surround]. Just delays the right channel if [member surround] is 0.
</member>
</members>
</class>
diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml
index 6830c632cf..5def0e7baf 100644
--- a/doc/classes/AudioServer.xml
+++ b/doc/classes/AudioServer.xml
@@ -110,6 +110,12 @@
Returns the volume of the bus at index [param bus_idx] in dB.
</description>
</method>
+ <method name="get_driver_name" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the name of the current audio driver. The default usually depends on the operating system, but may be overridden via the [code]--audio-driver[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. [code]--headless[/code] also automatically sets the audio driver to [code]Dummy[/code]. See also [member ProjectSettings.audio/driver/driver].
+ </description>
+ </method>
<method name="get_input_device_list">
<return type="PackedStringArray" />
<description>
@@ -117,6 +123,12 @@
[b]Note:[/b] [member ProjectSettings.audio/driver/enable_input] must be [code]true[/code] for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
</description>
</method>
+ <method name="get_input_mix_rate" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the sample rate at the input of the [AudioServer].
+ </description>
+ </method>
<method name="get_mix_rate" qualifiers="const">
<return type="float" />
<description>
diff --git a/doc/classes/AudioStreamPlayback.xml b/doc/classes/AudioStreamPlayback.xml
index 02f3407f79..f01406d0f1 100644
--- a/doc/classes/AudioStreamPlayback.xml
+++ b/doc/classes/AudioStreamPlayback.xml
@@ -79,12 +79,47 @@
Overridable method. Called whenever the audio stream is mixed if the playback is active and [method AudioServer.set_enable_tagging_used_audio_streams] has been set to [code]true[/code]. Editor plugins may use this method to "tag" the current position along the audio stream and display it in a preview.
</description>
</method>
+ <method name="get_loop_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the number of times the stream has looped.
+ </description>
+ </method>
+ <method name="get_playback_position" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the current position in the stream, in seconds.
+ </description>
+ </method>
<method name="get_sample_playback" qualifiers="const" experimental="">
<return type="AudioSamplePlayback" />
<description>
Returns the [AudioSamplePlayback] associated with this [AudioStreamPlayback] for playing back the audio sample of this stream.
</description>
</method>
+ <method name="is_playing" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the stream is playing.
+ </description>
+ </method>
+ <method name="mix_audio">
+ <return type="PackedVector2Array" />
+ <param index="0" name="rate_scale" type="float" />
+ <param index="1" name="frames" type="int" />
+ <description>
+ Mixes up to [param frames] of audio from the stream from the current position, at a rate of [param rate_scale], advancing the stream.
+ Returns a [PackedVector2Array] where each element holds the left and right channel volume levels of each frame.
+ [b]Note:[/b] Can return fewer frames than requested, make sure to use the size of the return value.
+ </description>
+ </method>
+ <method name="seek">
+ <return type="void" />
+ <param index="0" name="time" type="float" default="0.0" />
+ <description>
+ Seeks the stream at the given [param time], in seconds.
+ </description>
+ </method>
<method name="set_sample_playback" experimental="">
<return type="void" />
<param index="0" name="playback_sample" type="AudioSamplePlayback" />
@@ -92,5 +127,18 @@
Associates [AudioSamplePlayback] to this [AudioStreamPlayback] for playing back the audio sample of this stream.
</description>
</method>
+ <method name="start">
+ <return type="void" />
+ <param index="0" name="from_pos" type="float" default="0.0" />
+ <description>
+ Starts the stream from the given [param from_pos], in seconds.
+ </description>
+ </method>
+ <method name="stop">
+ <return type="void" />
+ <description>
+ Stops the stream.
+ </description>
+ </method>
</methods>
</class>
diff --git a/doc/classes/AudioStreamPlaybackPolyphonic.xml b/doc/classes/AudioStreamPlaybackPolyphonic.xml
index f71762d6a5..894c9b2262 100644
--- a/doc/classes/AudioStreamPlaybackPolyphonic.xml
+++ b/doc/classes/AudioStreamPlaybackPolyphonic.xml
@@ -13,7 +13,7 @@
<return type="bool" />
<param index="0" name="stream" type="int" />
<description>
- Return true whether the stream associated with an integer ID is still playing. Check [method play_stream] for information on when this ID becomes invalid.
+ Returns [code]true[/code] if the stream associated with the given integer ID is still playing. Check [method play_stream] for information on when this ID becomes invalid.
</description>
</method>
<method name="play_stream">
diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml
index 7b4b7c289b..93680de21e 100644
--- a/doc/classes/AudioStreamPlayer.xml
+++ b/doc/classes/AudioStreamPlayer.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
The [AudioStreamPlayer] node plays an audio stream non-positionally. It is ideal for user interfaces, menus, or background music.
- To use this node, [member stream] needs to be set to a valid [AudioStream] resource. Playing more than one sound at the time is also supported, see [member max_polyphony].
+ To use this node, [member stream] needs to be set to a valid [AudioStream] resource. Playing more than one sound at the same time is also supported, see [member max_polyphony].
If you need to play audio at a specific position, use [AudioStreamPlayer2D] or [AudioStreamPlayer3D] instead.
</description>
<tutorials>
@@ -77,7 +77,7 @@
<member name="playback_type" type="int" setter="set_playback_type" getter="get_playback_type" enum="AudioServer.PlaybackType" default="0" experimental="">
The playback type of the stream player. If set other than to the default value, it will force that playback type.
</member>
- <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
+ <member name="playing" type="bool" setter="set_playing" getter="is_playing" default="false">
If [code]true[/code], this node is playing sounds. Setting this property has the same effect as [method play] and [method stop].
</member>
<member name="stream" type="AudioStream" setter="set_stream" getter="get_stream">
diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml
index a3206ba1d6..71d2e1f0db 100644
--- a/doc/classes/AudioStreamPlayer2D.xml
+++ b/doc/classes/AudioStreamPlayer2D.xml
@@ -81,7 +81,7 @@
<member name="playback_type" type="int" setter="set_playback_type" getter="get_playback_type" enum="AudioServer.PlaybackType" default="0" experimental="">
The playback type of the stream player. If set other than to the default value, it will force that playback type.
</member>
- <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
+ <member name="playing" type="bool" setter="set_playing" getter="is_playing" default="false">
If [code]true[/code], audio is playing or is queued to be played (see [method play]).
</member>
<member name="stream" type="AudioStream" setter="set_stream" getter="get_stream">
diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml
index bf02caffb4..a14c53bbfb 100644
--- a/doc/classes/AudioStreamPlayer3D.xml
+++ b/doc/classes/AudioStreamPlayer3D.xml
@@ -102,7 +102,7 @@
<member name="playback_type" type="int" setter="set_playback_type" getter="get_playback_type" enum="AudioServer.PlaybackType" default="0" experimental="">
The playback type of the stream player. If set other than to the default value, it will force that playback type.
</member>
- <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
+ <member name="playing" type="bool" setter="set_playing" getter="is_playing" default="false">
If [code]true[/code], audio is playing or is queued to be played (see [method play]).
</member>
<member name="stream" type="AudioStream" setter="set_stream" getter="get_stream">
diff --git a/doc/classes/AudioStreamWAV.xml b/doc/classes/AudioStreamWAV.xml
index 3df814cb7f..8d882deaee 100644
--- a/doc/classes/AudioStreamWAV.xml
+++ b/doc/classes/AudioStreamWAV.xml
@@ -15,7 +15,7 @@
<return type="int" enum="Error" />
<param index="0" name="path" type="String" />
<description>
- Saves the AudioStreamWAV as a WAV file to [param path]. Samples with IMA ADPCM or QOA formats can't be saved.
+ Saves the AudioStreamWAV as a WAV file to [param path]. Samples with IMA ADPCM or Quite OK Audio formats can't be saved.
[b]Note:[/b] A [code].wav[/code] extension is automatically appended to [param path] if it is missing.
</description>
</method>
@@ -23,19 +23,20 @@
<members>
<member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()">
Contains the audio data in bytes.
- [b]Note:[/b] This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte.
+ [b]Note:[/b] If [member format] is set to [constant FORMAT_8_BITS], this property expects signed 8-bit PCM data. To convert from unsigned 8-bit PCM, subtract 128 from each byte.
+ [b]Note:[/b] If [member format] is set to [constant FORMAT_QOA], this property expects data from a full QOA file.
</member>
<member name="format" type="int" setter="set_format" getter="get_format" enum="AudioStreamWAV.Format" default="0">
Audio format. See [enum Format] constants for values.
</member>
<member name="loop_begin" type="int" setter="set_loop_begin" getter="get_loop_begin" default="0">
- The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present.
+ The loop start point (in number of samples, relative to the beginning of the stream).
</member>
<member name="loop_end" type="int" setter="set_loop_end" getter="get_loop_end" default="0">
- The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present.
+ The loop end point (in number of samples, relative to the beginning of the stream).
</member>
<member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" enum="AudioStreamWAV.LoopMode" default="0">
- The loop mode. This information will be imported automatically from the WAV file if present. See [enum LoopMode] constants for values.
+ The loop mode. See [enum LoopMode] constants for values.
</member>
<member name="mix_rate" type="int" setter="set_mix_rate" getter="get_mix_rate" default="44100">
The sample rate for mixing this audio. Higher values require more storage space, but result in better quality.
@@ -48,16 +49,16 @@
</members>
<constants>
<constant name="FORMAT_8_BITS" value="0" enum="Format">
- 8-bit audio codec.
+ 8-bit PCM audio codec.
</constant>
<constant name="FORMAT_16_BITS" value="1" enum="Format">
- 16-bit audio codec.
+ 16-bit PCM audio codec.
</constant>
<constant name="FORMAT_IMA_ADPCM" value="2" enum="Format">
- Audio is compressed using IMA ADPCM.
+ Audio is lossily compressed as IMA ADPCM.
</constant>
<constant name="FORMAT_QOA" value="3" enum="Format">
- Audio is compressed as QOA ([url=https://qoaformat.org/]Quite OK Audio[/url]).
+ Audio is lossily compressed as [url=https://qoaformat.org/]Quite OK Audio[/url].
</constant>
<constant name="LOOP_DISABLED" value="0" enum="LoopMode">
Audio does not loop.
diff --git a/doc/classes/BackBufferCopy.xml b/doc/classes/BackBufferCopy.xml
index 23d6bc3851..eb65765312 100644
--- a/doc/classes/BackBufferCopy.xml
+++ b/doc/classes/BackBufferCopy.xml
@@ -8,6 +8,7 @@
[b]Note:[/b] Since this node inherits from [Node2D] (and not [Control]), anchors and margins won't apply to child [Control]-derived nodes. This can be problematic when resizing the window. To avoid this, add [Control]-derived nodes as [i]siblings[/i] to the [BackBufferCopy] node instead of adding them as children.
</description>
<tutorials>
+ <link title="Screen-reading shaders">$DOCS_URL/tutorials/shaders/screen-reading_shaders.html</link>
</tutorials>
<members>
<member name="copy_mode" type="int" setter="set_copy_mode" getter="get_copy_mode" enum="BackBufferCopy.CopyMode" default="1">
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml
index 764f4a65b5..13b23d70b7 100644
--- a/doc/classes/BaseButton.xml
+++ b/doc/classes/BaseButton.xml
@@ -57,7 +57,7 @@
</member>
<member name="button_pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false">
If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if [member toggle_mode] is active). Only works if [member toggle_mode] is [code]true[/code].
- [b]Note:[/b] Setting [member button_pressed] will result in [signal toggled] to be emitted. If you want to change the pressed state without emitting that signal, use [method set_pressed_no_signal].
+ [b]Note:[/b] Changing the value of [member button_pressed] will result in [signal toggled] to be emitted. If you want to change the pressed state without emitting that signal, use [method set_pressed_no_signal].
</member>
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false" keywords="enabled">
If [code]true[/code], the button is in disabled state and can't be clicked or toggled.
@@ -75,6 +75,7 @@
</member>
<member name="shortcut_in_tooltip" type="bool" setter="set_shortcut_in_tooltip" getter="is_shortcut_in_tooltip_enabled" default="true">
If [code]true[/code], the button will add information about its shortcut in the tooltip.
+ [b]Note:[/b] This property does nothing when the tooltip control is customized using [method Control._make_custom_tooltip].
</member>
<member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" default="false">
If [code]true[/code], the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked.
diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml
index fc8af02869..b4a256c54f 100644
--- a/doc/classes/BaseMaterial3D.xml
+++ b/doc/classes/BaseMaterial3D.xml
@@ -350,7 +350,6 @@
</member>
<member name="shading_mode" type="int" setter="set_shading_mode" getter="get_shading_mode" enum="BaseMaterial3D.ShadingMode" default="1">
Sets whether the shading takes place, per-pixel, per-vertex or unshaded. Per-vertex lighting is faster, making it the best choice for mobile applications, however it looks considerably worse than per-pixel. Unshaded rendering is the fastest, but disables all interactions with lights.
- [b]Note:[/b] Setting the shading mode vertex shading currently has no effect, as vertex shading is not implemented yet.
</member>
<member name="shadow_to_opacity" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR.
@@ -553,7 +552,7 @@
The object will be shaded per pixel. Useful for realistic shading effects.
</constant>
<constant name="SHADING_MODE_PER_VERTEX" value="2" enum="ShadingMode">
- The object will be shaded per vertex. Useful when you want cheaper shaders and do not care about visual quality. Not implemented yet (this mode will act like [constant SHADING_MODE_PER_PIXEL]).
+ The object will be shaded per vertex. Useful when you want cheaper shaders and do not care about visual quality.
</constant>
<constant name="SHADING_MODE_MAX" value="3" enum="ShadingMode">
Represents the size of the [enum ShadingMode] enum.
diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml
index 41bda1033d..59c1195b00 100644
--- a/doc/classes/Basis.xml
+++ b/doc/classes/Basis.xml
@@ -8,7 +8,7 @@
A [Basis] is composed by 3 axis vectors, each representing a column of the matrix: [member x], [member y], and [member z]. The length of each axis ([method Vector3.length]) influences the basis's scale, while the direction of all axes influence the rotation. Usually, these axes are perpendicular to one another. However, when you rotate any axis individually, the basis becomes sheared. Applying a sheared basis to a 3D model will make the model appear distorted.
A [Basis] is [b]orthogonal[/b] if its axes are perpendicular to each other. A basis is [b]normalized[/b] if the length of every axis is [code]1[/code]. A basis is [b]uniform[/b] if all axes share the same length (see [method get_scale]). A basis is [b]orthonormal[/b] if it is both orthogonal and normalized, which allows it to only represent rotations. A basis is [b]conformal[/b] if it is both orthogonal and uniform, which ensures it is not distorted.
For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial.
- [b]Note:[/b] Godot uses a [url=https://en.wikipedia.org/wiki/Right-hand_rule]right-handed coordinate system[/url], which is a common standard. For directions, the convention for built-in types like [Camera3D] is for -Z to point forward (+X is right, +Y is up, and +Z is back). Other objects may use different direction conventions. For more information, see the [url=$DOCS_URL/tutorials/assets_pipeline/importing_scenes.html#d-asset-direction-conventions]Importing 3D Scenes[/url] tutorial.
+ [b]Note:[/b] Godot uses a [url=https://en.wikipedia.org/wiki/Right-hand_rule]right-handed coordinate system[/url], which is a common standard. For directions, the convention for built-in types like [Camera3D] is for -Z to point forward (+X is right, +Y is up, and +Z is back). Other objects may use different direction conventions. For more information, see the [url=$DOCS_URL/tutorials/assets_pipeline/importing_3d_scenes/model_export_considerations.html#d-asset-direction-conventions]3D asset direction conventions[/url] tutorial.
[b]Note:[/b] The basis matrices are exposed as [url=https://www.mindcontrol.org/~hplus/graphics/matrix-layout.html]column-major[/url] order, which is the same as OpenGL. However, they are stored internally in row-major order, which is the same as DirectX.
</description>
<tutorials>
@@ -25,6 +25,7 @@
<return type="Basis" />
<description>
Constructs a [Basis] identical to the [constant IDENTITY].
+ [b]Note:[/b] In C#, this constructs a [Basis] with all of its components set to [constant Vector3.ZERO].
</description>
</constructor>
<constructor name="Basis">
@@ -303,7 +304,7 @@
<param index="1" name="weight" type="float" />
<description>
Performs a spherical-linear interpolation with the [param to] basis, given a [param weight]. Both this basis and [param to] should represent a rotation.
- [b]Example:[/b] Smoothly rotate a [Node3D] to the target basis over time, with a [Tween].
+ [b]Example:[/b] Smoothly rotate a [Node3D] to the target basis over time, with a [Tween]:
[codeblock]
var start_basis = Basis.IDENTITY
var target_basis = Basis.IDENTITY.rotated(Vector3.UP, TAU / 2)
diff --git a/doc/classes/BoneAttachment3D.xml b/doc/classes/BoneAttachment3D.xml
index a51b2d9a94..c66eb159cb 100644
--- a/doc/classes/BoneAttachment3D.xml
+++ b/doc/classes/BoneAttachment3D.xml
@@ -15,6 +15,12 @@
Returns the [NodePath] to the external [Skeleton3D] node, if one has been set.
</description>
</method>
+ <method name="get_skeleton">
+ <return type="Skeleton3D" />
+ <description>
+ Get parent or external [Skeleton3D] node if found.
+ </description>
+ </method>
<method name="get_use_external_skeleton" qualifiers="const">
<return type="bool" />
<description>
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml
index 98f25ed573..5b3f86c9f5 100644
--- a/doc/classes/Button.xml
+++ b/doc/classes/Button.xml
@@ -5,13 +5,13 @@
</brief_description>
<description>
[Button] is the standard themed button. It can contain text and an icon, and it will display them according to the current [Theme].
- [b]Example of creating a button and assigning an action when pressed by code:[/b]
+ [b]Example:[/b] Create a button and connect a method that will be called when the button is pressed:
[codeblocks]
[gdscript]
func _ready():
var button = Button.new()
button.text = "Click me"
- button.pressed.connect(self._button_pressed)
+ button.pressed.connect(_button_pressed)
add_child(button)
func _button_pressed():
@@ -33,7 +33,7 @@
[/csharp]
[/codeblocks]
See also [BaseButton] which contains common properties and methods associated with this node.
- [b]Note:[/b] Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use [TouchScreenButton] for buttons that trigger gameplay movement or actions.
+ [b]Note:[/b] Buttons do not detect touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use [TouchScreenButton] for buttons that trigger gameplay movement or actions.
</description>
<tutorials>
<link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/2712</link>
@@ -119,7 +119,7 @@
Icon modulate [Color] used when the [Button] is being pressed.
</theme_item>
<theme_item name="align_to_largest_stylebox" data_type="constant" type="int" default="0">
- This constant acts as a boolean. If [code]true[/code], text and icon are always aligned to the largest stylebox margins, otherwise it's aligned to the current button state stylebox margins.
+ This constant acts as a boolean. If [code]true[/code], the minimum size of the button and text/icon alignment is always based on the largest stylebox margins, otherwise it's based on the current button state stylebox margins.
</theme_item>
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The horizontal space between [Button]'s icon and text. Negative values will be treated as [code]0[/code] when used.
@@ -127,6 +127,9 @@
<theme_item name="icon_max_width" data_type="constant" type="int" default="0">
The maximum allowed width of the [Button]'s icon. This limit is applied on top of the default size of the icon, or its expanded size if [member expand_icon] is [code]true[/code]. The height is adjusted according to the icon's ratio. If the button has additional icons (e.g. [CheckBox]), they will also be limited.
</theme_item>
+ <theme_item name="line_spacing" data_type="constant" type="int" default="0">
+ Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
+ </theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
[b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml
index 99411c73aa..e8fa13fd0d 100644
--- a/doc/classes/CPUParticles2D.xml
+++ b/doc/classes/CPUParticles2D.xml
@@ -43,7 +43,7 @@
<return type="bool" />
<param index="0" name="particle_flag" type="int" enum="CPUParticles2D.ParticleFlags" />
<description>
- Returns the enabled state of the given flag (see [enum ParticleFlags] for options).
+ Returns the enabled state of the given particle flag (see [enum ParticleFlags] for options).
</description>
</method>
<method name="restart">
diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml
index 27726ff8a2..04ee95457c 100644
--- a/doc/classes/CPUParticles3D.xml
+++ b/doc/classes/CPUParticles3D.xml
@@ -11,6 +11,12 @@
<link title="Particle systems (3D)">$DOCS_URL/tutorials/3d/particles/index.html</link>
</tutorials>
<methods>
+ <method name="capture_aabb" qualifiers="const">
+ <return type="AABB" />
+ <description>
+ Returns the axis-aligned bounding box that contains all the particles that are active in the current frame.
+ </description>
+ </method>
<method name="convert_from_particles">
<return type="void" />
<param index="0" name="particles" type="Node" />
@@ -168,6 +174,10 @@
<member name="emission_ring_axis" type="Vector3" setter="set_emission_ring_axis" getter="get_emission_ring_axis">
The axis of the ring when using the emitter [constant EMISSION_SHAPE_RING].
</member>
+ <member name="emission_ring_cone_angle" type="float" setter="set_emission_ring_cone_angle" getter="get_emission_ring_cone_angle">
+ The angle of the cone when using the emitter [constant EMISSION_SHAPE_RING]. The default angle of 90 degrees results in a ring, while an angle of 0 degrees results in a cone. Intermediate values will result in a ring where one end is larger than the other.
+ [b]Note:[/b] Depending on [member emission_ring_height], the angle may be clamped if the ring's end is reached to form a perfect cone.
+ </member>
<member name="emission_ring_height" type="float" setter="set_emission_ring_height" getter="get_emission_ring_height">
The height of the ring when using the emitter [constant EMISSION_SHAPE_RING].
</member>
diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml
index 05174abb07..cf3c3e06fd 100644
--- a/doc/classes/Callable.xml
+++ b/doc/classes/Callable.xml
@@ -5,7 +5,6 @@
</brief_description>
<description>
[Callable] is a built-in [Variant] type that represents a function. It can either be a method within an [Object] instance, or a custom callable used for different purposes (see [method is_custom]). Like all [Variant] types, it can be stored in variables and passed to other functions. It is most commonly used for signal callbacks.
- [b]Example:[/b]
[codeblocks]
[gdscript]
func print_args(arg1, arg2, arg3 = ""):
@@ -156,13 +155,21 @@
<method name="get_bound_arguments" qualifiers="const">
<return type="Array" />
<description>
- Return the bound arguments (as long as [method get_bound_arguments_count] is greater than zero), or empty (if [method get_bound_arguments_count] is less than or equal to zero).
+ Returns the array of arguments bound via successive [method bind] or [method unbind] calls. These arguments will be added [i]after[/i] the arguments passed to the call, from which [method get_unbound_arguments_count] arguments on the right have been previously excluded.
+ [codeblock]
+ func get_effective_arguments(callable, call_args):
+ assert(call_args.size() - callable.get_unbound_arguments_count() &gt;= 0)
+ var result = call_args.slice(0, call_args.size() - callable.get_unbound_arguments_count())
+ result.append_array(callable.get_bound_arguments())
+ return result
+ [/codeblock]
</description>
</method>
<method name="get_bound_arguments_count" qualifiers="const">
<return type="int" />
<description>
- Returns the total amount of arguments bound (or unbound) via successive [method bind] or [method unbind] calls. If the amount of arguments unbound is greater than the ones bound, this function returns a value less than zero.
+ Returns the total amount of arguments bound via successive [method bind] or [method unbind] calls. This is the same as the size of the array returned by [method get_bound_arguments]. See [method get_bound_arguments] for details.
+ [b]Note:[/b] The [method get_bound_arguments_count] and [method get_unbound_arguments_count] methods can both return positive values.
</description>
</method>
<method name="get_method" qualifiers="const">
@@ -183,6 +190,13 @@
Returns the ID of this [Callable]'s object (see [method Object.get_instance_id]).
</description>
</method>
+ <method name="get_unbound_arguments_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the total amount of arguments unbound via successive [method bind] or [method unbind] calls. See [method get_bound_arguments] for details.
+ [b]Note:[/b] The [method get_bound_arguments_count] and [method get_unbound_arguments_count] methods can both return positive values.
+ </description>
+ </method>
<method name="hash" qualifiers="const">
<return type="int" />
<description>
@@ -203,7 +217,8 @@
<method name="is_null" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if this [Callable] has no target to call the method on.
+ Returns [code]true[/code] if this [Callable] has no target to call the method on. Equivalent to [code]callable == Callable()[/code].
+ [b]Note:[/b] This is [i]not[/i] the same as [code]not is_valid()[/code] and using [code]not is_null()[/code] will [i]not[/i] guarantee that this callable can be called. Use [method is_valid] instead.
</description>
</method>
<method name="is_standard" qualifiers="const">
diff --git a/doc/classes/CallbackTweener.xml b/doc/classes/CallbackTweener.xml
index e6a37a20e1..3a617d2a43 100644
--- a/doc/classes/CallbackTweener.xml
+++ b/doc/classes/CallbackTweener.xml
@@ -16,10 +16,10 @@
<param index="0" name="delay" type="float" />
<description>
Makes the callback call delayed by given time in seconds.
- [b]Example:[/b]
+ [b]Example:[/b] Call [method Node.queue_free] after 2 seconds:
[codeblock]
var tween = get_tree().create_tween()
- tween.tween_callback(queue_free).set_delay(2) #this will call queue_free() after 2 seconds
+ tween.tween_callback(queue_free).set_delay(2)
[/codeblock]
</description>
</method>
diff --git a/doc/classes/CameraAttributes.xml b/doc/classes/CameraAttributes.xml
index 1b1365eed4..cb5a7778de 100644
--- a/doc/classes/CameraAttributes.xml
+++ b/doc/classes/CameraAttributes.xml
@@ -25,7 +25,9 @@
Multiplier for the exposure amount. A higher value results in a brighter image.
</member>
<member name="exposure_sensitivity" type="float" setter="set_exposure_sensitivity" getter="get_exposure_sensitivity" default="100.0">
- Sensitivity of camera sensors, measured in ISO. A higher sensitivity results in a brighter image. Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. When [member auto_exposure_enabled] this can be used as a method of exposure compensation, doubling the value will increase the exposure value (measured in EV100) by 1 stop.
+ Sensitivity of camera sensors, measured in ISO. A higher sensitivity results in a brighter image.
+ If [member auto_exposure_enabled] is [code]true[/code], this can be used as a method of exposure compensation, doubling the value will increase the exposure value (measured in EV100) by 1 stop.
+ [b]Note:[/b] Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled.
</member>
</members>
</class>
diff --git a/doc/classes/CameraAttributesPhysical.xml b/doc/classes/CameraAttributesPhysical.xml
index faedfee712..e2036162c7 100644
--- a/doc/classes/CameraAttributesPhysical.xml
+++ b/doc/classes/CameraAttributesPhysical.xml
@@ -25,7 +25,7 @@
The maximum luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing below a certain brightness, resulting in a cut off point where the scene will remain bright.
</member>
<member name="auto_exposure_min_exposure_value" type="float" setter="set_auto_exposure_min_exposure_value" getter="get_auto_exposure_min_exposure_value" default="-8.0">
- The minimum luminance luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing above a certain brightness, resulting in a cut off point where the scene will remain dark.
+ The minimum luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing above a certain brightness, resulting in a cut off point where the scene will remain dark.
</member>
<member name="exposure_aperture" type="float" setter="set_aperture" getter="get_aperture" default="16.0">
Size of the aperture of the camera, measured in f-stops. An f-stop is a unitless ratio between the focal length of the camera and the diameter of the aperture. A high aperture setting will result in a smaller aperture which leads to a dimmer image and sharper focus. A low aperture results in a wide aperture which lets in more light resulting in a brighter, less-focused image. Default is appropriate for outdoors at daytime (i.e. for use with a default [DirectionalLight3D]), for indoor lighting, a value between 2 and 4 is more appropriate.
diff --git a/doc/classes/CameraFeed.xml b/doc/classes/CameraFeed.xml
index 974f6d4a33..6748fdb95b 100644
--- a/doc/classes/CameraFeed.xml
+++ b/doc/classes/CameraFeed.xml
@@ -34,6 +34,60 @@
Returns the position of camera on the device.
</description>
</method>
+ <method name="get_texture_tex_id">
+ <return type="int" />
+ <param index="0" name="feed_image_type" type="int" enum="CameraServer.FeedImage" />
+ <description>
+ Returns the texture backend ID (usable by some external libraries that need a handle to a texture to write data).
+ </description>
+ </method>
+ <method name="set_external">
+ <return type="void" />
+ <param index="0" name="width" type="int" />
+ <param index="1" name="height" type="int" />
+ <description>
+ Sets the feed as external feed provided by another library.
+ </description>
+ </method>
+ <method name="set_format">
+ <return type="bool" />
+ <param index="0" name="index" type="int" />
+ <param index="1" name="parameters" type="Dictionary" />
+ <description>
+ Sets the feed format parameters for the given index in the [member formats] array. Returns [code]true[/code] on success. By default YUYV encoded stream is transformed to FEED_RGB. YUYV encoded stream output format can be changed with [param parameters].output value:
+ [code]separate[/code] will result in FEED_YCBCR_SEP
+ [code]grayscale[/code] will result in desaturated FEED_RGB
+ [code]copy[/code] will result in FEED_YCBCR
+ </description>
+ </method>
+ <method name="set_name">
+ <return type="void" />
+ <param index="0" name="name" type="String" />
+ <description>
+ Sets the camera's name.
+ </description>
+ </method>
+ <method name="set_position">
+ <return type="void" />
+ <param index="0" name="position" type="int" enum="CameraFeed.FeedPosition" />
+ <description>
+ Sets the position of this camera.
+ </description>
+ </method>
+ <method name="set_rgb_image">
+ <return type="void" />
+ <param index="0" name="rgb_image" type="Image" />
+ <description>
+ Sets RGB image for this feed.
+ </description>
+ </method>
+ <method name="set_ycbcr_image">
+ <return type="void" />
+ <param index="0" name="ycbcr_image" type="Image" />
+ <description>
+ Sets YCbCr image for this feed.
+ </description>
+ </method>
</methods>
<members>
<member name="feed_is_active" type="bool" setter="set_active" getter="is_active" default="false">
@@ -42,7 +96,22 @@
<member name="feed_transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, -1, 0, 1)">
The transform applied to the camera's image.
</member>
+ <member name="formats" type="Array" setter="" getter="get_formats" default="[]">
+ Formats supported by the feed. Each entry is a [Dictionary] describing format parameters.
+ </member>
</members>
+ <signals>
+ <signal name="format_changed">
+ <description>
+ Emitted when the format has changed.
+ </description>
+ </signal>
+ <signal name="frame_changed">
+ <description>
+ Emitted when a new frame is available.
+ </description>
+ </signal>
+ </signals>
<constants>
<constant name="FEED_NOIMAGE" value="0" enum="FeedDataType">
No image set for the feed.
@@ -56,6 +125,9 @@
<constant name="FEED_YCBCR_SEP" value="3" enum="FeedDataType">
Feed supplies separate Y and CbCr images that need to be combined and converted to RGB.
</constant>
+ <constant name="FEED_EXTERNAL" value="4" enum="FeedDataType">
+ Feed supplies external image.
+ </constant>
<constant name="FEED_UNSPECIFIED" value="0" enum="FeedPosition">
Unspecified position.
</constant>
diff --git a/doc/classes/CameraServer.xml b/doc/classes/CameraServer.xml
index 020b5d887b..b09010147e 100644
--- a/doc/classes/CameraServer.xml
+++ b/doc/classes/CameraServer.xml
@@ -6,7 +6,7 @@
<description>
The [CameraServer] keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone.
It is notably used to provide AR modules with a video feed from the camera.
- [b]Note:[/b] This class is currently only implemented on macOS and iOS. To get a [CameraFeed] on iOS, the camera plugin from [url=https://github.com/godotengine/godot-ios-plugins]godot-ios-plugins[/url] is required. On other platforms, no [CameraFeed]s will be available.
+ [b]Note:[/b] This class is currently only implemented on Linux, macOS, and iOS, on other platforms no [CameraFeed]s will be available. To get a [CameraFeed] on iOS, the camera plugin from [url=https://github.com/godotengine/godot-ios-plugins]godot-ios-plugins[/url] is required.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 207045b065..5710e08423 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -96,6 +96,7 @@
<param index="3" name="texture" type="Texture2D" default="null" />
<description>
Draws a colored polygon of any number of points, convex or concave. Unlike [method draw_polygon], a single color must be specified for the whole polygon.
+ [b]Note:[/b] If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with [method Geometry2D.triangulate_polygon] and using [method draw_mesh], [method draw_multimesh], or [method RenderingServer.canvas_item_add_triangle_array].
</description>
</method>
<method name="draw_dashed_line">
@@ -251,6 +252,7 @@
<param index="3" name="texture" type="Texture2D" default="null" />
<description>
Draws a solid polygon of any number of points, convex or concave. Unlike [method draw_colored_polygon], each point's color can be changed individually. See also [method draw_polyline] and [method draw_polyline_colors]. If you need more flexibility (such as being able to use bones), use [method RenderingServer.canvas_item_add_triangle_array] instead.
+ [b]Note:[/b] If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with [method Geometry2D.triangulate_polygon] and using [method draw_mesh], [method draw_multimesh], or [method RenderingServer.canvas_item_add_triangle_array].
</description>
</method>
<method name="draw_polyline">
@@ -331,7 +333,7 @@
<param index="9" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>
Draws [param text] using the specified [param font] at the [param pos] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [param modulate]. If [param width] is greater than or equal to 0, the text will be clipped if it exceeds the specified width.
- [b]Example using the default project font:[/b]
+ [b]Example:[/b] Draw "Hello world", using the project's default font:
[codeblocks]
[gdscript]
# If using this method in a script that redraws constantly, move the
@@ -525,13 +527,19 @@
<return type="bool" />
<description>
Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is therefore not drawn (see [method _draw]).
+ Visibility is checked only in parent nodes that inherit from [CanvasItem], [CanvasLayer], and [Window]. If the parent is of any other type (such as [Node], [AnimationPlayer], or [Node3D]), it is assumed to be visible.
+ [b]Note:[/b] This method does not take [member visibility_layer] into account, so even if this method returns [code]true[/code] the node might end up not being rendered.
</description>
</method>
<method name="make_canvas_position_local" qualifiers="const">
<return type="Vector2" />
- <param index="0" name="screen_point" type="Vector2" />
+ <param index="0" name="viewport_point" type="Vector2" />
<description>
- Assigns [param screen_point] as this node's new local transform.
+ Transforms [param viewport_point] from the viewport's coordinates to this node's local coordinates.
+ For the opposite operation, use [method get_global_transform_with_canvas].
+ [codeblock]
+ var viewport_point = get_global_transform_with_canvas() * local_point
+ [/codeblock]
</description>
</method>
<method name="make_input_local" qualifiers="const">
@@ -586,6 +594,7 @@
<members>
<member name="clip_children" type="int" setter="set_clip_children_mode" getter="get_clip_children_mode" enum="CanvasItem.ClipChildrenMode" default="0">
Allows the current node to clip child nodes, essentially acting as a mask.
+ [b]Note:[/b] Clipping nodes cannot be nested or placed within [CanvasGroup]s. If an ancestor of this node clips its children or is a [CanvasGroup], then this node's clip mode should be set to [constant CLIP_CHILDREN_DISABLED] to avoid unexpected behavior.
</member>
<member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask" default="1">
The rendering layers in which this [CanvasItem] responds to [Light2D] nodes.
@@ -619,12 +628,12 @@
The rendering layer in which this [CanvasItem] is rendered by [Viewport] nodes. A [Viewport] will render a [CanvasItem] if it and all its parents share a layer with the [Viewport]'s canvas cull mask.
</member>
<member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true">
- If [code]true[/code], this [CanvasItem] is drawn. The node is only visible if all of its ancestors are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]).
+ If [code]true[/code], this [CanvasItem] may be drawn. Whether this [CanvasItem] is actually drawn depends on the visibility of all of its [CanvasItem] ancestors. In other words: this [CanvasItem] will be drawn when [method is_visible_in_tree] returns [code]true[/code] and all [CanvasItem] ancestors share at least one [member visibility_layer] with this [CanvasItem].
[b]Note:[/b] For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead.
</member>
<member name="y_sort_enabled" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false">
- If [code]true[/code], this and child [CanvasItem] nodes with a lower Y position are rendered in front of nodes with a higher Y position. If [code]false[/code], this and child [CanvasItem] nodes are rendered normally in scene tree order.
- With Y-sorting enabled on a parent node ('A') but disabled on a child node ('B'), the child node ('B') is sorted but its children ('C1', 'C2', etc) render together on the same Y position as the child node 'B'. This allows you to organize the render order of a scene without changing the scene tree.
+ If [code]true[/code], this and child [CanvasItem] nodes with a higher Y position are rendered in front of nodes with a lower Y position. If [code]false[/code], this and child [CanvasItem] nodes are rendered normally in scene tree order.
+ With Y-sorting enabled on a parent node ('A') but disabled on a child node ('B'), the child node ('B') is sorted but its children ('C1', 'C2', etc.) render together on the same Y position as the child node ('B'). This allows you to organize the render order of a scene without changing the scene tree.
Nodes sort relative to each other only if they are on the same [member z_index].
</member>
<member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative" default="true">
@@ -644,17 +653,17 @@
</signal>
<signal name="hidden">
<description>
- Emitted when becoming hidden.
+ Emitted when the [CanvasItem] is hidden, i.e. it's no longer visible in the tree (see [method is_visible_in_tree]).
</description>
</signal>
<signal name="item_rect_changed">
<description>
- Emitted when the item's [Rect2] boundaries (position or size) have changed, or when an action is taking place that may have impacted these boundaries (e.g. changing [member Sprite2D.texture]).
+ Emitted when the [CanvasItem]'s boundaries (position or size) change, or when an action took place that may have affected these boundaries (e.g. changing [member Sprite2D.texture]).
</description>
</signal>
<signal name="visibility_changed">
<description>
- Emitted when the visibility (hidden/visible) changes.
+ Emitted when the [CanvasItem]'s visibility changes, either because its own [member visible] property changed or because its visibility in the tree changed (see [method is_visible_in_tree]).
</description>
</signal>
</signals>
diff --git a/doc/classes/CanvasModulate.xml b/doc/classes/CanvasModulate.xml
index 7db0361020..43505498b3 100644
--- a/doc/classes/CanvasModulate.xml
+++ b/doc/classes/CanvasModulate.xml
@@ -7,6 +7,7 @@
[CanvasModulate] applies a color tint to all nodes on a canvas. Only one can be used to tint a canvas, but [CanvasLayer]s can be used to render things independently.
</description>
<tutorials>
+ <link title="2D lights and shadows">$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html</link>
</tutorials>
<members>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)" keywords="colour">
diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml
index 403033f85d..28f5d38ee4 100644
--- a/doc/classes/CharFXTransform.xml
+++ b/doc/classes/CharFXTransform.xml
@@ -8,7 +8,6 @@
</description>
<tutorials>
<link title="BBCode in RichTextLabel">$DOCS_URL/tutorials/ui/bbcode_in_richtextlabel.html</link>
- <link title="RichTextEffect test project (third-party)">https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
</tutorials>
<members>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color(0, 0, 0, 1)" keywords="colour">
diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml
index ede4d63cfc..30438be18b 100644
--- a/doc/classes/CharacterBody2D.xml
+++ b/doc/classes/CharacterBody2D.xml
@@ -69,7 +69,7 @@
<param index="0" name="slide_idx" type="int" />
<description>
Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1).
- [b]Example usage:[/b]
+ [b]Example:[/b] Iterate through the collisions with a [code]for[/code] loop:
[codeblocks]
[gdscript]
for i in get_slide_collision_count():
diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml
index 59ed0b8fe7..d01a308e32 100644
--- a/doc/classes/ClassDB.xml
+++ b/doc/classes/ClassDB.xml
@@ -16,6 +16,14 @@
Returns [code]true[/code] if objects can be instantiated from the specified [param class], otherwise returns [code]false[/code].
</description>
</method>
+ <method name="class_call_static" qualifiers="vararg">
+ <return type="Variant" />
+ <param index="0" name="class" type="StringName" />
+ <param index="1" name="method" type="StringName" />
+ <description>
+ Calls a static method on a class.
+ </description>
+ </method>
<method name="class_exists" qualifiers="const">
<return type="bool" />
<param index="0" name="class" type="StringName" />
@@ -23,6 +31,13 @@
Returns whether the specified [param class] is available or not.
</description>
</method>
+ <method name="class_get_api_type" qualifiers="const">
+ <return type="int" enum="ClassDB.APIType" />
+ <param index="0" name="class" type="StringName" />
+ <description>
+ Returns the API type of [param class]. See [enum APIType].
+ </description>
+ </method>
<method name="class_get_enum_constants" qualifiers="const">
<return type="PackedStringArray" />
<param index="0" name="class" type="StringName" />
@@ -99,6 +114,14 @@
Returns the default value of [param property] of [param class] or its ancestor classes.
</description>
</method>
+ <method name="class_get_property_getter">
+ <return type="StringName" />
+ <param index="0" name="class" type="StringName" />
+ <param index="1" name="property" type="StringName" />
+ <description>
+ Returns the getter method name of [param property] of [param class].
+ </description>
+ </method>
<method name="class_get_property_list" qualifiers="const">
<return type="Dictionary[]" />
<param index="0" name="class" type="StringName" />
@@ -107,6 +130,14 @@
Returns an array with all the properties of [param class] or its ancestry if [param no_inheritance] is [code]false[/code].
</description>
</method>
+ <method name="class_get_property_setter">
+ <return type="StringName" />
+ <param index="0" name="class" type="StringName" />
+ <param index="1" name="property" type="StringName" />
+ <description>
+ Returns the setter method name of [param property] of [param class].
+ </description>
+ </method>
<method name="class_get_signal" qualifiers="const">
<return type="Dictionary" />
<param index="0" name="class" type="StringName" />
@@ -218,4 +249,21 @@
</description>
</method>
</methods>
+ <constants>
+ <constant name="API_CORE" value="0" enum="APIType">
+ Native Core class type.
+ </constant>
+ <constant name="API_EDITOR" value="1" enum="APIType">
+ Native Editor class type.
+ </constant>
+ <constant name="API_EXTENSION" value="2" enum="APIType">
+ GDExtension class type.
+ </constant>
+ <constant name="API_EDITOR_EXTENSION" value="3" enum="APIType">
+ GDExtension Editor class type.
+ </constant>
+ <constant name="API_NONE" value="4" enum="APIType">
+ Unknown class type.
+ </constant>
+ </constants>
</class>
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml
index d455799c29..136b8e5fc5 100644
--- a/doc/classes/CodeEdit.xml
+++ b/doc/classes/CodeEdit.xml
@@ -721,6 +721,9 @@
<theme_item name="can_fold_code_region" data_type="icon" type="Texture2D">
Sets a custom [Texture2D] to draw in the line folding gutter when a code region can be folded.
</theme_item>
+ <theme_item name="completion_color_bg" data_type="icon" type="Texture2D">
+ Background panel for the color preview box in autocompletion (visible when the color is translucent).
+ </theme_item>
<theme_item name="executing_line" data_type="icon" type="Texture2D">
Icon to draw in the executing gutter for executing lines.
</theme_item>
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index 3f0ccc0b5e..546d90fa3c 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -19,7 +19,7 @@
<return type="Color" />
<description>
Constructs a default [Color] from opaque black. This is the same as [constant BLACK].
- [b]Note:[/b] in C#, constructs an empty color with all of its components set to [code]0.0[/code] (transparent black).
+ [b]Note:[/b] In C#, this constructs a [Color] with all of its components set to [code]0.0[/code] (transparent black).
</description>
</constructor>
<constructor name="Color">
@@ -190,6 +190,7 @@
<param index="1" name="default" type="Color" />
<description>
Creates a [Color] from the given string, which can be either an HTML color code or a named color (case-insensitive). Returns [param default] if the color cannot be inferred from the string.
+ If you want to create a color from String in a constant expression, use the equivalent constructor instead (i.e. [code]Color("color string")[/code]).
</description>
</method>
<method name="get_luminance" qualifiers="const">
@@ -217,6 +218,7 @@
var my_color = new Color(0xbbefd2a4);
[/csharp]
[/codeblocks]
+ If you want to use hex notation in a constant expression, use the equivalent constructor instead (i.e. [code]Color(0xRRGGBBAA)[/code]).
</description>
</method>
<method name="hex64" qualifiers="static">
@@ -493,6 +495,15 @@
<member name="h" type="float" setter="" getter="" default="0.0">
The HSV hue of this color, on the range 0 to 1.
</member>
+ <member name="ok_hsl_h" type="float" setter="" getter="" default="0.0">
+ The OKHSL hue of this color, on the range 0 to 1.
+ </member>
+ <member name="ok_hsl_l" type="float" setter="" getter="" default="0.0">
+ The OKHSL lightness of this color, on the range 0 to 1.
+ </member>
+ <member name="ok_hsl_s" type="float" setter="" getter="" default="0.0">
+ The OKHSL saturation of this color, on the range 0 to 1.
+ </member>
<member name="r" type="float" setter="" getter="" default="0.0">
The color's red component, typically on the range of 0 to 1.
</member>
diff --git a/doc/classes/Compositor.xml b/doc/classes/Compositor.xml
index 7605083319..0732526957 100644
--- a/doc/classes/Compositor.xml
+++ b/doc/classes/Compositor.xml
@@ -7,6 +7,7 @@
The compositor resource stores attributes used to customize how a [Viewport] is rendered.
</description>
<tutorials>
+ <link title="The Compositor">$DOCS_URL/tutorials/rendering/compositor.html</link>
</tutorials>
<members>
<member name="compositor_effects" type="CompositorEffect[]" setter="set_compositor_effects" getter="get_compositor_effects" default="[]">
diff --git a/doc/classes/CompositorEffect.xml b/doc/classes/CompositorEffect.xml
index b05dc44cf6..8961e10f91 100644
--- a/doc/classes/CompositorEffect.xml
+++ b/doc/classes/CompositorEffect.xml
@@ -4,9 +4,10 @@
This resource allows for creating a custom rendering effect.
</brief_description>
<description>
- This resource defines a custom rendering effect that can be applied to [Viewport]s through the viewports' [Environment]. You can implement a callback that is called during rendering at a given stage of the rendering pipeline and allows you to insert additional passes. Note that this callback happens on the rendering thread.
+ This resource defines a custom rendering effect that can be applied to [Viewport]s through the viewports' [Environment]. You can implement a callback that is called during rendering at a given stage of the rendering pipeline and allows you to insert additional passes. Note that this callback happens on the rendering thread. CompositorEffect is an abstract base class and must be extended to implement specific rendering logic.
</description>
<tutorials>
+ <link title="The Compositor">$DOCS_URL/tutorials/rendering/compositor.html</link>
</tutorials>
<methods>
<method name="_render_callback" qualifiers="virtual">
@@ -56,6 +57,17 @@
var render_scene_buffers : RenderSceneBuffersRD = render_data.get_render_scene_buffers()
var roughness_buffer = render_scene_buffers.get_texture("forward_clustered", "normal_roughness")
[/codeblock]
+ The raw normal and roughness buffer is stored in an optimized format, different than the one available in Spatial shaders. When sampling the buffer, a conversion function must be applied. Use this function, copied from [url=https://github.com/godotengine/godot/blob/da5f39889f155658cef7f7ec3cc1abb94e17d815/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered_inc.glsl#L334-L341]here[/url]:
+ [codeblock]
+ vec4 normal_roughness_compatibility(vec4 p_normal_roughness) {
+ float roughness = p_normal_roughness.w;
+ if (roughness &gt; 0.5) {
+ roughness = 1.0 - roughness;
+ }
+ roughness /= (127.0 / 255.0);
+ return vec4(normalize(p_normal_roughness.xyz * 2.0 - 1.0) * 0.5 + 0.5, roughness);
+ }
+ [/codeblock]
</member>
<member name="needs_separate_specular" type="bool" setter="set_needs_separate_specular" getter="get_needs_separate_specular">
If [code]true[/code] this triggers specular data being rendered to a separate buffer and combined after effects have been applied, only applicable for the Forward+ renderer.
@@ -75,7 +87,7 @@
The callback is called before our transparent rendering pass, but after our sky is rendered and we've created our back buffers.
</constant>
<constant name="EFFECT_CALLBACK_TYPE_POST_TRANSPARENT" value="4" enum="EffectCallbackType">
- The callback is called after our transparent rendering pass, but before any build in post effects and output to our render target.
+ The callback is called after our transparent rendering pass, but before any built-in post-processing effects and output to our render target.
</constant>
<constant name="EFFECT_CALLBACK_TYPE_MAX" value="5" enum="EffectCallbackType">
Represents the size of the [enum EffectCallbackType] enum.
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index a0c76a3ad6..342e20759e 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -65,7 +65,7 @@
[csharp]
public override bool _CanDropData(Vector2 atPosition, Variant data)
{
- return data.VariantType == Variant.Type.Dictionary &amp;&amp; dict.AsGodotDictionary().ContainsKey("color");
+ return data.VariantType == Variant.Type.Dictionary &amp;&amp; data.AsGodotDictionary().ContainsKey("color");
}
public override void _DropData(Vector2 atPosition, Variant data)
@@ -120,8 +120,8 @@
<return type="void" />
<param index="0" name="event" type="InputEvent" />
<description>
- Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event].
- [b]Example usage for clicking a control:[/b]
+ Virtual method to be implemented by the user. Override this method to handle and accept inputs on UI elements. See also [method accept_event].
+ [b]Example:[/b] Click on the control to print a message:
[codeblocks]
[gdscript]
func _gui_input(event):
@@ -142,13 +142,13 @@
}
[/csharp]
[/codeblocks]
- The event won't trigger if:
- * clicking outside the control (see [method _has_point]);
- * control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE];
- * control is obstructed by another [Control] on top of it, which doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE];
- * control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event;
- * it happens outside the parent's rectangle and the parent has either [member clip_contents] enabled.
- [b]Note:[/b] Event position is relative to the control origin.
+ If the [param event] inherits [InputEventMouse], this method will [b]not[/b] be called when:
+ - the control's [member mouse_filter] is set to [constant MOUSE_FILTER_IGNORE];
+ - the control is obstructed by another control on top, that doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE];
+ - the control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event;
+ - the control's parent has [member clip_contents] enabled and the [param event]'s position is outside the parent's rectangle;
+ - the [param event]'s position is outside the control (see [method _has_point]).
+ [b]Note:[/b] The [param event]'s position is relative to this control's origin.
</description>
</method>
<method name="_has_point" qualifiers="virtual const">
@@ -168,8 +168,8 @@
The returned node must be of type [Control] or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When [code]null[/code] or a non-Control node is returned, the default tooltip will be used instead.
The returned node will be added as child to a [PopupPanel], so you should only provide the contents of that panel. That [PopupPanel] can be themed using [method Theme.set_stylebox] for the type [code]"TooltipPanel"[/code] (see [member tooltip_text] for an example).
[b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member custom_minimum_size] to some non-zero value.
- [b]Note:[/b] The node (and any relevant children) should be [member CanvasItem.visible] when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably.
- [b]Example of usage with a custom-constructed node:[/b]
+ [b]Note:[/b] The node (and any relevant children) should have their [member CanvasItem.visible] set to [code]true[/code] when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably.
+ [b]Example:[/b] Use a constructed node as a tooltip:
[codeblocks]
[gdscript]
func _make_custom_tooltip(for_text):
@@ -186,7 +186,7 @@
}
[/csharp]
[/codeblocks]
- [b]Example of usage with a custom scene instance:[/b]
+ [b]Example:[/b] Usa a scene instance as a tooltip:
[codeblocks]
[gdscript]
func _make_custom_tooltip(for_text):
@@ -228,7 +228,7 @@
<description>
Creates a local override for a theme [Color] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_color_override].
See also [method get_theme_color].
- [b]Example of overriding a label's color and resetting it later:[/b]
+ [b]Example:[/b] Override a [Label]'s color and reset it later:
[codeblocks]
[gdscript]
# Given the child Label node "MyLabel", override its font color with a custom value.
@@ -292,10 +292,10 @@
<description>
Creates a local override for a theme [StyleBox] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_stylebox_override].
See also [method get_theme_stylebox].
- [b]Example of modifying a property in a StyleBox by duplicating it:[/b]
+ [b]Example:[/b] Modify a property in a [StyleBox] by duplicating it:
[codeblocks]
[gdscript]
- # The snippet below assumes the child node MyButton has a StyleBoxFlat assigned.
+ # The snippet below assumes the child node "MyButton" has a StyleBoxFlat assigned.
# Resources are shared across instances, so we need to duplicate it
# to avoid modifying the appearance of all other buttons.
var new_stylebox_normal = $MyButton.get_theme_stylebox("normal").duplicate()
@@ -306,7 +306,7 @@
$MyButton.remove_theme_stylebox_override("normal")
[/gdscript]
[csharp]
- // The snippet below assumes the child node MyButton has a StyleBoxFlat assigned.
+ // The snippet below assumes the child node "MyButton" has a StyleBoxFlat assigned.
// Resources are shared across instances, so we need to duplicate it
// to avoid modifying the appearance of all other buttons.
StyleBoxFlat newStyleboxNormal = GetNode&lt;Button&gt;("MyButton").GetThemeStylebox("normal").Duplicate() as StyleBoxFlat;
@@ -446,7 +446,7 @@
<description>
Returns the position of this [Control] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.
Equals to [member global_position] if the window is embedded (see [member Viewport.gui_embed_subwindows]).
- [b]Example usage for showing a popup:[/b]
+ [b]Example:[/b] Show a popup at the mouse position:
[codeblock]
popup_menu.position = get_screen_position() + get_local_mouse_position()
popup_menu.reset_size()
@@ -559,7 +559,7 @@
<method name="grab_click_focus">
<return type="void" />
<description>
- Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control acquires focus.
+ Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control gains focus.
[codeblocks]
[gdscript]
func _process(delta):
@@ -809,9 +809,11 @@
<param index="1" name="can_drop_func" type="Callable" />
<param index="2" name="drop_func" type="Callable" />
<description>
- Forwards the handling of this control's [method _get_drag_data], [method _can_drop_data] and [method _drop_data] virtual functions to delegate callables.
- For each argument, if not empty, the delegate callable is used, otherwise the local (virtual) function is used.
- The function format for each callable should be exactly the same as the virtual functions described above.
+ Sets the given callables to be used instead of the control's own drag-and-drop virtual methods. If a callable is empty, its respective virtual method is used as normal.
+ The arguments for each callable should be exactly the same as their respective virtual methods, which would be:
+ - [param drag_func] corresponds to [method _get_drag_data] and requires a [Vector2];
+ - [param can_drop_func] corresponds to [method _can_drop_data] and requires both a [Vector2] and a [Variant];
+ - [param drop_func] corresponds to [method _drop_data] and requires both a [Vector2] and a [Variant].
</description>
</method>
<method name="set_drag_preview">
@@ -993,8 +995,9 @@
Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does.
</member>
<member name="mouse_force_pass_scroll_events" type="bool" setter="set_force_pass_scroll_events" getter="is_force_pass_scroll_events" default="true">
- When enabled, scroll wheel events processed by [method _gui_input] will be passed to the parent control even if [member mouse_filter] is set to [constant MOUSE_FILTER_STOP]. As it defaults to true, this allows nested scrollable containers to work out of the box.
+ When enabled, scroll wheel events processed by [method _gui_input] will be passed to the parent control even if [member mouse_filter] is set to [constant MOUSE_FILTER_STOP].
You should disable it on the root of your UI if you do not want scroll events to go to the [method Node._unhandled_input] processing.
+ [b]Note:[/b] Because this property defaults to [code]true[/code], this allows nested scrollable containers to work out of the box.
</member>
<member name="offset_bottom" type="float" setter="set_offset" getter="get_offset" default="0.0">
Distance between the node's bottom edge and its parent control, based on [member anchor_bottom].
@@ -1057,6 +1060,10 @@
[b]Note:[/b] To look up [Control]'s own items use various [code]get_theme_*[/code] methods without specifying [code]theme_type[/code].
[b]Note:[/b] Theme items are looked for in the tree order, from branch to root, where each [Control] node is checked for its [member theme] property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last.
</member>
+ <member name="tooltip_auto_translate_mode" type="int" setter="set_tooltip_auto_translate_mode" getter="get_tooltip_auto_translate_mode" enum="Node.AutoTranslateMode" default="0">
+ Defines if tooltip text should automatically change to its translated version depending on the current locale. Uses the same auto translate mode as this control when set to [constant Node.AUTO_TRANSLATE_MODE_INHERIT].
+ [b]Note:[/b] Tooltips customized using [method _make_custom_tooltip] do not use this auto translate mode automatically.
+ </member>
<member name="tooltip_text" type="String" setter="set_tooltip_text" getter="get_tooltip_text" default="&quot;&quot;">
The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. The time required for the tooltip to appear can be changed with the [member ProjectSettings.gui/timers/tooltip_delay_sec] option. See also [method get_tooltip].
The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding [method _make_custom_tooltip]. The default tooltip includes a [PopupPanel] and [Label] whose theme properties can be customized using [Theme] methods with the [code]"TooltipPanel"[/code] and [code]"TooltipLabel"[/code] respectively. For example:
@@ -1333,13 +1340,14 @@
Tells the parent [Container] to align the node with its end, either the bottom or the right edge. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical].
</constant>
<constant name="MOUSE_FILTER_STOP" value="0" enum="MouseFilter">
- The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls.
+ The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. The control will also receive the [signal mouse_entered] and [signal mouse_exited] signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls.
</constant>
<constant name="MOUSE_FILTER_PASS" value="1" enum="MouseFilter">
- The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. If no control handled it, the event will be passed to [method Node._shortcut_input] for further processing.
+ The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. The control will also receive the [signal mouse_entered] and [signal mouse_exited] signals.
+ If this control does not handle the event, the event will propagate up to its parent control if it has one. The event is bubbled up the node hierarchy until it reaches a non-[CanvasItem], a control with [constant MOUSE_FILTER_STOP], or a [CanvasItem] with [member CanvasItem.top_level] enabled. This will allow signals to fire in all controls it reaches. If no control handled it, the event will be passed to [method Node._shortcut_input] for further processing.
</constant>
<constant name="MOUSE_FILTER_IGNORE" value="2" enum="MouseFilter">
- The control will not receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. The control will also not receive the [signal mouse_entered] nor [signal mouse_exited] signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically.
+ The control will not receive any mouse movement input events nor mouse button input events through [method _gui_input]. The control will also not receive the [signal mouse_entered] nor [signal mouse_exited] signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. If a child has [constant MOUSE_FILTER_PASS] and an event was passed to this control, the event will further propagate up to the control's parent.
[b]Note:[/b] If the control has received [signal mouse_entered] but not [signal mouse_exited], changing the [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] will cause [signal mouse_exited] to be emitted.
</constant>
<constant name="GROW_DIRECTION_BEGIN" value="0" enum="GrowDirection">
@@ -1360,7 +1368,7 @@
<constant name="LAYOUT_DIRECTION_INHERITED" value="0" enum="LayoutDirection">
Automatic layout direction, determined from the parent control layout direction.
</constant>
- <constant name="LAYOUT_DIRECTION_LOCALE" value="1" enum="LayoutDirection">
+ <constant name="LAYOUT_DIRECTION_APPLICATION_LOCALE" value="1" enum="LayoutDirection">
Automatic layout direction, determined from the current locale.
</constant>
<constant name="LAYOUT_DIRECTION_LTR" value="2" enum="LayoutDirection">
@@ -1369,6 +1377,14 @@
<constant name="LAYOUT_DIRECTION_RTL" value="3" enum="LayoutDirection">
Right-to-left layout direction.
</constant>
+ <constant name="LAYOUT_DIRECTION_SYSTEM_LOCALE" value="4" enum="LayoutDirection">
+ Automatic layout direction, determined from the system locale.
+ </constant>
+ <constant name="LAYOUT_DIRECTION_MAX" value="5" enum="LayoutDirection">
+ Represents the size of the [enum LayoutDirection] enum.
+ </constant>
+ <constant name="LAYOUT_DIRECTION_LOCALE" value="1" enum="LayoutDirection" deprecated="Use [constant LAYOUT_DIRECTION_APPLICATION_LOCALE] instead.">
+ </constant>
<constant name="TEXT_DIRECTION_INHERITED" value="3" enum="TextDirection">
Text writing direction is the same as layout direction.
</constant>
diff --git a/doc/classes/Cubemap.xml b/doc/classes/Cubemap.xml
index b7da3c4ec6..8a850920f7 100644
--- a/doc/classes/Cubemap.xml
+++ b/doc/classes/Cubemap.xml
@@ -6,8 +6,27 @@
<description>
A cubemap is made of 6 textures organized in layers. They are typically used for faking reflections in 3D rendering (see [ReflectionProbe]). 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.
- To create such a texture file yourself, reimport your image files using the Godot Editor import presets.
- [b]Note:[/b] Godot doesn't support using cubemaps in 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 cubemap to an equirectangular sky map.
+ To create such a texture file yourself, reimport your image files using the Godot Editor import presets. The expected image order is X+, X-, Y+, Y-, Z+, Z- (in Godot's coordinate system, so Y+ is "up" and Z- is "forward"). You can use one of the following templates as a base:
+ - [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/cubemap_template_2x3.webp]2×3 cubemap template (default layout option)[/url]
+ - [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/cubemap_template_3x2.webp]3×2 cubemap template[/url]
+ - [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/cubemap_template_1x6.webp]1×6 cubemap template[/url]
+ - [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/cubemap_template_6x1.webp]6×1 cubemap template[/url]
+ [b]Note:[/b] Godot doesn't support using cubemaps in a [PanoramaSkyMaterial]. To use a cubemap as a skybox, convert the default [PanoramaSkyMaterial] to a [ShaderMaterial] using the [b]Convert to ShaderMaterial[/b] resource dropdown option, then replace its code with the following:
+ [codeblock lang=text]
+ shader_type sky;
+
+ uniform samplerCube source_panorama : filter_linear, source_color, hint_default_black;
+ uniform float exposure : hint_range(0, 128) = 1.0;
+
+ void sky() {
+ // If importing a cubemap from another engine, you may need to flip one of the `EYEDIR` components below
+ // by replacing it with `-EYEDIR`.
+ vec3 eyedir = vec3(EYEDIR.x, EYEDIR.y, EYEDIR.z);
+ COLOR = texture(source_panorama, eyedir).rgb * exposure;
+ }
+ [/codeblock]
+ After replacing the shader code and saving, specify the imported Cubemap resource in the Shader Parameters section of the ShaderMaterial in the inspector.
+ Alternatively, you can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this tool[/url] to convert a cubemap to an equirectangular sky map and use [PanoramaSkyMaterial] as usual.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml
index 0e75c65f50..6ce9616fb6 100644
--- a/doc/classes/Curve2D.xml
+++ b/doc/classes/Curve2D.xml
@@ -88,7 +88,7 @@
<param index="0" name="idx" type="int" />
<param index="1" name="t" type="float" />
<description>
- Returns the position between the vertex [param idx] and the vertex [code]idx + 1[/code], where [param t] controls if the point is the first vertex ([code]t = 0.0[/code]), the last vertex ([code]t = 1.0[/code]), or in between. Values of [param t] outside the range ([code]0.0 &gt;= t &lt;=1[/code]) give strange, but predictable results.
+ Returns the position between the vertex [param idx] and the vertex [code]idx + 1[/code], where [param t] controls if the point is the first vertex ([code]t = 0.0[/code]), the last vertex ([code]t = 1.0[/code]), or in between. Values of [param t] outside the range ([code]0.0 &lt;= t &lt;= 1.0[/code]) give strange, but predictable results.
If [param idx] is out of bounds it is truncated to the first or last vertex, and [param t] is ignored. If the curve has no points, the function sends an error to the console, and returns [code](0, 0)[/code].
</description>
</method>
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index cb59afd880..5c9b22fe4a 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -150,6 +150,19 @@
</constructor>
<constructor name="Dictionary">
<return type="Dictionary" />
+ <param index="0" name="base" type="Dictionary" />
+ <param index="1" name="key_type" type="int" />
+ <param index="2" name="key_class_name" type="StringName" />
+ <param index="3" name="key_script" type="Variant" />
+ <param index="4" name="value_type" type="int" />
+ <param index="5" name="value_class_name" type="StringName" />
+ <param index="6" name="value_script" type="Variant" />
+ <description>
+ Creates a typed dictionary from the [param base] dictionary. A typed dictionary can only contain keys and values of the given types, or that inherit from the given classes, as described by this constructor's parameters.
+ </description>
+ </constructor>
+ <constructor name="Dictionary">
+ <return type="Dictionary" />
<param index="0" name="from" type="Dictionary" />
<description>
Returns the same dictionary as [param from]. If you need a copy of the dictionary, use [method duplicate].
@@ -157,6 +170,13 @@
</constructor>
</constructors>
<methods>
+ <method name="assign">
+ <return type="void" />
+ <param index="0" name="dictionary" type="Dictionary" />
+ <description>
+ Assigns elements of another [param dictionary] into the dictionary. Resizes the dictionary to match [param dictionary]. Performs type conversions if the dictionary is typed.
+ </description>
+ </method>
<method name="clear">
<return type="void" />
<description>
@@ -202,6 +222,42 @@
Gets a value and ensures the key is set. If the [param key] exists in the dictionary, this behaves like [method get]. Otherwise, the [param default] value is inserted into the dictionary and returned.
</description>
</method>
+ <method name="get_typed_key_builtin" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the built-in [Variant] type of the typed dictionary's keys as a [enum Variant.Type] constant. If the keys are not typed, returns [constant TYPE_NIL]. See also [method is_typed_key].
+ </description>
+ </method>
+ <method name="get_typed_key_class_name" qualifiers="const">
+ <return type="StringName" />
+ <description>
+ Returns the [b]built-in[/b] class name of the typed dictionary's keys, if the built-in [Variant] type is [constant TYPE_OBJECT]. Otherwise, returns an empty [StringName]. See also [method is_typed_key] and [method Object.get_class].
+ </description>
+ </method>
+ <method name="get_typed_key_script" qualifiers="const">
+ <return type="Variant" />
+ <description>
+ Returns the [Script] instance associated with this typed dictionary's keys, or [code]null[/code] if it does not exist. See also [method is_typed_key].
+ </description>
+ </method>
+ <method name="get_typed_value_builtin" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the built-in [Variant] type of the typed dictionary's values as a [enum Variant.Type] constant. If the values are not typed, returns [constant TYPE_NIL]. See also [method is_typed_value].
+ </description>
+ </method>
+ <method name="get_typed_value_class_name" qualifiers="const">
+ <return type="StringName" />
+ <description>
+ Returns the [b]built-in[/b] class name of the typed dictionary's values, if the built-in [Variant] type is [constant TYPE_OBJECT]. Otherwise, returns an empty [StringName]. See also [method is_typed_value] and [method Object.get_class].
+ </description>
+ </method>
+ <method name="get_typed_value_script" qualifiers="const">
+ <return type="Variant" />
+ <description>
+ Returns the [Script] instance associated with this typed dictionary's values, or [code]null[/code] if it does not exist. See also [method is_typed_value].
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="key" type="Variant" />
@@ -284,6 +340,45 @@
Returns [code]true[/code] if the dictionary is read-only. See [method make_read_only]. Dictionaries are automatically read-only if declared with [code]const[/code] keyword.
</description>
</method>
+ <method name="is_same_typed" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="dictionary" type="Dictionary" />
+ <description>
+ Returns [code]true[/code] if the dictionary is typed the same as [param dictionary].
+ </description>
+ </method>
+ <method name="is_same_typed_key" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="dictionary" type="Dictionary" />
+ <description>
+ Returns [code]true[/code] if the dictionary's keys are typed the same as [param dictionary]'s keys.
+ </description>
+ </method>
+ <method name="is_same_typed_value" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="dictionary" type="Dictionary" />
+ <description>
+ Returns [code]true[/code] if the dictionary's values are typed the same as [param dictionary]'s values.
+ </description>
+ </method>
+ <method name="is_typed" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the dictionary is typed. Typed dictionaries can only store keys/values of their associated type and provide type safety for the [code][][/code] operator. Methods of typed dictionary still return [Variant].
+ </description>
+ </method>
+ <method name="is_typed_key" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the dictionary's keys are typed.
+ </description>
+ </method>
+ <method name="is_typed_value" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the dictionary's values are typed.
+ </description>
+ </method>
<method name="keys" qualifiers="const">
<return type="Array" />
<description>
@@ -355,7 +450,6 @@
# Prints { "fruit": "apple", "vegetable": "potato", "dressing": "vinegar" }
print(extra.merged(base, true))
[/codeblock]
- See also [method merge].
</description>
</method>
<method name="recursive_equal" qualifiers="const">
@@ -366,12 +460,26 @@
Returns [code]true[/code] if the two dictionaries contain the same keys and values, inner [Dictionary] and [Array] keys and values are compared recursively.
</description>
</method>
+ <method name="set">
+ <return type="bool" />
+ <param index="0" name="key" type="Variant" />
+ <param index="1" name="value" type="Variant" />
+ <description>
+ Sets the value of the element at the given [param key] to the given [param value]. This is the same as using the [code][][/code] operator ([code]array[index] = value[/code]).
+ </description>
+ </method>
<method name="size" qualifiers="const">
<return type="int" />
<description>
Returns the number of entries in the dictionary. Empty dictionaries ([code]{ }[/code]) always return [code]0[/code]. See also [method is_empty].
</description>
</method>
+ <method name="sort">
+ <return type="void" />
+ <description>
+ Sorts the dictionary in-place by key. This can be used to ensure dictionaries with the same contents produce equivalent results when getting the [method keys], getting the [method values], and converting to a string. This is also useful when wanting a JSON representation consistent with what is in memory, and useful for storing on a database that requires dictionaries to be sorted.
+ </description>
+ </method>
<method name="values" qualifiers="const">
<return type="Array" />
<description>
diff --git a/doc/classes/DirAccess.xml b/doc/classes/DirAccess.xml
index 9c71addf0c..dcd2d527e2 100644
--- a/doc/classes/DirAccess.xml
+++ b/doc/classes/DirAccess.xml
@@ -60,6 +60,7 @@
}
[/csharp]
[/codeblocks]
+ Keep in mind that file names may change or be remapped after export. If you want to see the actual resource file list as it appears in the editor, use [method ResourceLoader.list_directory] instead.
</description>
<tutorials>
<link title="File system">$DOCS_URL/tutorials/scripting/filesystem.html</link>
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index ff1c390b3c..dafa86d42e 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -20,6 +20,7 @@
<return type="Image" />
<description>
Returns the user's clipboard as an image if possible.
+ [b]Note:[/b] This method uses the copied pixel data, e.g. from a image editing software or a web browser, not an image file copied from file explorer.
</description>
</method>
<method name="clipboard_get_primary" qualifiers="const">
@@ -104,7 +105,7 @@
<param index="3" name="callback" type="Callable" />
<description>
Shows a text input dialog which uses the operating system's native look-and-feel. [param callback] should accept a single [String] parameter which contains the text field's contents.
- [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_INPUT] feature. Supported platforms include macOS and Windows.
+ [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_INPUT] feature. Supported platforms include macOS, Windows, and Android.
</description>
</method>
<method name="dialog_show">
@@ -138,11 +139,12 @@
<description>
Displays OS native dialog for selecting files or directories in the file system.
Each filter string in the [param filters] array should be formatted like this: [code]*.txt,*.doc;Text Files[/code]. The description text of the filter is optional and can be omitted. See also [member FileDialog.filters].
- Callbacks have the following arguments: [code]status: bool, selected_paths: PackedStringArray, selected_filter_index: int[/code].
- [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS.
+ Callbacks have the following arguments: [code]status: bool, selected_paths: PackedStringArray, selected_filter_index: int[/code]. [b]On Android,[/b] callback argument [code]selected_filter_index[/code] is always zero.
+ [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, macOS, and Android.
[b]Note:[/b] [param current_directory] might be ignored.
- [b]Note:[/b] On Linux, [param show_hidden] is ignored.
- [b]Note:[/b] On macOS, native file dialogs have no title.
+ [b]Note:[/b] On Android, the filter strings in the [param filters] array should be specified using MIME types, for example:[code]image/png, image/jpeg"[/code]. Additionally, the [param mode] [constant FILE_DIALOG_MODE_OPEN_ANY] is not supported on Android.
+ [b]Note:[/b] On Android and Linux, [param show_hidden] is ignored.
+ [b]Note:[/b] On Android and macOS, native file dialogs have no title.
[b]Note:[/b] On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use [method OS.get_granted_permissions] to get a list of saved bookmarks.
</description>
</method>
@@ -165,7 +167,7 @@
- [code]"values"[/code] - [PackedStringArray] of values. If empty, boolean option (check box) is used.
- [code]"default"[/code] - default selected option index ([int]) or default boolean value ([bool]).
Callbacks have the following arguments: [code]status: bool, selected_paths: PackedStringArray, selected_filter_index: int, selected_option: Dictionary[/code].
- [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS.
+ [b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE_EXTRA] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS.
[b]Note:[/b] [param current_directory] might be ignored.
[b]Note:[/b] On Linux (X11), [param show_hidden] is ignored.
[b]Note:[/b] On macOS, native file dialogs have no title.
@@ -183,7 +185,7 @@
<return type="Color" />
<description>
Returns OS theme accent color. Returns [code]Color(0, 0, 0, 0)[/code], if accent color is unknown.
- [b]Note:[/b] This method is implemented on macOS and Windows.
+ [b]Note:[/b] This method is implemented on macOS, Windows, and Android.
</description>
</method>
<method name="get_base_color" qualifiers="const">
@@ -879,6 +881,12 @@
Registers callables to emit when the menu is respectively about to show or closed. Callback methods should have zero arguments.
</description>
</method>
+ <method name="has_additional_outputs" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if any additional outputs have been registered via [method register_additional_output].
+ </description>
+ </method>
<method name="has_feature" qualifiers="const">
<return type="bool" />
<param index="0" name="feature" type="int" enum="DisplayServer.Feature" />
@@ -886,6 +894,13 @@
Returns [code]true[/code] if the specified [param feature] is supported by the current [DisplayServer], [code]false[/code] otherwise.
</description>
</method>
+ <method name="has_hardware_keyboard" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if hardware keyboard is connected.
+ [b]Note:[/b] This method is implemented on Android and iOS, on other platforms this method always returns [code]true[/code].
+ </description>
+ </method>
<method name="help_set_search_callbacks">
<return type="void" />
<param index="0" name="search_callback" type="Callable" />
@@ -1022,6 +1037,14 @@
Perform window manager processing, including input flushing. See also [method force_process_and_drop_events], [method Input.flush_buffered_events] and [member Input.use_accumulated_input].
</description>
</method>
+ <method name="register_additional_output">
+ <return type="void" />
+ <param index="0" name="object" type="Object" />
+ <description>
+ Registers an [Object] which represents an additional output that will be rendered too, beyond normal windows. The [Object] is only used as an identifier, which can be later passed to [method unregister_additional_output].
+ This can be used to prevent Godot from skipping rendering when no normal windows are visible.
+ </description>
+ </method>
<method name="screen_get_dpi" qualifiers="const">
<return type="int" />
<param index="0" name="screen" type="int" default="-1" />
@@ -1352,6 +1375,13 @@
[b]Note:[/b] [member ProjectSettings.audio/general/text_to_speech] should be [code]true[/code] to use text-to-speech.
</description>
</method>
+ <method name="unregister_additional_output">
+ <return type="void" />
+ <param index="0" name="object" type="Object" />
+ <description>
+ Unregisters an [Object] representing an additional output, that was registered via [method register_additional_output].
+ </description>
+ </method>
<method name="virtual_keyboard_get_height" qualifiers="const">
<return type="int" />
<description>
@@ -1654,6 +1684,7 @@
<param index="1" name="window_id" type="int" default="0" />
<description>
Sets window mode for the given window to [param mode]. See [enum WindowMode] for possible values and how each mode behaves.
+ [b]Note:[/b] On Android, setting it to [constant WINDOW_MODE_FULLSCREEN] or [constant WINDOW_MODE_EXCLUSIVE_FULLSCREEN] will enable immersive mode.
[b]Note:[/b] Setting the window to full screen forcibly sets the borderless flag to [code]true[/code], so make sure to set it back to [code]false[/code] when not wanted.
</description>
</method>
@@ -1750,7 +1781,7 @@
<param index="0" name="window_id" type="int" />
<param index="1" name="parent_window_id" type="int" />
<description>
- Sets window transient parent. Transient window is will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode.
+ Sets window transient parent. Transient window will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode.
[b]Note:[/b] It's recommended to change this value using [member Window.transient] instead.
[b]Note:[/b] The behavior might be different depending on the platform.
</description>
@@ -1859,7 +1890,10 @@
Display server supports spawning text input dialogs using the operating system's native look-and-feel. See [method dialog_input_text]. [b]Windows, macOS[/b]
</constant>
<constant name="FEATURE_NATIVE_DIALOG_FILE" value="25" enum="Feature">
- Display server supports spawning dialogs for selecting files or directories using the operating system's native look-and-feel. See [method file_dialog_show] and [method file_dialog_with_options_show]. [b]Windows, macOS, Linux (X11/Wayland)[/b]
+ Display server supports spawning dialogs for selecting files or directories using the operating system's native look-and-feel. See [method file_dialog_show]. [b]Windows, macOS, Linux (X11/Wayland), Android[/b]
+ </constant>
+ <constant name="FEATURE_NATIVE_DIALOG_FILE_EXTRA" value="26" enum="Feature">
+ The display server supports all features of [constant FEATURE_NATIVE_DIALOG_FILE], with the added functionality of Options and native dialog file access to [code]res://[/code] and [code]user://[/code] paths. See [method file_dialog_show] and [method file_dialog_with_options_show]. [b]Windows, macOS, Linux (X11/Wayland)[/b]
</constant>
<constant name="MOUSE_MODE_VISIBLE" value="0" enum="MouseMode">
Makes the mouse cursor visible if it is hidden.
@@ -2029,6 +2063,7 @@
<constant name="WINDOW_MODE_FULLSCREEN" value="3" enum="WindowMode">
Full screen mode with full multi-window support.
Full screen window covers the entire display area of a screen and has no decorations. The display's video mode is not changed.
+ [b]On Android:[/b] This enables immersive mode.
[b]On Windows:[/b] Multi-window full-screen mode has a 1px border of the [member ProjectSettings.rendering/environment/defaults/default_clear_color] color.
[b]On macOS:[/b] A new desktop is used to display the running project.
[b]Note:[/b] Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode.
@@ -2036,6 +2071,7 @@
<constant name="WINDOW_MODE_EXCLUSIVE_FULLSCREEN" value="4" enum="WindowMode">
A single window full screen mode. This mode has less overhead, but only one window can be open on a given screen at a time (opening a child window or application switching will trigger a full screen transition).
Full screen window covers the entire display area of a screen and has no border or decorations. The display's video mode is not changed.
+ [b]On Android:[/b] This enables immersive mode.
[b]On Windows:[/b] Depending on video driver, full screen transition might cause screens to go black for a moment.
[b]On macOS:[/b] A new desktop is used to display the running project. Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen.
[b]On Linux (X11):[/b] Exclusive full screen mode bypasses compositor.
@@ -2070,7 +2106,11 @@
<constant name="WINDOW_FLAG_MOUSE_PASSTHROUGH" value="7" enum="WindowFlags">
All mouse events are passed to the underlying window of the same application.
</constant>
- <constant name="WINDOW_FLAG_MAX" value="8" enum="WindowFlags">
+ <constant name="WINDOW_FLAG_SHARP_CORNERS" value="8" enum="WindowFlags">
+ Window style is overridden, forcing sharp corners.
+ [b]Note:[/b] This flag is implemented only on Windows (11).
+ </constant>
+ <constant name="WINDOW_FLAG_MAX" value="9" enum="WindowFlags">
Max value of the [enum WindowFlags].
</constant>
<constant name="WINDOW_EVENT_MOUSE_ENTER" value="0" enum="WindowEvent">
@@ -2116,12 +2156,14 @@
<constant name="DISPLAY_HANDLE" value="0" enum="HandleType">
Display handle:
- Linux (X11): [code]X11::Display*[/code] for the display.
+ - Linux (Wayland): [code]wl_display[/code] for the display.
- Android: [code]EGLDisplay[/code] for the display.
</constant>
<constant name="WINDOW_HANDLE" value="1" enum="HandleType">
Window handle:
- Windows: [code]HWND[/code] for the window.
- Linux (X11): [code]X11::Window*[/code] for the window.
+ - Linux (Wayland): [code]wl_surface[/code] for the window.
- macOS: [code]NSWindow*[/code] for the window.
- iOS: [code]UIViewController*[/code] for the view controller.
- Android: [code]jObject[/code] for the activity.
@@ -2136,9 +2178,20 @@
OpenGL context (only with the GL Compatibility renderer):
- Windows: [code]HGLRC[/code] for the window (native GL), or [code]EGLContext[/code] for the window (ANGLE).
- Linux (X11): [code]GLXContext*[/code] for the window.
+ - Linux (Wayland): [code]EGLContext[/code] for the window.
- macOS: [code]NSOpenGLContext*[/code] for the window (native GL), or [code]EGLContext[/code] for the window (ANGLE).
- Android: [code]EGLContext[/code] for the window.
</constant>
+ <constant name="EGL_DISPLAY" value="4" enum="HandleType">
+ - Windows: [code]EGLDisplay[/code] for the window (ANGLE).
+ - macOS: [code]EGLDisplay[/code] for the window (ANGLE).
+ - Linux (Wayland): [code]EGLDisplay[/code] for the window.
+ </constant>
+ <constant name="EGL_CONFIG" value="5" enum="HandleType">
+ - Windows: [code]EGLConfig[/code] for the window (ANGLE).
+ - macOS: [code]EGLConfig[/code] for the window (ANGLE).
+ - Linux (Wayland): [code]EGLConfig[/code] for the window.
+ </constant>
<constant name="TTS_UTTERANCE_STARTED" value="0" enum="TTSUtteranceEvent">
Utterance has begun to be spoken.
</constant>
diff --git a/doc/classes/EditorContextMenuPlugin.xml b/doc/classes/EditorContextMenuPlugin.xml
new file mode 100644
index 0000000000..fb90a2a5cd
--- /dev/null
+++ b/doc/classes/EditorContextMenuPlugin.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorContextMenuPlugin" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+ <brief_description>
+ Plugin for adding custom context menus in the editor.
+ </brief_description>
+ <description>
+ [EditorContextMenuPlugin] allows for the addition of custom options in the editor's context menu.
+ Currently, context menus are supported for three commonly used areas: the file system, scene tree, and editor script list panel.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="_popup_menu" qualifiers="virtual">
+ <return type="void" />
+ <param index="0" name="paths" type="PackedStringArray" />
+ <description>
+ Called when creating a context menu, custom options can be added by using the [method add_context_menu_item] or [method add_context_menu_item_from_shortcut] functions. [param paths] contains currently selected paths (depending on menu), which can be used to conditionally add options.
+ </description>
+ </method>
+ <method name="add_context_menu_item">
+ <return type="void" />
+ <param index="0" name="name" type="String" />
+ <param index="1" name="callback" type="Callable" />
+ <param index="2" name="icon" type="Texture2D" default="null" />
+ <description>
+ Add custom option to the context menu of the plugin's specified slot. When the option is activated, [param callback] will be called. Callback should take single [Array] argument; array contents depend on context menu slot.
+ [codeblock]
+ func _popup_menu(paths):
+ add_context_menu_item("File Custom options", handle, ICON)
+ [/codeblock]
+ If you want to assign shortcut to the menu item, use [method add_context_menu_item_from_shortcut] instead.
+ </description>
+ </method>
+ <method name="add_context_menu_item_from_shortcut">
+ <return type="void" />
+ <param index="0" name="name" type="String" />
+ <param index="1" name="shortcut" type="Shortcut" />
+ <param index="2" name="icon" type="Texture2D" default="null" />
+ <description>
+ Add custom option to the context menu of the plugin's specified slot. The option will have the [param shortcut] assigned and reuse its callback. The shortcut has to be registered beforehand with [method add_menu_shortcut].
+ [codeblock]
+ func _init():
+ add_menu_shortcut(SHORTCUT, handle)
+
+ func _popup_menu(paths):
+ add_context_menu_item_from_shortcut("File Custom options", SHORTCUT, ICON)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="add_context_submenu_item">
+ <return type="void" />
+ <param index="0" name="name" type="String" />
+ <param index="1" name="menu" type="PopupMenu" />
+ <param index="2" name="icon" type="Texture2D" default="null" />
+ <description>
+ Add a submenu to the context menu of the plugin's specified slot. The submenu is not automatically handled, you need to connect to its signals yourself. Also the submenu is freed on every popup, so provide a new [PopupMenu] every time.
+ [codeblock]
+ func _popup_menu(paths):
+ var popup_menu = PopupMenu.new()
+ popup_menu.add_item("Blue")
+ popup_menu.add_item("White")
+ popup_menu.id_pressed.connect(_on_color_submenu_option)
+
+ add_context_menu_item("Set Node Color", popup_menu)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="add_menu_shortcut">
+ <return type="void" />
+ <param index="0" name="shortcut" type="Shortcut" />
+ <param index="1" name="callback" type="Callable" />
+ <description>
+ Registers a shortcut associated with the plugin's context menu. This method should be called once (e.g. in plugin's [method Object._init]). [param callback] will be called when user presses the specified [param shortcut] while the menu's context is in effect (e.g. FileSystem dock is focused). Callback should take single [Array] argument; array contents depend on context menu slot.
+ [codeblock]
+ func _init():
+ add_menu_shortcut(SHORTCUT, handle)
+ [/codeblock]
+ </description>
+ </method>
+ </methods>
+ <constants>
+ <constant name="CONTEXT_SLOT_SCENE_TREE" value="0" enum="ContextMenuSlot">
+ Context menu of Scene dock. [method _popup_menu] will be called with a list of paths to currently selected nodes, while option callback will receive the list of currently selected nodes.
+ </constant>
+ <constant name="CONTEXT_SLOT_FILESYSTEM" value="1" enum="ContextMenuSlot">
+ Context menu of FileSystem dock. [method _popup_menu] and option callback will be called with list of paths of the currently selected files.
+ </constant>
+ <constant name="CONTEXT_SLOT_FILESYSTEM_CREATE" value="3" enum="ContextMenuSlot">
+ The "Create..." submenu of FileSystem dock's context menu. [method _popup_menu] and option callback will be called with list of paths of the currently selected files.
+ </constant>
+ <constant name="CONTEXT_SLOT_SCRIPT_EDITOR" value="2" enum="ContextMenuSlot">
+ Context menu of Scene dock. [method _popup_menu] will be called with the path to the currently edited script, while option callback will receive reference to that script.
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/EditorDebuggerPlugin.xml b/doc/classes/EditorDebuggerPlugin.xml
index a519e43bc6..d513a4fce0 100644
--- a/doc/classes/EditorDebuggerPlugin.xml
+++ b/doc/classes/EditorDebuggerPlugin.xml
@@ -15,18 +15,20 @@
class ExampleEditorDebugger extends EditorDebuggerPlugin:
- func _has_capture(prefix):
- # Return true if you wish to handle message with this prefix.
- return prefix == "my_plugin"
+ func _has_capture(capture):
+ # Return true if you wish to handle messages with the prefix "my_plugin:".
+ return capture == "my_plugin"
func _capture(message, data, session_id):
if message == "my_plugin:ping":
get_session(session_id).send_message("my_plugin:echo", data)
+ return true
+ return false
func _setup_session(session_id):
# Add a new tab in the debugger session UI containing a label.
var label = Label.new()
- label.name = "Example plugin"
+ label.name = "Example plugin" # Will be used as the tab title.
label.text = "Example plugin"
var session = get_session(session_id)
# Listens to the session started and stopped signals.
@@ -43,6 +45,24 @@
remove_debugger_plugin(debugger)
[/gdscript]
[/codeblocks]
+ To connect on the running game side, use the [EngineDebugger] singleton:
+ [codeblocks]
+ [gdscript]
+ extends Node
+
+ func _ready():
+ EngineDebugger.register_message_capture("my_plugin", _capture)
+ EngineDebugger.send_message("my_plugin:ping", ["test"])
+
+ func _capture(message, data):
+ # Note that the "my_plugin:" prefix is not used here.
+ if message == "echo":
+ prints("Echo received:", data)
+ return true
+ return false
+ [/gdscript]
+ [/codeblocks]
+ [b]Note:[/b] While the game is running, [method @GlobalScope.print] and similar functions [i]called in the editor[/i] do not print anything, the Output Log prints only game messages.
</description>
<tutorials>
</tutorials>
@@ -68,7 +88,7 @@
<param index="1" name="data" type="Array" />
<param index="2" name="session_id" type="int" />
<description>
- Override this method to process incoming messages. The [param session_id] is the ID of the [EditorDebuggerSession] that received the message (which you can retrieve via [method get_session]).
+ Override this method to process incoming messages. The [param session_id] is the ID of the [EditorDebuggerSession] that received the [param message]. Use [method get_session] to retrieve the session. This method should return [code]true[/code] if the message is recognized.
</description>
</method>
<method name="_goto_script_line" qualifiers="virtual">
@@ -90,7 +110,7 @@
<return type="void" />
<param index="0" name="session_id" type="int" />
<description>
- Override this method to be notified whenever a new [EditorDebuggerSession] is created (the session may be inactive during this stage).
+ Override this method to be notified whenever a new [EditorDebuggerSession] is created. Note that the session may be inactive during this stage.
</description>
</method>
<method name="get_session">
diff --git a/doc/classes/EditorDebuggerSession.xml b/doc/classes/EditorDebuggerSession.xml
index b4e754cc7e..f5fa3e34d5 100644
--- a/doc/classes/EditorDebuggerSession.xml
+++ b/doc/classes/EditorDebuggerSession.xml
@@ -14,7 +14,7 @@
<return type="void" />
<param index="0" name="control" type="Control" />
<description>
- Adds the given [param control] to the debug session UI in the debugger bottom panel.
+ Adds the given [param control] to the debug session UI in the debugger bottom panel. The [param control]'s node name will be used as the tab title.
</description>
</method>
<method name="is_active">
diff --git a/doc/classes/EditorExportPlatform.xml b/doc/classes/EditorExportPlatform.xml
index 0e5de79b25..8792bbedc3 100644
--- a/doc/classes/EditorExportPlatform.xml
+++ b/doc/classes/EditorExportPlatform.xml
@@ -11,11 +11,259 @@
<link title="Console support in Godot">$DOCS_URL/tutorials/platform/consoles.html</link>
</tutorials>
<methods>
+ <method name="add_message">
+ <return type="void" />
+ <param index="0" name="type" type="int" enum="EditorExportPlatform.ExportMessageType" />
+ <param index="1" name="category" type="String" />
+ <param index="2" name="message" type="String" />
+ <description>
+ Adds a message to the export log that will be displayed when exporting ends.
+ </description>
+ </method>
+ <method name="clear_messages">
+ <return type="void" />
+ <description>
+ Clears the export log.
+ </description>
+ </method>
+ <method name="create_preset">
+ <return type="EditorExportPreset" />
+ <description>
+ Create a new preset for this platform.
+ </description>
+ </method>
+ <method name="export_pack">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" default="0" />
+ <description>
+ Creates a PCK archive at [param path] for the specified [param preset].
+ </description>
+ </method>
+ <method name="export_pack_patch">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="patches" type="PackedStringArray" default="PackedStringArray()" />
+ <param index="4" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" default="0" />
+ <description>
+ Creates a patch PCK archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch.
+ [b]Note:[/b] [param patches] is an optional override of the set of patches defined in the export preset. When empty the patches defined in the export preset will be used instead.
+ </description>
+ </method>
+ <method name="export_project">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" default="0" />
+ <description>
+ Creates a full project at [param path] for the specified [param preset].
+ </description>
+ </method>
+ <method name="export_project_files">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="save_cb" type="Callable" />
+ <param index="3" name="shared_cb" type="Callable" default="Callable()" />
+ <description>
+ Exports project files for the specified preset. This method can be used to implement custom export format, other than PCK and ZIP. One of the callbacks is called for each exported file.
+ [param save_cb] is called for all exported files and have the following arguments: [code]file_path: String[/code], [code]file_data: PackedByteArray[/code], [code]file_index: int[/code], [code]file_count: int[/code], [code]encryption_include_filters: PackedStringArray[/code], [code]encryption_exclude_filters: PackedStringArray[/code], [code]encryption_key: PackedByteArray[/code].
+ [param shared_cb] is called for exported native shared/static libraries and have the following arguments: [code]file_path: String[/code], [code]tags: PackedStringArray[/code], [code]target_folder: String[/code].
+ [b]Note:[/b] [code]file_index[/code] and [code]file_count[/code] are intended for progress tracking only and aren't necesserely unique and precise.
+ </description>
+ </method>
+ <method name="export_zip">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" default="0" />
+ <description>
+ Create a ZIP archive at [param path] for the specified [param preset].
+ </description>
+ </method>
+ <method name="export_zip_patch">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="patches" type="PackedStringArray" default="PackedStringArray()" />
+ <param index="4" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" default="0" />
+ <description>
+ Create a patch ZIP archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch.
+ [b]Note:[/b] [param patches] is an optional override of the set of patches defined in the export preset. When empty the patches defined in the export preset will be used instead.
+ </description>
+ </method>
+ <method name="find_export_template" qualifiers="const">
+ <return type="Dictionary" />
+ <param index="0" name="template_file_name" type="String" />
+ <description>
+ Locates export template for the platform, and returns [Dictionary] with the following keys: [code]path: String[/code] and [code]error: String[/code]. This method is provided for convenience and custom export platforms aren't required to use it or keep export templates stored in the same way official templates are.
+ </description>
+ </method>
+ <method name="gen_export_flags">
+ <return type="PackedStringArray" />
+ <param index="0" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
+ <description>
+ Generates array of command line arguments for the default export templates for the debug flags and editor settings.
+ </description>
+ </method>
+ <method name="get_current_presets" qualifiers="const">
+ <return type="Array" />
+ <description>
+ Returns array of [EditorExportPreset]s for this platform.
+ </description>
+ </method>
+ <method name="get_forced_export_files" qualifiers="static">
+ <return type="PackedStringArray" />
+ <description>
+ Returns array of core file names that always should be exported regardless of preset config.
+ </description>
+ </method>
+ <method name="get_message_category" qualifiers="const">
+ <return type="String" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns message category, for the message with [param index].
+ </description>
+ </method>
+ <method name="get_message_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns number of messages in the export log.
+ </description>
+ </method>
+ <method name="get_message_text" qualifiers="const">
+ <return type="String" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns message text, for the message with [param index].
+ </description>
+ </method>
+ <method name="get_message_type" qualifiers="const">
+ <return type="int" enum="EditorExportPlatform.ExportMessageType" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns message type, for the message with [param index].
+ </description>
+ </method>
<method name="get_os_name" qualifiers="const">
<return type="String" />
<description>
Returns the name of the export operating system handled by this [EditorExportPlatform] class, as a friendly string. Possible return values are [code]Windows[/code], [code]Linux[/code], [code]macOS[/code], [code]Android[/code], [code]iOS[/code], and [code]Web[/code].
</description>
</method>
+ <method name="get_worst_message_type" qualifiers="const">
+ <return type="int" enum="EditorExportPlatform.ExportMessageType" />
+ <description>
+ Returns most severe message type currently present in the export log.
+ </description>
+ </method>
+ <method name="save_pack">
+ <return type="Dictionary" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="embed" type="bool" default="false" />
+ <description>
+ Saves PCK archive and returns [Dictionary] with the following keys: [code]result: Error[/code], [code]so_files: Array[/code] (array of the shared/static objects which contains dictionaries with the following keys: [code]path: String[/code], [code]tags: PackedStringArray[/code], and [code]target_folder: String[/code]).
+ If [param embed] is [code]true[/code], PCK content is appended to the end of [param path] file and return [Dictionary] additionally include following keys: [code]embedded_start: int[/code] (embedded PCK offset) and [code]embedded_size: int[/code] (embedded PCK size).
+ </description>
+ </method>
+ <method name="save_pack_patch">
+ <return type="Dictionary" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <description>
+ Saves patch PCK archive and returns [Dictionary] with the following keys: [code]result: Error[/code], [code]so_files: Array[/code] (array of the shared/static objects which contains dictionaries with the following keys: [code]path: String[/code], [code]tags: PackedStringArray[/code], and [code]target_folder: String[/code]).
+ </description>
+ </method>
+ <method name="save_zip">
+ <return type="Dictionary" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <description>
+ Saves ZIP archive and returns [Dictionary] with the following keys: [code]result: Error[/code], [code]so_files: Array[/code] (array of the shared/static objects which contains dictionaries with the following keys: [code]path: String[/code], [code]tags: PackedStringArray[/code], and [code]target_folder: String[/code]).
+ </description>
+ </method>
+ <method name="save_zip_patch">
+ <return type="Dictionary" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <description>
+ Saves patch ZIP archive and returns [Dictionary] with the following keys: [code]result: Error[/code], [code]so_files: Array[/code] (array of the shared/static objects which contains dictionaries with the following keys: [code]path: String[/code], [code]tags: PackedStringArray[/code], and [code]target_folder: String[/code]).
+ </description>
+ </method>
+ <method name="ssh_push_to_remote" qualifiers="const">
+ <return type="int" enum="Error" />
+ <param index="0" name="host" type="String" />
+ <param index="1" name="port" type="String" />
+ <param index="2" name="scp_args" type="PackedStringArray" />
+ <param index="3" name="src_file" type="String" />
+ <param index="4" name="dst_file" type="String" />
+ <description>
+ Uploads specified file over SCP protocol to the remote host.
+ </description>
+ </method>
+ <method name="ssh_run_on_remote" qualifiers="const">
+ <return type="int" enum="Error" />
+ <param index="0" name="host" type="String" />
+ <param index="1" name="port" type="String" />
+ <param index="2" name="ssh_arg" type="PackedStringArray" />
+ <param index="3" name="cmd_args" type="String" />
+ <param index="4" name="output" type="Array" default="[]" />
+ <param index="5" name="port_fwd" type="int" default="-1" />
+ <description>
+ Executes specified command on the remote host via SSH protocol and returns command output in the [param output].
+ </description>
+ </method>
+ <method name="ssh_run_on_remote_no_wait" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="host" type="String" />
+ <param index="1" name="port" type="String" />
+ <param index="2" name="ssh_args" type="PackedStringArray" />
+ <param index="3" name="cmd_args" type="String" />
+ <param index="4" name="port_fwd" type="int" default="-1" />
+ <description>
+ Executes specified command on the remote host via SSH protocol and returns process ID (on the remote host) without waiting for command to finish.
+ </description>
+ </method>
</methods>
+ <constants>
+ <constant name="EXPORT_MESSAGE_NONE" value="0" enum="ExportMessageType">
+ Invalid message type used as the default value when no type is specified.
+ </constant>
+ <constant name="EXPORT_MESSAGE_INFO" value="1" enum="ExportMessageType">
+ Message type for informational messages that have no effect on the export.
+ </constant>
+ <constant name="EXPORT_MESSAGE_WARNING" value="2" enum="ExportMessageType">
+ Message type for warning messages that should be addressed but still allow to complete the export.
+ </constant>
+ <constant name="EXPORT_MESSAGE_ERROR" value="3" enum="ExportMessageType">
+ Message type for error messages that must be addressed and fail the export.
+ </constant>
+ <constant name="DEBUG_FLAG_DUMB_CLIENT" value="1" enum="DebugFlags" is_bitfield="true">
+ Flag is set if remotely debugged project is expected to use remote file system. If set, [method gen_export_flags] will add [code]--remove-fs[/code] and [code]--remote-fs-password[/code] (if password is set in the editor settings) command line arguments to the list.
+ </constant>
+ <constant name="DEBUG_FLAG_REMOTE_DEBUG" value="2" enum="DebugFlags" is_bitfield="true">
+ Flag is set if remote debug is enabled. If set, [method gen_export_flags] will add [code]--remote-debug[/code] and [code]--breakpoints[/code] (if breakpoints are selected in the script editor or added by the plugin) command line arguments to the list.
+ </constant>
+ <constant name="DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST" value="4" enum="DebugFlags" is_bitfield="true">
+ Flag is set if remotely debugged project is running on the localhost. If set, [method gen_export_flags] will use [code]localhost[/code] instead of [member EditorSettings.network/debug/remote_host] as remote debugger host.
+ </constant>
+ <constant name="DEBUG_FLAG_VIEW_COLLISIONS" value="8" enum="DebugFlags" is_bitfield="true">
+ Flag is set if "Visible Collision Shapes" remote debug option is enabled. If set, [method gen_export_flags] will add [code]--debug-collisions[/code] command line arguments to the list.
+ </constant>
+ <constant name="DEBUG_FLAG_VIEW_NAVIGATION" value="16" enum="DebugFlags" is_bitfield="true">
+ Flag is set if Visible Navigation" remote debug option is enabled. If set, [method gen_export_flags] will add [code]--debug-navigation[/code] command line arguments to the list.
+ </constant>
+ </constants>
</class>
diff --git a/doc/classes/EditorExportPlatformExtension.xml b/doc/classes/EditorExportPlatformExtension.xml
new file mode 100644
index 0000000000..f2d14b1710
--- /dev/null
+++ b/doc/classes/EditorExportPlatformExtension.xml
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorExportPlatformExtension" inherits="EditorExportPlatform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+ <brief_description>
+ Base class for custom [EditorExportPlatform] implementations (plugins).
+ </brief_description>
+ <description>
+ External [EditorExportPlatform] implementations should inherit from this class.
+ To use [EditorExportPlatform], register it using the [method EditorPlugin.add_export_platform] method first.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="_can_export" qualifiers="virtual const">
+ <return type="bool" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <description>
+ [b]Optional.[/b]
+ Returns [code]true[/code], if specified [param preset] is valid and can be exported. Use [method set_config_error] and [method set_config_missing_templates] to set error details.
+ Usual implementation can call [method _has_valid_export_configuration] and [method _has_valid_project_configuration] to determine if export is possible.
+ </description>
+ </method>
+ <method name="_cleanup" qualifiers="virtual">
+ <return type="void" />
+ <description>
+ [b]Optional.[/b]
+ Called by the editor before platform is unregistered.
+ </description>
+ </method>
+ <method name="_export_pack" qualifiers="virtual">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
+ <description>
+ [b]Optional.[/b]
+ Creates a PCK archive at [param path] for the specified [param preset].
+ This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" disabled, and PCK is selected as a file type.
+ </description>
+ </method>
+ <method name="_export_pack_patch" qualifiers="virtual">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="patches" type="PackedStringArray" />
+ <param index="4" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
+ <description>
+ [b]Optional.[/b]
+ Creates a patch PCK archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch.
+ This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" enabled, and PCK is selected as a file type.
+ [b]Note:[/b] The patches provided in [param patches] have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead.
+ </description>
+ </method>
+ <method name="_export_project" qualifiers="virtual">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
+ <description>
+ [b]Required.[/b]
+ Creates a full project at [param path] for the specified [param preset].
+ This method is called when "Export" button is pressed in the export dialog.
+ This method implementation can call [method EditorExportPlatform.save_pack] or [method EditorExportPlatform.save_zip] to use default PCK/ZIP export process, or calls [method EditorExportPlatform.export_project_files] and implement custom callback for processing each exported file.
+ </description>
+ </method>
+ <method name="_export_zip" qualifiers="virtual">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
+ <description>
+ [b]Optional.[/b]
+ Create a ZIP archive at [param path] for the specified [param preset].
+ This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" disabled, and ZIP is selected as a file type.
+ </description>
+ </method>
+ <method name="_export_zip_patch" qualifiers="virtual">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <param index="2" name="path" type="String" />
+ <param index="3" name="patches" type="PackedStringArray" />
+ <param index="4" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
+ <description>
+ [b]Optional.[/b]
+ Create a ZIP archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch.
+ This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" enabled, and ZIP is selected as a file type.
+ [b]Note:[/b] The patches provided in [param patches] have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead.
+ </description>
+ </method>
+ <method name="_get_binary_extensions" qualifiers="virtual const">
+ <return type="PackedStringArray" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <description>
+ [b]Required.[/b]
+ Returns array of supported binary extensions for the full project export.
+ </description>
+ </method>
+ <method name="_get_debug_protocol" qualifiers="virtual const">
+ <return type="String" />
+ <description>
+ [b]Optional.[/b]
+ Returns protocol used for remote debugging. Default implementation return [code]tcp://[/code].
+ </description>
+ </method>
+ <method name="_get_device_architecture" qualifiers="virtual const">
+ <return type="String" />
+ <param index="0" name="device" type="int" />
+ <description>
+ [b]Optional.[/b]
+ Returns device architecture for one-click deploy.
+ </description>
+ </method>
+ <method name="_get_export_option_visibility" qualifiers="virtual const">
+ <return type="bool" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="option" type="String" />
+ <description>
+ [b]Optional.[/b]
+ Validates [param option] and returns visibility for the specified [param preset]. Default implementation return [code]true[/code] for all options.
+ </description>
+ </method>
+ <method name="_get_export_option_warning" qualifiers="virtual const">
+ <return type="String" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="option" type="StringName" />
+ <description>
+ [b]Optional.[/b]
+ Validates [param option] and returns warning message for the specified [param preset]. Default implementation return empty string for all options.
+ </description>
+ </method>
+ <method name="_get_export_options" qualifiers="virtual const">
+ <return type="Dictionary[]" />
+ <description>
+ [b]Optional.[/b]
+ Returns a property list, as an [Array] of dictionaries. Each [Dictionary] must at least contain the [code]name: StringName[/code] and [code]type: Variant.Type[/code] entries.
+ Additionally, the following keys are supported:
+ - [code]hint: PropertyHint[/code]
+ - [code]hint_string: String[/code]
+ - [code]usage: PropertyUsageFlags[/code]
+ - [code]class_name: StringName[/code]
+ - [code]default_value: Variant[/code], default value of the property.
+ - [code]update_visibility: bool[/code], if set to [code]true[/code], [method _get_export_option_visibility] is called for each property when this property is changed.
+ - [code]required: bool[/code], if set to [code]true[/code], this property warnings are critical, and should be resolved to make export possible. This value is a hint for the [method _has_valid_export_configuration] implementation, and not used by the engine directly.
+ See also [method Object._get_property_list].
+ </description>
+ </method>
+ <method name="_get_logo" qualifiers="virtual const">
+ <return type="Texture2D" />
+ <description>
+ [b]Required.[/b]
+ Returns platform logo displayed in the export dialog, logo should be 32x32 adjusted to the current editor scale, see [method EditorInterface.get_editor_scale].
+ </description>
+ </method>
+ <method name="_get_name" qualifiers="virtual const">
+ <return type="String" />
+ <description>
+ [b]Required.[/b]
+ Returns export platform name.
+ </description>
+ </method>
+ <method name="_get_option_icon" qualifiers="virtual const">
+ <return type="ImageTexture" />
+ <param index="0" name="device" type="int" />
+ <description>
+ [b]Optional.[/b]
+ Returns one-click deploy menu item icon for the specified [param device], icon should be 16x16 adjusted to the current editor scale, see [method EditorInterface.get_editor_scale].
+ </description>
+ </method>
+ <method name="_get_option_label" qualifiers="virtual const">
+ <return type="String" />
+ <param index="0" name="device" type="int" />
+ <description>
+ [b]Optional.[/b]
+ Returns one-click deploy menu item label for the specified [param device].
+ </description>
+ </method>
+ <method name="_get_option_tooltip" qualifiers="virtual const">
+ <return type="String" />
+ <param index="0" name="device" type="int" />
+ <description>
+ [b]Optional.[/b]
+ Returns one-click deploy menu item tooltip for the specified [param device].
+ </description>
+ </method>
+ <method name="_get_options_count" qualifiers="virtual const">
+ <return type="int" />
+ <description>
+ [b]Optional.[/b]
+ Returns number one-click deploy devices (or other one-click option displayed in the menu).
+ </description>
+ </method>
+ <method name="_get_options_tooltip" qualifiers="virtual const">
+ <return type="String" />
+ <description>
+ [b]Optional.[/b]
+ Returns tooltip of the one-click deploy menu button.
+ </description>
+ </method>
+ <method name="_get_os_name" qualifiers="virtual const">
+ <return type="String" />
+ <description>
+ [b]Required.[/b]
+ Returns target OS name.
+ </description>
+ </method>
+ <method name="_get_platform_features" qualifiers="virtual const">
+ <return type="PackedStringArray" />
+ <description>
+ [b]Required.[/b]
+ Returns array of platform specific features.
+ </description>
+ </method>
+ <method name="_get_preset_features" qualifiers="virtual const">
+ <return type="PackedStringArray" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <description>
+ [b]Required.[/b]
+ Returns array of platform specific features for the specified [param preset].
+ </description>
+ </method>
+ <method name="_get_run_icon" qualifiers="virtual const">
+ <return type="Texture2D" />
+ <description>
+ [b]Optional.[/b]
+ Returns icon of the one-click deploy menu button, icon should be 16x16 adjusted to the current editor scale, see [method EditorInterface.get_editor_scale].
+ </description>
+ </method>
+ <method name="_has_valid_export_configuration" qualifiers="virtual const">
+ <return type="bool" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="debug" type="bool" />
+ <description>
+ [b]Required.[/b]
+ Returns [code]true[/code] if export configuration is valid.
+ </description>
+ </method>
+ <method name="_has_valid_project_configuration" qualifiers="virtual const">
+ <return type="bool" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <description>
+ [b]Required.[/b]
+ Returns [code]true[/code] if project configuration is valid.
+ </description>
+ </method>
+ <method name="_is_executable" qualifiers="virtual const">
+ <return type="bool" />
+ <param index="0" name="path" type="String" />
+ <description>
+ [b]Optional.[/b]
+ Returns [code]true[/code] if specified file is a valid executable (native executable or script) for the target platform.
+ </description>
+ </method>
+ <method name="_poll_export" qualifiers="virtual">
+ <return type="bool" />
+ <description>
+ [b]Optional.[/b]
+ Returns [code]true[/code] if one-click deploy options are changed and editor interface should be updated.
+ </description>
+ </method>
+ <method name="_run" qualifiers="virtual">
+ <return type="int" enum="Error" />
+ <param index="0" name="preset" type="EditorExportPreset" />
+ <param index="1" name="device" type="int" />
+ <param index="2" name="debug_flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
+ <description>
+ [b]Optional.[/b]
+ This method is called when [param device] one-click deploy menu option is selected.
+ Implementation should export project to a temporary location, upload and run it on the specific [param device], or perform another action associated with the menu item.
+ </description>
+ </method>
+ <method name="_should_update_export_options" qualifiers="virtual">
+ <return type="bool" />
+ <description>
+ [b]Optional.[/b]
+ Returns [code]true[/code] if export options list is changed and presets should be updated.
+ </description>
+ </method>
+ <method name="get_config_error" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns current configuration error message text. This method should be called only from the [method _can_export], [method _has_valid_export_configuration], or [method _has_valid_project_configuration] implementations.
+ </description>
+ </method>
+ <method name="get_config_missing_templates" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] is export templates are missing from the current configuration. This method should be called only from the [method _can_export], [method _has_valid_export_configuration], or [method _has_valid_project_configuration] implementations.
+ </description>
+ </method>
+ <method name="set_config_error" qualifiers="const">
+ <return type="void" />
+ <param index="0" name="error_text" type="String" />
+ <description>
+ Sets current configuration error message text. This method should be called only from the [method _can_export], [method _has_valid_export_configuration], or [method _has_valid_project_configuration] implementations.
+ </description>
+ </method>
+ <method name="set_config_missing_templates" qualifiers="const">
+ <return type="void" />
+ <param index="0" name="missing_templates" type="bool" />
+ <description>
+ Set to [code]true[/code] is export templates are missing from the current configuration. This method should be called only from the [method _can_export], [method _has_valid_export_configuration], or [method _has_valid_project_configuration] implementations.
+ </description>
+ </method>
+ </methods>
+</class>
diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml
index 3e2b3ea111..23e3f4139c 100644
--- a/doc/classes/EditorExportPlugin.xml
+++ b/doc/classes/EditorExportPlugin.xml
@@ -17,7 +17,7 @@
<param index="1" name="features" type="PackedStringArray" />
<description>
Return [code]true[/code] if this plugin will customize resources based on the platform and features used.
- When enabled, [method _get_customization_configuration_hash], [method _customize_resource] and [method _customize_scene] will be called and must be implemented.
+ When enabled, [method _get_customization_configuration_hash] and [method _customize_resource] will be called and must be implemented.
</description>
</method>
<method name="_begin_customize_scenes" qualifiers="virtual const">
@@ -25,7 +25,9 @@
<param index="0" name="platform" type="EditorExportPlatform" />
<param index="1" name="features" type="PackedStringArray" />
<description>
- Return true if this plugin will customize scenes based on the platform and features used.
+ Return [code]true[/code] if this plugin will customize scenes based on the platform and features used.
+ When enabled, [method _get_customization_configuration_hash] and [method _customize_scene] will be called and must be implemented.
+ [b]Note:[/b] [method _customize_scene] will only be called for scenes that have been modified since the last export.
</description>
</method>
<method name="_customize_resource" qualifiers="virtual">
@@ -33,9 +35,16 @@
<param index="0" name="resource" type="Resource" />
<param index="1" name="path" type="String" />
<description>
- Customize a resource. If changes are made to it, return the same or a new resource. Otherwise, return [code]null[/code].
- The [i]path[/i] argument is only used when customizing an actual file, otherwise this means that this resource is part of another one and it will be empty.
+ Customize a resource. If changes are made to it, return the same or a new resource. Otherwise, return [code]null[/code]. When a new resource is returned, [param resource] will be replaced by a copy of the new resource.
+ The [param path] argument is only used when customizing an actual file, otherwise this means that this resource is part of another one and it will be empty.
Implementing this method is required if [method _begin_customize_resources] returns [code]true[/code].
+ [b]Note:[/b] When customizing any of the following types and returning another resource, the other resource should not be skipped using [method skip] in [method _export_file]:
+ - [AtlasTexture]
+ - [CompressedCubemap]
+ - [CompressedCubemapArray]
+ - [CompressedTexture2D]
+ - [CompressedTexture2DArray]
+ - [CompressedTexture3D]
</description>
</method>
<method name="_customize_scene" qualifiers="virtual">
@@ -81,7 +90,7 @@
<param index="1" name="type" type="String" />
<param index="2" name="features" type="PackedStringArray" />
<description>
- Virtual method to be overridden by the user. Called for each exported file, providing arguments that can be used to identify the file. [param path] is the path of the file, [param type] is the [Resource] represented by the file (e.g. [PackedScene]) and [param features] is the list of features for the export.
+ Virtual method to be overridden by the user. Called for each exported file before [method _customize_resource] and [method _customize_scene]. The arguments can be used to identify the file. [param path] is the path of the file, [param type] is the [Resource] represented by the file (e.g. [PackedScene]), and [param features] is the list of features for the export.
Calling [method skip] inside this callback will make the file not included in the export.
</description>
</method>
@@ -158,6 +167,15 @@
Return a [PackedStringArray] of additional features this preset, for the given [param platform], should have.
</description>
</method>
+ <method name="_get_export_option_visibility" qualifiers="virtual const">
+ <return type="bool" />
+ <param index="0" name="platform" type="EditorExportPlatform" />
+ <param index="1" name="option" type="String" />
+ <description>
+ [b]Optional.[/b]
+ Validates [param option] and returns the visibility for the specified [param platform]. The default implementation returns [code]true[/code] for all options.
+ </description>
+ </method>
<method name="_get_export_option_warning" qualifiers="virtual const">
<return type="String" />
<param index="0" name="platform" type="EditorExportPlatform" />
@@ -231,6 +249,7 @@
<description>
Adds a custom file to be exported. [param path] is the virtual path that can be used to load the file, [param file] is the binary data of the file.
When called inside [method _export_file] and [param remap] is [code]true[/code], the current file will not be exported, but instead remapped to this custom file. [param remap] is ignored when called in other places.
+ [param file] will not be imported, so consider using [method _customize_resource] to remap imported resources.
</description>
</method>
<method name="add_ios_bundle_file">
@@ -303,6 +322,18 @@
In case of a directory code-sign will error if you place non code object in directory.
</description>
</method>
+ <method name="get_export_platform" qualifiers="const">
+ <return type="EditorExportPlatform" />
+ <description>
+ Returns currently used export platform.
+ </description>
+ </method>
+ <method name="get_export_preset" qualifiers="const">
+ <return type="EditorExportPreset" />
+ <description>
+ Returns currently used export preset.
+ </description>
+ </method>
<method name="get_option" qualifiers="const">
<return type="Variant" />
<param index="0" name="name" type="StringName" />
@@ -313,7 +344,7 @@
<method name="skip">
<return type="void" />
<description>
- To be called inside [method _export_file], [method _customize_resource], or [method _customize_scene]. Skips the current file, so it's not included in the export.
+ To be called inside [method _export_file]. Skips the current file, so it's not included in the export.
</description>
</method>
</methods>
diff --git a/doc/classes/EditorExportPreset.xml b/doc/classes/EditorExportPreset.xml
new file mode 100644
index 0000000000..314f74340a
--- /dev/null
+++ b/doc/classes/EditorExportPreset.xml
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorExportPreset" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+ <brief_description>
+ Export preset configuration.
+ </brief_description>
+ <description>
+ Export preset configuration. Instances of [EditorExportPreset] by editor UI and intended to be used a read-only configuration passed to the [EditorExportPlatform] methods when exporting the project.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="are_advanced_options_enabled" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code], is "Advanced" toggle is enabled in the export dialog.
+ </description>
+ </method>
+ <method name="get_custom_features" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns string with a comma separated list of custom features.
+ </description>
+ </method>
+ <method name="get_customized_files" qualifiers="const">
+ <return type="Dictionary" />
+ <description>
+ Returns [Dictionary] of files selected in the "Resources" tab of the export dialog. Dictionary keys are file names and values are export mode - [code]"strip[/code], [code]"keep"[/code], or [code]"remove"[/code]. See also [method get_file_export_mode].
+ </description>
+ </method>
+ <method name="get_customized_files_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns number of files selected in the "Resources" tab of the export dialog.
+ </description>
+ </method>
+ <method name="get_encrypt_directory" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code], PCK directory encryption is enabled in the export dialog.
+ </description>
+ </method>
+ <method name="get_encrypt_pck" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code], PCK encryption is enabled in the export dialog.
+ </description>
+ </method>
+ <method name="get_encryption_ex_filter" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns file filters to exclude during PCK encryption.
+ </description>
+ </method>
+ <method name="get_encryption_in_filter" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns file filters to include during PCK encryption.
+ </description>
+ </method>
+ <method name="get_encryption_key" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns PCK encryption key.
+ </description>
+ </method>
+ <method name="get_exclude_filter" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns file filters to exclude during export.
+ </description>
+ </method>
+ <method name="get_export_filter" qualifiers="const">
+ <return type="int" enum="EditorExportPreset.ExportFilter" />
+ <description>
+ Returns export file filter mode selected in the "Resources" tab of the export dialog.
+ </description>
+ </method>
+ <method name="get_export_path" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns export target path.
+ </description>
+ </method>
+ <method name="get_file_export_mode" qualifiers="const">
+ <return type="int" enum="EditorExportPreset.FileExportMode" />
+ <param index="0" name="path" type="String" />
+ <param index="1" name="default" type="int" enum="EditorExportPreset.FileExportMode" default="0" />
+ <description>
+ Returns file export mode for the specified file.
+ </description>
+ </method>
+ <method name="get_files_to_export" qualifiers="const">
+ <return type="PackedStringArray" />
+ <description>
+ Returns array of files to export.
+ </description>
+ </method>
+ <method name="get_include_filter" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns file filters to include during export.
+ </description>
+ </method>
+ <method name="get_or_env" qualifiers="const">
+ <return type="Variant" />
+ <param index="0" name="name" type="StringName" />
+ <param index="1" name="env_var" type="String" />
+ <description>
+ Returns export option value or value of environment variable if it is set.
+ </description>
+ </method>
+ <method name="get_patches" qualifiers="const">
+ <return type="PackedStringArray" />
+ <description>
+ Returns the list of packs on which to base a patch export on.
+ </description>
+ </method>
+ <method name="get_preset_name" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns export preset name.
+ </description>
+ </method>
+ <method name="get_script_export_mode" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns script export mode.
+ </description>
+ </method>
+ <method name="get_version" qualifiers="const">
+ <return type="String" />
+ <param index="0" name="name" type="StringName" />
+ <param index="1" name="windows_version" type="bool" />
+ <description>
+ Returns the preset's version number, or fall back to the [member ProjectSettings.application/config/version] project setting if set to an empty string.
+ If [param windows_version] is [code]true[/code], formats the returned version number to be compatible with Windows executable metadata.
+ </description>
+ </method>
+ <method name="has" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="property" type="StringName" />
+ <description>
+ Returns [code]true[/code] if preset has specified property.
+ </description>
+ </method>
+ <method name="has_export_file">
+ <return type="bool" />
+ <param index="0" name="path" type="String" />
+ <description>
+ Returns [code]true[/code] if specified file is exported.
+ </description>
+ </method>
+ <method name="is_dedicated_server" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if dedicated server export mode is selected in the export dialog.
+ </description>
+ </method>
+ <method name="is_runnable" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if "Runnable" toggle is enabled in the export dialog.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ <constant name="EXPORT_ALL_RESOURCES" value="0" enum="ExportFilter">
+ </constant>
+ <constant name="EXPORT_SELECTED_SCENES" value="1" enum="ExportFilter">
+ </constant>
+ <constant name="EXPORT_SELECTED_RESOURCES" value="2" enum="ExportFilter">
+ </constant>
+ <constant name="EXCLUDE_SELECTED_RESOURCES" value="3" enum="ExportFilter">
+ </constant>
+ <constant name="EXPORT_CUSTOMIZED" value="4" enum="ExportFilter">
+ </constant>
+ <constant name="MODE_FILE_NOT_CUSTOMIZED" value="0" enum="FileExportMode">
+ </constant>
+ <constant name="MODE_FILE_STRIP" value="1" enum="FileExportMode">
+ </constant>
+ <constant name="MODE_FILE_KEEP" value="2" enum="FileExportMode">
+ </constant>
+ <constant name="MODE_FILE_REMOVE" value="3" enum="FileExportMode">
+ </constant>
+ <constant name="MODE_SCRIPT_TEXT" value="0" enum="ScriptExportMode">
+ </constant>
+ <constant name="MODE_SCRIPT_BINARY_TOKENS" value="1" enum="ScriptExportMode">
+ </constant>
+ <constant name="MODE_SCRIPT_BINARY_TOKENS_COMPRESSED" value="2" enum="ScriptExportMode">
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/EditorFeatureProfile.xml b/doc/classes/EditorFeatureProfile.xml
index 3aa1e63aac..c125c923ef 100644
--- a/doc/classes/EditorFeatureProfile.xml
+++ b/doc/classes/EditorFeatureProfile.xml
@@ -121,7 +121,10 @@
<constant name="FEATURE_HISTORY_DOCK" value="7" enum="Feature">
The History dock. If this feature is disabled, the History dock won't be visible.
</constant>
- <constant name="FEATURE_MAX" value="8" enum="Feature">
+ <constant name="FEATURE_GAME" value="8" enum="Feature">
+ The Game tab, which allows embedding the game window and selecting nodes by clicking inside of it. If this feature is disabled, the Game tab won't display.
+ </constant>
+ <constant name="FEATURE_MAX" value="9" enum="Feature">
Represents the size of the [enum Feature] enum.
</constant>
</constants>
diff --git a/doc/classes/EditorFileSystem.xml b/doc/classes/EditorFileSystem.xml
index 08b40c7800..06fa4be2c8 100644
--- a/doc/classes/EditorFileSystem.xml
+++ b/doc/classes/EditorFileSystem.xml
@@ -84,6 +84,12 @@
Emitted if a resource is reimported.
</description>
</signal>
+ <signal name="resources_reimporting">
+ <param index="0" name="resources" type="PackedStringArray" />
+ <description>
+ Emitted before a resource is reimported.
+ </description>
+ </signal>
<signal name="resources_reload">
<param index="0" name="resources" type="PackedStringArray" />
<description>
diff --git a/doc/classes/EditorFileSystemImportFormatSupportQuery.xml b/doc/classes/EditorFileSystemImportFormatSupportQuery.xml
index b1a810fe6e..fc2feca911 100644
--- a/doc/classes/EditorFileSystemImportFormatSupportQuery.xml
+++ b/doc/classes/EditorFileSystemImportFormatSupportQuery.xml
@@ -24,7 +24,7 @@
<method name="_query" qualifiers="virtual const">
<return type="bool" />
<description>
- Query support. Return false if import must not continue.
+ Query support. Return [code]false[/code] if import must not continue.
</description>
</method>
</methods>
diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index 88a6eeec26..186f249281 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -98,18 +98,18 @@
};
}
- public override int _Import(string sourceFile, string savePath, Godot.Collections.Dictionary options, Godot.Collections.Array&lt;string&gt; platformVariants, Godot.Collections.Array&lt;string&gt; genFiles)
+ public override Error _Import(string sourceFile, string savePath, Godot.Collections.Dictionary options, Godot.Collections.Array&lt;string&gt; platformVariants, Godot.Collections.Array&lt;string&gt; genFiles)
{
using var file = FileAccess.Open(sourceFile, FileAccess.ModeFlags.Read);
if (file.GetError() != Error.Ok)
{
- return (int)Error.Failed;
+ return Error.Failed;
}
var mesh = new ArrayMesh();
// Fill the Mesh with data read in "file", left as an exercise to the reader.
string filename = $"{savePath}.{_GetSaveExtension()}";
- return (int)ResourceSaver.Save(mesh, filename);
+ return ResourceSaver.Save(mesh, filename);
}
}
[/csharp]
@@ -124,7 +124,8 @@
<return type="bool" />
<description>
Tells whether this importer can be run in parallel on threads, or, on the contrary, it's only safe for the editor to call it from the main thread, for one file at a time.
- If this method is not overridden, it will return [code]true[/code] by default (i.e., safe for parallel importing).
+ If this method is not overridden, it will return [code]false[/code] by default.
+ If this importer's implementation is thread-safe and can be run in parallel, override this with [code]true[/code] to optimize for concurrency.
</description>
</method>
<method name="_get_import_options" qualifiers="virtual const">
@@ -153,7 +154,7 @@
<param index="1" name="option_name" type="StringName" />
<param index="2" name="options" type="Dictionary" />
<description>
- This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example:
+ This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled.
[codeblocks]
[gdscript]
func _get_option_visibility(option, options):
@@ -241,7 +242,7 @@
<param index="2" name="custom_importer" type="String" default="&quot;&quot;" />
<param index="3" name="generator_parameters" type="Variant" default="null" />
<description>
- This function can only be called during the [method _import] callback and it allows manually importing resources from it. This is useful when the imported file generates external resources that require importing (as example, images). Custom parameters for the ".import" file can be passed via the [param custom_options]. Additionally, in cases where multiple importers can handle a file, the [param custom_importer] ca be specified to force a specific one. This function performs a resource import and returns immediately with a success or error code. [param generator_parameters] defines optional extra metadata which will be stored as [code skip-lint]generator_parameters[/code] in the [code]remap[/code] section of the [code].import[/code] file, for example to store a md5 hash of the source data.
+ This function can only be called during the [method _import] callback and it allows manually importing resources from it. This is useful when the imported file generates external resources that require importing (as example, images). Custom parameters for the ".import" file can be passed via the [param custom_options]. Additionally, in cases where multiple importers can handle a file, the [param custom_importer] can be specified to force a specific one. This function performs a resource import and returns immediately with a success or error code. [param generator_parameters] defines optional extra metadata which will be stored as [code skip-lint]generator_parameters[/code] in the [code]remap[/code] section of the [code].import[/code] file, for example to store a md5 hash of the source data.
</description>
</method>
</methods>
diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml
index cfdc172fd1..6b25be490e 100644
--- a/doc/classes/EditorInspector.xml
+++ b/doc/classes/EditorInspector.xml
@@ -28,6 +28,7 @@
</method>
</methods>
<members>
+ <member name="follow_focus" type="bool" setter="set_follow_focus" getter="is_following_focus" overrides="ScrollContainer" default="true" />
<member name="horizontal_scroll_mode" type="int" setter="set_horizontal_scroll_mode" getter="get_horizontal_scroll_mode" overrides="ScrollContainer" enum="ScrollContainer.ScrollMode" default="0" />
</members>
<signals>
diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml
index 7187617c4c..624e828520 100644
--- a/doc/classes/EditorInterface.xml
+++ b/doc/classes/EditorInterface.xml
@@ -117,6 +117,18 @@
[b]Note:[/b] When creating custom editor UI, prefer accessing theme items directly from your GUI nodes using the [code]get_theme_*[/code] methods.
</description>
</method>
+ <method name="get_editor_toaster" qualifiers="const">
+ <return type="EditorToaster" />
+ <description>
+ Returns the editor's [EditorToaster].
+ </description>
+ </method>
+ <method name="get_editor_undo_redo" qualifiers="const">
+ <return type="EditorUndoRedoManager" />
+ <description>
+ Returns the editor's [EditorUndoRedoManager].
+ </description>
+ </method>
<method name="get_editor_viewport_2d" qualifiers="const">
<return type="SubViewport" />
<description>
@@ -295,13 +307,23 @@
See also [method Window.set_unparent_when_invisible].
</description>
</method>
+ <method name="popup_method_selector">
+ <return type="void" />
+ <param index="0" name="object" type="Object" />
+ <param index="1" name="callback" type="Callable" />
+ <param index="2" name="current_value" type="String" default="&quot;&quot;" />
+ <description>
+ Pops up an editor dialog for selecting a method from [param object]. The [param callback] must take a single argument of type [String] which will contain the name of the selected method or be empty if the dialog is canceled. If [param current_value] is provided, the method will be selected automatically in the method list, if it exists.
+ </description>
+ </method>
<method name="popup_node_selector">
<return type="void" />
<param index="0" name="callback" type="Callable" />
<param index="1" name="valid_types" type="StringName[]" default="[]" />
+ <param index="2" name="current_value" type="Node" default="null" />
<description>
- Pops up an editor dialog for selecting a [Node] from the edited scene. The [param callback] must take a single argument of type [NodePath]. It is called on the selected [NodePath] or the empty path [code]^""[/code] if the dialog is canceled. If [param valid_types] is provided, the dialog will only show Nodes that match one of the listed Node types.
- [b]Example:[/b]
+ Pops up an editor dialog for selecting a [Node] from the edited scene. The [param callback] must take a single argument of type [NodePath]. It is called on the selected [NodePath] or the empty path [code]^""[/code] if the dialog is canceled. If [param valid_types] is provided, the dialog will only show Nodes that match one of the listed Node types. If [param current_value] is provided, the Node will be automatically selected in the tree, if it exists.
+ [b]Example:[/b] Display the node selection dialog as soon as this node is added to the tree for the first time:
[codeblock]
func _ready():
if Engine.is_editor_hint():
@@ -320,9 +342,9 @@
<param index="0" name="object" type="Object" />
<param index="1" name="callback" type="Callable" />
<param index="2" name="type_filter" type="PackedInt32Array" default="PackedInt32Array()" />
+ <param index="3" name="current_value" type="String" default="&quot;&quot;" />
<description>
- Pops up an editor dialog for selecting properties from [param object]. The [param callback] must take a single argument of type [NodePath]. It is called on the selected property path (see [method NodePath.get_as_property_path]) or the empty path [code]^""[/code] if the dialog is canceled. If [param type_filter] is provided, the dialog will only show properties that match one of the listed [enum Variant.Type] values.
- [b]Example:[/b]
+ Pops up an editor dialog for selecting properties from [param object]. The [param callback] must take a single argument of type [NodePath]. It is called on the selected property path (see [method NodePath.get_as_property_path]) or the empty path [code]^""[/code] if the dialog is canceled. If [param type_filter] is provided, the dialog will only show properties that match one of the listed [enum Variant.Type] values. If [param current_value] is provided, the property will be selected automatically in the property list, if it exists.
[codeblock]
func _ready():
if Engine.is_editor_hint():
@@ -336,6 +358,14 @@
[/codeblock]
</description>
</method>
+ <method name="popup_quick_open">
+ <return type="void" />
+ <param index="0" name="callback" type="Callable" />
+ <param index="1" name="base_types" type="StringName[]" default="[]" />
+ <description>
+ Pops up an editor dialog for quick selecting a resource file. The [param callback] must take a single argument of type [String] which will contain the path of the selected resource or be empty if the dialog is canceled. If [param base_types] is provided, the dialog will only show resources that match these types. Only types deriving from [Resource] are supported.
+ </description>
+ </method>
<method name="reload_scene_from_path">
<return type="void" />
<param index="0" name="scene_filepath" type="String" />
diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml
index 8fd7c167d9..6a91e3559d 100644
--- a/doc/classes/EditorNode3DGizmoPlugin.xml
+++ b/doc/classes/EditorNode3DGizmoPlugin.xml
@@ -54,7 +54,7 @@
<return type="EditorNode3DGizmo" />
<param index="0" name="for_node_3d" type="Node3D" />
<description>
- Override this method to return a custom [EditorNode3DGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method _has_gizmo].
+ Override this method to return a custom [EditorNode3DGizmo] for the 3D nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method _has_gizmo].
</description>
</method>
<method name="_get_gizmo_name" qualifiers="virtual const">
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 89b9e7d6c2..2cc9e08dd3 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -60,7 +60,7 @@
[gdscript]
func _forward_3d_draw_over_viewport(overlay):
# Draw a circle at cursor position.
- overlay.draw_circle(overlay.get_local_mouse_position(), 64)
+ overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.WHITE)
func _forward_3d_gui_input(camera, event):
if event is InputEventMouseMotion:
@@ -104,7 +104,6 @@
<param index="1" name="event" type="InputEvent" />
<description>
Called when there is a root node in the current edited scene, [method _handles] is implemented, and an [InputEvent] happens in the 3D viewport. The return value decides whether the [InputEvent] is consumed or forwarded to other [EditorPlugin]s. See [enum AfterGUIInput] for options.
- [b]Example:[/b]
[codeblocks]
[gdscript]
# Prevents the InputEvent from reaching other Editor classes.
@@ -119,8 +118,7 @@
}
[/csharp]
[/codeblocks]
- Must [code]return EditorPlugin.AFTER_GUI_INPUT_PASS[/code] in order to forward the [InputEvent] to other Editor classes.
- [b]Example:[/b]
+ This method must return [constant AFTER_GUI_INPUT_PASS] in order to forward the [InputEvent] to other Editor classes.
[codeblocks]
[gdscript]
# Consumes InputEventMouseMotion and forwards other InputEvent types.
@@ -188,8 +186,7 @@
<return type="bool" />
<param index="0" name="event" type="InputEvent" />
<description>
- Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [param event], otherwise forwards [param event] to other Editor classes.
- [b]Example:[/b]
+ Called when there is a root node in the current edited scene, [method _handles] is implemented, and an [InputEvent] happens in the 2D viewport. If this method returns [code]true[/code], [param event] is intercepted by this [EditorPlugin], otherwise [param event] is forwarded to other Editor classes.
[codeblocks]
[gdscript]
# Prevents the InputEvent from reaching other Editor classes.
@@ -204,8 +201,7 @@
}
[/csharp]
[/codeblocks]
- Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes.
- [b]Example:[/b]
+ This method must return [code]false[/code] in order to forward the [InputEvent] to other Editor classes.
[codeblocks]
[gdscript]
# Consumes InputEventMouseMotion and forwards other InputEvent types.
@@ -405,13 +401,22 @@
Adds a script at [param path] to the Autoload list as [param name].
</description>
</method>
+ <method name="add_context_menu_plugin">
+ <return type="void" />
+ <param index="0" name="slot" type="int" enum="EditorContextMenuPlugin.ContextMenuSlot" />
+ <param index="1" name="plugin" type="EditorContextMenuPlugin" />
+ <description>
+ Adds a plugin to the context menu. [param slot] is the context menu where the plugin will be added.
+ See [enum EditorContextMenuPlugin.ContextMenuSlot] for available context menus. A plugin instance can belong only to a single context menu slot.
+ </description>
+ </method>
<method name="add_control_to_bottom_panel">
<return type="Button" />
<param index="0" name="control" type="Control" />
<param index="1" name="title" type="String" />
<param index="2" name="shortcut" type="Shortcut" default="null" />
<description>
- Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [method Node.queue_free].
+ Adds a control to the bottom panel (together with Output, Debug, Animation, etc.). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [method Node.queue_free].
Optionally, you can specify a shortcut parameter. When pressed, this shortcut will toggle the bottom panel's visibility. See the default editor bottom panel shortcuts in the Editor Settings for inspiration. Per convention, they all use [kbd]Alt[/kbd] modifier.
</description>
</method>
@@ -444,7 +449,7 @@
<param index="2" name="script" type="Script" />
<param index="3" name="icon" type="Texture2D" />
<description>
- Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed.
+ Adds a custom type, which will appear in the list of nodes or resources.
When a given node or resource is selected, the base type will be instantiated (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object.
[b]Note:[/b] The base type is the base engine class which this type's class hierarchy inherits, not any custom type parent classes.
You can use the virtual method [method _handles] to check if your custom object is being edited by checking the script or using the [code]is[/code] keyword.
@@ -459,6 +464,13 @@
Adds a [Script] as debugger plugin to the Debugger. The script must extend [EditorDebuggerPlugin].
</description>
</method>
+ <method name="add_export_platform">
+ <return type="void" />
+ <param index="0" name="platform" type="EditorExportPlatform" />
+ <description>
+ Registers a new [EditorExportPlatform]. Export platforms provides functionality of exporting to the specific platform.
+ </description>
+ </method>
<method name="add_export_plugin">
<return type="void" />
<param index="0" name="plugin" type="EditorExportPlugin" />
@@ -621,6 +633,13 @@
Removes an Autoload [param name] from the list.
</description>
</method>
+ <method name="remove_context_menu_plugin">
+ <return type="void" />
+ <param index="0" name="plugin" type="EditorContextMenuPlugin" />
+ <description>
+ Removes the specified context menu plugin.
+ </description>
+ </method>
<method name="remove_control_from_bottom_panel">
<return type="void" />
<param index="0" name="control" type="Control" />
@@ -657,6 +676,13 @@
Removes the debugger plugin with given script from the Debugger.
</description>
</method>
+ <method name="remove_export_platform">
+ <return type="void" />
+ <param index="0" name="platform" type="EditorExportPlatform" />
+ <description>
+ Removes an export platform registered by [method add_export_platform].
+ </description>
+ </method>
<method name="remove_export_plugin">
<return type="void" />
<param index="0" name="plugin" type="EditorExportPlugin" />
@@ -675,7 +701,7 @@
<return type="void" />
<param index="0" name="plugin" type="EditorInspectorPlugin" />
<description>
- Removes an inspector plugin registered by [method add_import_plugin]
+ Removes an inspector plugin registered by [method add_inspector_plugin].
</description>
</method>
<method name="remove_node_3d_gizmo_plugin">
diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml
index 2b1083393f..4ff541f72d 100644
--- a/doc/classes/EditorProperty.xml
+++ b/doc/classes/EditorProperty.xml
@@ -132,6 +132,13 @@
Emitted when a property was deleted. Used internally.
</description>
</signal>
+ <signal name="property_favorited">
+ <param index="0" name="property" type="StringName" />
+ <param index="1" name="favorited" type="bool" />
+ <description>
+ Emit it if you want to mark a property as favorited, making it appear at the top of the inspector.
+ </description>
+ </signal>
<signal name="property_keyed">
<param index="0" name="property" type="StringName" />
<description>
diff --git a/doc/classes/EditorResourcePreview.xml b/doc/classes/EditorResourcePreview.xml
index ed3fdae352..a0c1a43fb2 100644
--- a/doc/classes/EditorResourcePreview.xml
+++ b/doc/classes/EditorResourcePreview.xml
@@ -32,7 +32,7 @@
<param index="3" name="userdata" type="Variant" />
<description>
Queue the [param resource] being edited for preview. Once the preview is ready, the [param receiver]'s [param receiver_func] will be called. The [param receiver_func] must take the following four arguments: [String] path, [Texture2D] preview, [Texture2D] thumbnail_preview, [Variant] userdata. [param userdata] can be anything, and will be returned when [param receiver_func] is called.
- [b]Note:[/b] If it was not possible to create the preview the [param receiver_func] will still be called, but the preview will be null.
+ [b]Note:[/b] If it was not possible to create the preview the [param receiver_func] will still be called, but the preview will be [code]null[/code].
</description>
</method>
<method name="queue_resource_preview">
@@ -43,7 +43,7 @@
<param index="3" name="userdata" type="Variant" />
<description>
Queue a resource file located at [param path] for preview. Once the preview is ready, the [param receiver]'s [param receiver_func] will be called. The [param receiver_func] must take the following four arguments: [String] path, [Texture2D] preview, [Texture2D] thumbnail_preview, [Variant] userdata. [param userdata] can be anything, and will be returned when [param receiver_func] is called.
- [b]Note:[/b] If it was not possible to create the preview the [param receiver_func] will still be called, but the preview will be null.
+ [b]Note:[/b] If it was not possible to create the preview the [param receiver_func] will still be called, but the preview will be [code]null[/code].
</description>
</method>
<method name="remove_preview_generator">
diff --git a/doc/classes/EditorResourcePreviewGenerator.xml b/doc/classes/EditorResourcePreviewGenerator.xml
index fcfdbb5c44..89bfe836d7 100644
--- a/doc/classes/EditorResourcePreviewGenerator.xml
+++ b/doc/classes/EditorResourcePreviewGenerator.xml
@@ -4,7 +4,7 @@
Custom generator of previews.
</brief_description>
<description>
- Custom code to generate previews. Please check [code]file_dialog/thumbnail_size[/code] in [EditorSettings] to find out the right size to do previews at.
+ Custom code to generate previews. Check [member EditorSettings.filesystem/file_dialog/thumbnail_size] to find a proper size to generate previews at.
</description>
<tutorials>
</tutorials>
@@ -23,7 +23,7 @@
<param index="2" name="metadata" type="Dictionary" />
<description>
Generate a preview from a given resource with the specified size. This must always be implemented.
- Returning an empty texture is an OK way to fail and let another generator take care.
+ Returning [code]null[/code] is an OK way to fail and let another generator take care.
Care must be taken because this function is always called from a thread (not the main thread).
[param metadata] dictionary can be modified to store file-specific metadata that can be used in [method EditorResourceTooltipPlugin._make_tooltip_for_path] (like image size, sample length etc.).
</description>
@@ -35,7 +35,7 @@
<param index="2" name="metadata" type="Dictionary" />
<description>
Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call [method _generate].
- Returning an empty texture is an OK way to fail and let another generator take care.
+ Returning [code]null[/code] is an OK way to fail and let another generator take care.
Care must be taken because this function is always called from a thread (not the main thread).
[param metadata] dictionary can be modified to store file-specific metadata that can be used in [method EditorResourceTooltipPlugin._make_tooltip_for_path] (like image size, sample length etc.).
</description>
diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml
index 7325d31fc5..f8938c459c 100644
--- a/doc/classes/EditorScenePostImport.xml
+++ b/doc/classes/EditorScenePostImport.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
Imported scenes can be automatically modified right after import by setting their [b]Custom Script[/b] Import property to a [code]tool[/code] script that inherits from this class.
- The [method _post_import] callback receives the imported scene's root node and returns the modified version of the scene. Usage example:
+ The [method _post_import] callback receives the imported scene's root node and returns the modified version of the scene:
[codeblocks]
[gdscript]
@tool # Needed so it runs in editor.
diff --git a/doc/classes/EditorScenePostImportPlugin.xml b/doc/classes/EditorScenePostImportPlugin.xml
index 5c1c898c9d..0004ec65c6 100644
--- a/doc/classes/EditorScenePostImportPlugin.xml
+++ b/doc/classes/EditorScenePostImportPlugin.xml
@@ -28,7 +28,7 @@
<param index="0" name="category" type="int" />
<param index="1" name="option" type="String" />
<description>
- Return true whether updating the 3D view of the import dialog needs to be updated if an option has changed.
+ Should return [code]true[/code] if the 3D view of the import dialog needs to update when changing the given option.
</description>
</method>
<method name="_get_internal_option_visibility" qualifiers="virtual const">
@@ -37,7 +37,7 @@
<param index="1" name="for_animation" type="bool" />
<param index="2" name="option" type="String" />
<description>
- Return true or false whether a given option should be visible. Return null to ignore.
+ Should return [code]true[/code] to show the given option, [code]false[/code] to hide the given option, or [code]null[/code] to ignore.
</description>
</method>
<method name="_get_option_visibility" qualifiers="virtual const">
@@ -46,7 +46,7 @@
<param index="1" name="for_animation" type="bool" />
<param index="2" name="option" type="String" />
<description>
- Return true or false whether a given option should be visible. Return null to ignore.
+ Should return [code]true[/code] to show the given option, [code]false[/code] to hide the given option, or [code]null[/code] to ignore.
</description>
</method>
<method name="_internal_process" qualifiers="virtual">
diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml
index bd18852dbc..e342966fe8 100644
--- a/doc/classes/EditorScript.xml
+++ b/doc/classes/EditorScript.xml
@@ -6,7 +6,7 @@
<description>
Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File &gt; Run[/b] menu option (or by pressing [kbd]Ctrl + Shift + X[/kbd]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead.
[b]Note:[/b] Extending scripts need to have [code]tool[/code] mode enabled.
- [b]Example script:[/b]
+ [b]Example:[/b] Running the following script prints "Hello from the Godot Editor!":
[codeblocks]
[gdscript]
@tool
diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml
index 90b8d07592..c35a376c85 100644
--- a/doc/classes/EditorSettings.xml
+++ b/doc/classes/EditorSettings.xml
@@ -38,7 +38,6 @@
- [code]name[/code]: [String] (the name of the property)
- [code]type[/code]: [int] (see [enum Variant.Type])
- optionally [code]hint[/code]: [int] (see [enum PropertyHint]) and [code]hint_string[/code]: [String]
- [b]Example:[/b]
[codeblocks]
[gdscript]
var settings = EditorInterface.get_editor_settings()
@@ -153,7 +152,7 @@
<param index="1" name="value" type="Variant" />
<param index="2" name="update_current" type="bool" />
<description>
- Sets the initial value of the setting specified by [param name] to [param value]. This is used to provide a value for the Revert button in the Editor Settings. If [param update_current] is true, the current value of the setting will be set to [param value] as well.
+ Sets the initial value of the setting specified by [param name] to [param value]. This is used to provide a value for the Revert button in the Editor Settings. If [param update_current] is [code]true[/code], the setting is reset to [param value] as well.
</description>
</method>
<method name="set_project_metadata">
@@ -182,8 +181,12 @@
</method>
</methods>
<members>
+ <member name="asset_library/use_threads" type="bool" setter="" getter="">
+ If [code]true[/code], the Asset Library uses multiple threads for its HTTP requests. This prevents the Asset Library from blocking the main thread for every loaded asset.
+ </member>
<member name="debugger/auto_switch_to_remote_scene_tree" type="bool" setter="" getter="">
If [code]true[/code], automatically switches to the [b]Remote[/b] scene tree when running the project from the editor. If [code]false[/code], stays on the [b]Local[/b] scene tree when running the project from the editor.
+ [b]Warning:[/b] Enabling this setting can cause stuttering when running a project with a large amount of nodes (typically a few thousands of nodes or more), even if the editor window isn't focused. This is due to the remote scene tree being updated every second regardless of whether the editor is focused.
</member>
<member name="debugger/profile_native_calls" type="bool" setter="" getter="">
If [code]true[/code], enables collection of profiling data from non-GDScript Godot functions, such as engine class methods. Enabling this slows execution while profiling further.
@@ -195,6 +198,9 @@
The maximum number of script functions that can be displayed per frame in the profiler. If there are more script functions called in a given profiler frame, these functions will be discarded from the profiling results entirely.
[b]Note:[/b] This setting is only read when the profiler is first started, so changing it during profiling will have no effect.
</member>
+ <member name="debugger/profiler_target_fps" type="int" setter="" getter="">
+ The target frame rate shown in the visual profiler graph, in frames per second.
+ </member>
<member name="debugger/remote_inspect_refresh_interval" type="float" setter="" getter="">
The refresh interval for the remote inspector's properties (in seconds). Lower values are more reactive, but may cause stuttering while the project is running from the editor and the [b]Remote[/b] scene tree is selected in the Scene tree dock.
</member>
@@ -205,8 +211,11 @@
If [code]true[/code], displays folders in the FileSystem dock's bottom pane when split mode is enabled. If [code]false[/code], only files will be displayed in the bottom pane. Split mode can be toggled by pressing the icon next to the [code]res://[/code] folder path.
[b]Note:[/b] This setting has no effect when split mode is disabled (which is the default).
</member>
+ <member name="docks/filesystem/other_file_extensions" type="String" setter="" getter="">
+ A comma separated list of unsupported file extensions to show in the FileSystem dock, e.g. [code]"ico,icns"[/code].
+ </member>
<member name="docks/filesystem/textfile_extensions" type="String" setter="" getter="">
- List of file extensions to consider as editable text files in the FileSystem dock (by double-clicking on the files).
+ A comma separated list of file extensions to consider as editable text files in the FileSystem dock (by double-clicking on the files), e.g. [code]"txt,md,cfg,ini,log,json,yml,yaml,toml,xml"[/code].
</member>
<member name="docks/filesystem/thumbnail_size" type="int" setter="" getter="">
The thumbnail size to use in the FileSystem dock (in pixels). See also [member filesystem/file_dialog/thumbnail_size].
@@ -217,6 +226,12 @@
<member name="docks/property_editor/subresource_hue_tint" type="float" setter="" getter="">
The tint intensity to use for the subresources background in the Inspector dock. The tint is used to distinguish between different subresources in the inspector. Higher values result in a more noticeable background color difference.
</member>
+ <member name="docks/scene_tree/ask_before_deleting_related_animation_tracks" type="bool" setter="" getter="">
+ If [code]true[/code], when a node is deleted with animation tracks referencing it, a confirmation dialog appears before the tracks are deleted. The dialog will appear even when using the "Delete (No Confirm)" shortcut.
+ </member>
+ <member name="docks/scene_tree/ask_before_revoking_unique_name" type="bool" setter="" getter="">
+ If [code]true[/code], displays a confirmation dialog after left-clicking the "percent" icon next to a node name in the Scene tree dock. When clicked, this icon revokes the node's scene-unique name, which can impact the behavior of scripts that rely on this scene-unique name due to identifiers not being found anymore.
+ </member>
<member name="docks/scene_tree/auto_expand_to_selected" type="bool" setter="" getter="">
If [code]true[/code], the scene tree dock will automatically unfold nodes when a node that has folded parents is selected.
</member>
@@ -259,11 +274,14 @@
The color to use when drawing smart snapping lines in the 2D editor. The smart snapping lines will automatically display when moving 2D nodes if smart snapping is enabled in the Snapping Options menu at the top of the 2D editor viewport.
</member>
<member name="editors/2d/use_integer_zoom_by_default" type="bool" setter="" getter="">
- If [code]true[/code], the 2D editor will snap to integer zoom values while not holding the [kbd]Alt[/kbd] key and powers of two while holding it. If [code]false[/code], this behavior is swapped.
+ If [code]true[/code], the 2D editor will snap to integer zoom values when not holding the [kbd]Alt[/kbd] key. If [code]false[/code], this behavior is swapped.
</member>
<member name="editors/2d/viewport_border_color" type="Color" setter="" getter="">
The color of the viewport border in the 2D editor. This border represents the viewport's size at the base resolution defined in the Project Settings. Objects placed outside this border will not be visible unless a [Camera2D] node is used, or unless the window is resized and the stretch mode is set to [code]disabled[/code].
</member>
+ <member name="editors/2d/zoom_speed_factor" type="float" setter="" getter="">
+ The factor to use when zooming in or out in the 2D editor. For example, [code]1.1[/code] will zoom in by 10% with every step. If set to [code]2.0[/code], zooming will only cycle through powers of two.
+ </member>
<member name="editors/3d/default_fov" type="float" setter="" getter="">
The default camera vertical field of view to use in the 3D editor (in degrees). The camera field of view can be adjusted on a per-scene basis using the [b]View[/b] menu at the top of the 3D editor. If a scene had its camera field of view adjusted using the [b]View[/b] menu, this setting is ignored in the scene in question. This setting is also ignored while a [Camera3D] node is being previewed in the editor.
[b]Note:[/b] The editor camera always uses the [b]Keep Height[/b] aspect mode.
@@ -311,18 +329,23 @@
The grid size in units. Higher values prevent the grid from appearing "cut off" at certain angles, but make the grid more demanding to render. Depending on the camera's position, the grid may not be fully visible since a shader is used to fade it progressively.
</member>
<member name="editors/3d/grid_xy_plane" type="bool" setter="" getter="">
- If [code]true[/code], render the grid on an XY plane. This can be useful for 3D side-scrolling games.
+ If [code]true[/code], renders the grid on the XY plane in perspective view. This can be useful for 3D side-scrolling games.
</member>
<member name="editors/3d/grid_xz_plane" type="bool" setter="" getter="">
- If [code]true[/code], render the grid on an XZ plane.
+ If [code]true[/code], renders the grid on the XZ plane in perspective view.
</member>
<member name="editors/3d/grid_yz_plane" type="bool" setter="" getter="">
- If [code]true[/code], render the grid on a YZ plane. This can be useful for 3D side-scrolling games.
+ If [code]true[/code], renders the grid on the YZ plane in perspective view. This can be useful for 3D side-scrolling games.
+ </member>
+ <member name="editors/3d/manipulator_gizmo_opacity" type="float" setter="" getter="">
+ Opacity of the default gizmo for moving, rotating, and scaling 3D nodes.
+ </member>
+ <member name="editors/3d/manipulator_gizmo_size" type="int" setter="" getter="">
+ Size of the default gizmo for moving, rotating, and scaling 3D nodes.
</member>
<member name="editors/3d/navigation/emulate_3_button_mouse" type="bool" setter="" getter="">
If [code]true[/code], enables 3-button mouse emulation mode. This is useful on laptops when using a trackpad.
When 3-button mouse emulation mode is enabled, the pan, zoom and orbit modifiers can always be used in the 3D editor viewport, even when not holding down any mouse button.
- [b]Note:[/b] No matter the orbit modifier configured in [member editors/3d/navigation/orbit_modifier], [kbd]Alt[/kbd] will always remain usable for orbiting in this mode to improve usability with graphics tablets.
</member>
<member name="editors/3d/navigation/emulate_numpad" type="bool" setter="" getter="">
If [code]true[/code], allows using the top row [kbd]0[/kbd]-[kbd]9[/kbd] keys to function as their equivalent numpad keys for 3D editor navigation. This should be enabled on keyboards that have no numeric keypad available.
@@ -334,28 +357,31 @@
If [code]true[/code], invert the vertical mouse axis when panning, orbiting, or using freelook mode in the 3D editor.
</member>
<member name="editors/3d/navigation/navigation_scheme" type="int" setter="" getter="">
- The navigation scheme to use in the 3D editor. Changing this setting will affect the mouse buttons that must be held down to perform certain operations in the 3D editor viewport.
- - [b]Godot[/b] Middle mouse button to orbit, [kbd]Shift + Middle mouse button[/kbd] to pan. [kbd]Mouse wheel[/kbd] to zoom.
- - [b]Maya:[/b] [kbd]Alt + Left mouse button[/kbd] to orbit. [kbd]Middle mouse button[/kbd] to pan, [kbd]Shift + Middle mouse button[/kbd] to pan 10 times faster. [kbd]Mouse wheel[/kbd] to zoom.
+ The navigation scheme preset to use in the 3D editor. Changing this setting will affect the mouse button and modifier controls used to navigate the 3D editor viewport.
+ All schemes can use [kbd]Mouse wheel[/kbd] to zoom.
+ - [b]Godot:[/b] [kbd]Middle mouse button[/kbd] to orbit. [kbd]Shift + Middle mouse button[/kbd] to pan. [kbd]Ctrl + Middle mouse button[/kbd] to zoom.
+ - [b]Maya:[/b] [kbd]Alt + Left mouse button[/kbd] to orbit. [kbd]Middle mouse button[/kbd] to pan, [kbd]Shift + Middle mouse button[/kbd] to pan 10 times faster. [kbd]Alt + Right mouse button[/kbd] to zoom.
- [b]Modo:[/b] [kbd]Alt + Left mouse button[/kbd] to orbit. [kbd]Alt + Shift + Left mouse button[/kbd] to pan. [kbd]Ctrl + Alt + Left mouse button[/kbd] to zoom.
- See also [member editors/3d/freelook/freelook_navigation_scheme].
+ See also [member editors/3d/navigation/orbit_mouse_button], [member editors/3d/navigation/pan_mouse_button], [member editors/3d/navigation/zoom_mouse_button], and [member editors/3d/freelook/freelook_navigation_scheme].
[b]Note:[/b] On certain window managers on Linux, the [kbd]Alt[/kbd] key will be intercepted by the window manager when clicking a mouse button at the same time. This means Godot will not see the modifier key as being pressed.
</member>
- <member name="editors/3d/navigation/orbit_modifier" type="int" setter="" getter="">
- The modifier key that must be held to orbit in the 3D editor.
- [b]Note:[/b] If [member editors/3d/navigation/emulate_3_button_mouse] is [code]true[/code], [kbd]Alt[/kbd] will always remain usable for orbiting to improve usability with graphics tablets.
- [b]Note:[/b] On certain window managers on Linux, the [kbd]Alt[/kbd] key will be intercepted by the window manager when clicking a mouse button at the same time. This means Godot will not see the modifier key as being pressed.
+ <member name="editors/3d/navigation/orbit_mouse_button" type="int" setter="" getter="">
+ The mouse button that needs to be held down to orbit in the 3D editor viewport.
</member>
- <member name="editors/3d/navigation/pan_modifier" type="int" setter="" getter="">
- The modifier key that must be held to pan in the 3D editor.
- [b]Note:[/b] On certain window managers on Linux, the [kbd]Alt[/kbd] key will be intercepted by the window manager when clicking a mouse button at the same time. This means Godot will not see the modifier key as being pressed.
+ <member name="editors/3d/navigation/pan_mouse_button" type="int" setter="" getter="">
+ The mouse button that needs to be held down to pan in the 3D editor viewport.
+ </member>
+ <member name="editors/3d/navigation/show_viewport_navigation_gizmo" type="bool" setter="" getter="">
+ If [code]true[/code], shows gizmos for moving and rotating the camera in the bottom corners of the 3D editor's viewport. Useful for devices that use touch screen.
+ </member>
+ <member name="editors/3d/navigation/show_viewport_rotation_gizmo" type="bool" setter="" getter="">
+ If [code]true[/code], shows a small orientation gizmo in the top-right corner of the 3D editor's viewports.
</member>
<member name="editors/3d/navigation/warped_mouse_panning" type="bool" setter="" getter="">
If [code]true[/code], warps the mouse around the 3D viewport while panning in the 3D editor. This makes it possible to pan over a large area without having to exit panning and adjust the mouse cursor.
</member>
- <member name="editors/3d/navigation/zoom_modifier" type="int" setter="" getter="">
- The modifier key that must be held to zoom in the 3D editor.
- [b]Note:[/b] On certain window managers on Linux, the [kbd]Alt[/kbd] key will be intercepted by the window manager when clicking a mouse button at the same time. This means Godot will not see the modifier key as being pressed.
+ <member name="editors/3d/navigation/zoom_mouse_button" type="int" setter="" getter="">
+ The mouse button that needs to be held down to zoom in the 3D editor viewport.
</member>
<member name="editors/3d/navigation/zoom_style" type="int" setter="" getter="">
The mouse cursor movement direction to use when zooming by moving the mouse. This does not affect zooming with the mouse wheel.
@@ -387,15 +413,85 @@
<member name="editors/3d_gizmos/gizmo_colors/aabb" type="Color" setter="" getter="">
The color to use for the AABB gizmo that displays the [GeometryInstance3D]'s custom [AABB].
</member>
+ <member name="editors/3d_gizmos/gizmo_colors/camera" type="Color" setter="" getter="">
+ The 3D editor gizmo color for [Camera3D]s.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/csg" type="Color" setter="" getter="">
+ The 3D editor gizmo color for CSG nodes (such as [CSGShape3D] or [CSGBox3D]).
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/decal" type="Color" setter="" getter="">
+ The 3D editor gizmo color for [Decal] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/fog_volume" type="Color" setter="" getter="">
+ The 3D editor gizmo color for [FogVolume] nodes.
+ </member>
<member name="editors/3d_gizmos/gizmo_colors/instantiated" type="Color" setter="" getter="">
The color override to use for 3D editor gizmos if the [Node3D] in question is part of an instantiated scene file (from the perspective of the current scene).
</member>
<member name="editors/3d_gizmos/gizmo_colors/joint" type="Color" setter="" getter="">
The 3D editor gizmo color for [Joint3D]s and [PhysicalBone3D]s.
</member>
+ <member name="editors/3d_gizmos/gizmo_colors/joint_body_a" type="Color" setter="" getter="">
+ Color for representing [member Joint3D.node_a] for some [Joint3D] types.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/joint_body_b" type="Color" setter="" getter="">
+ Color for representing [member Joint3D.node_b] for some [Joint3D] types.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/lightmap_lines" type="Color" setter="" getter="">
+ Color of lines displayed in baked [LightmapGI] node's grid.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/lightprobe_lines" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [LightmapProbe] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/occluder" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [OccluderInstance3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/particle_attractor" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [GPUParticlesAttractor3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/particle_collision" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [GPUParticlesCollision3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/particles" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [CPUParticles3D] and [GPUParticles3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/path_tilt" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [Path3D] tilt circles, which indicate the direction the [Curve3D] is tilted towards.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/reflection_probe" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [ReflectionProbe] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/selected_bone" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for the currently selected [Skeleton3D] bone.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/skeleton" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [Skeleton3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/stream_player_3d" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [AudioStreamPlayer3D]'s emission angle.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/visibility_notifier" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [VisibleOnScreenNotifier3D] and [VisibleOnScreenEnabler3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/voxel_gi" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [VoxelGI] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_settings/bone_axis_length" type="float" setter="" getter="">
+ The length of [Skeleton3D] bone gizmos in the 3D editor.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_settings/bone_shape" type="int" setter="" getter="">
+ The shape of [Skeleton3D] bone gizmos in the 3D editor. [b]Wire[/b] is a thin line, while [b]Octahedron[/b] is a set of lines that represent a thicker hollow line pointing in a specific direction (similar to most 3D animation software).
+ </member>
+ <member name="editors/3d_gizmos/gizmo_settings/path3d_tilt_disk_size" type="float" setter="" getter="">
+ Size of the disk gizmo displayed when editing [Path3D]'s tilt handles.
+ </member>
<member name="editors/animation/autorename_animation_tracks" type="bool" setter="" getter="">
If [code]true[/code], automatically updates animation tracks' target paths when renaming or reparenting nodes in the Scene tree dock.
</member>
+ <member name="editors/animation/confirm_insert_track" type="bool" setter="" getter="">
+ If [code]true[/code], display a confirmation dialog when adding a new track to an animation by pressing the "key" icon next to a property. Holding Shift will bypass the dialog.
+ If [code]false[/code], the behavior is reversed, i.e. the dialog only appears when Shift is held.
+ </member>
<member name="editors/animation/default_create_bezier_tracks" type="bool" setter="" getter="">
If [code]true[/code], create a Bezier track instead of a standard track when pressing the "key" icon next to a property. Bezier tracks provide more control over animation curves, but are more difficult to adjust quickly.
</member>
@@ -408,9 +504,26 @@
<member name="editors/animation/onion_layers_past_color" type="Color" setter="" getter="">
The modulate color to use for "past" frames displayed in the animation editor's onion skinning feature.
</member>
+ <member name="editors/bone_mapper/handle_colors/error" type="Color" setter="" getter="">
+ </member>
+ <member name="editors/bone_mapper/handle_colors/missing" type="Color" setter="" getter="">
+ </member>
+ <member name="editors/bone_mapper/handle_colors/set" type="Color" setter="" getter="">
+ </member>
+ <member name="editors/bone_mapper/handle_colors/unset" type="Color" setter="" getter="">
+ </member>
+ <member name="editors/grid_map/editor_side" type="int" setter="" getter="">
+ Specifies the side of 3D editor's viewport where GridMap's mesh palette will appear.
+ </member>
+ <member name="editors/grid_map/palette_min_width" type="int" setter="" getter="">
+ Minimum width of GridMap's mesh palette side panel.
+ </member>
<member name="editors/grid_map/pick_distance" type="float" setter="" getter="">
The maximum distance at which tiles can be placed on a GridMap, relative to the camera position (in 3D units).
</member>
+ <member name="editors/grid_map/preview_size" type="int" setter="" getter="">
+ Texture size of mesh previews generated for GridMap's MeshLibrary.
+ </member>
<member name="editors/panning/2d_editor_pan_speed" type="int" setter="" getter="">
The panning speed when using the mouse wheel or touchscreen events in the 2D editor. This setting does not apply to panning by holding down the middle or right mouse buttons.
</member>
@@ -520,6 +633,13 @@
<member name="editors/visual_editors/visual_shader/port_preview_size" type="int" setter="" getter="">
The size to use for port previews in the visual shader uniforms (toggled by clicking the "eye" icon next to an output). The value is defined in pixels at 100% zoom, and will scale with zoom automatically.
</member>
+ <member name="export/ssh/scp" type="String" setter="" getter="">
+ Path to the SCP (secure copy) executable (used for remote deploy to desktop platforms). If left empty, the editor will attempt to run [code]scp[/code] from [code]PATH[/code].
+ [b]Note:[/b] SCP is not the same as SFTP. Specifying the SFTP executable here will not work.
+ </member>
+ <member name="export/ssh/ssh" type="String" setter="" getter="">
+ Path to the SSH executable (used for remote deploy to desktop platforms). If left empty, the editor will attempt to run [code]ssh[/code] from [code]PATH[/code].
+ </member>
<member name="filesystem/directories/autoscan_project_path" type="String" setter="" getter="">
The folder where projects should be scanned for (recursively), in a way similar to the project manager's [b]Scan[/b] button. This can be set to the same value as [member filesystem/directories/default_project_path] for convenience.
[b]Note:[/b] Setting this path to a folder with very large amounts of files/folders can slow down the project manager startup significantly. To keep the project manager quick to start up, it is recommended to set this value to a folder as "specific" as possible.
@@ -565,6 +685,12 @@
<member name="filesystem/file_dialog/thumbnail_size" type="int" setter="" getter="">
The thumbnail size to use in the editor's file dialogs (in pixels). See also [member docks/filesystem/thumbnail_size].
</member>
+ <member name="filesystem/file_server/password" type="String" setter="" getter="">
+ Password used for file server when exporting project with remote file system.
+ </member>
+ <member name="filesystem/file_server/port" type="int" setter="" getter="">
+ Port used for file server when exporting project with remote file system.
+ </member>
<member name="filesystem/import/blender/blender_path" type="String" setter="" getter="">
The path to the directory containing the Blender executable used for converting the Blender 3D scene files [code].blend[/code] to glTF 2.0 format during import. Blender 3.0 or later is required.
To enable this feature for your specific project, use [member ProjectSettings.filesystem/import/blender/enabled].
@@ -588,10 +714,38 @@
If [code]true[/code], when saving a file, the editor will rename the old file to a different name, save a new file, then only remove the old file once the new file has been saved. This makes loss of data less likely to happen if the editor or operating system exits unexpectedly while saving (e.g. due to a crash or power outage).
[b]Note:[/b] On Windows, this feature can interact negatively with certain antivirus programs. In this case, you may have to set this to [code]false[/code] to prevent file locking issues.
</member>
+ <member name="filesystem/quick_open_dialog/default_display_mode" type="int" setter="" getter="">
+ If set to [code]Adaptive[/code], the dialog opens in list view or grid view depending on the requested type. If set to [code]Last Used[/code], the display mode will always open the way you last used it.
+ </member>
+ <member name="filesystem/quick_open_dialog/enable_fuzzy_matching" type="bool" setter="" getter="">
+ If [code]true[/code], fuzzy matching of search tokens is allowed.
+ </member>
+ <member name="filesystem/quick_open_dialog/include_addons" type="bool" setter="" getter="">
+ If [code]true[/code], results will include files located in the [code]addons[/code] folder.
+ </member>
+ <member name="filesystem/quick_open_dialog/max_fuzzy_misses" type="int" setter="" getter="">
+ The number of allowed missed query characters in a match, if fuzzy matching is enabled. For example, with the default value of 2, [code]foobar[/code] would match [code]foobur[/code] and [code]foob[/code] but not [code]foo[/code].
+ </member>
+ <member name="filesystem/quick_open_dialog/max_results" type="int" setter="" getter="">
+ Maximum number of matches to show in dialog.
+ </member>
+ <member name="filesystem/quick_open_dialog/show_search_highlight" type="bool" setter="" getter="">
+ If [code]true[/code], results will be highlighted with their search matches.
+ </member>
<member name="filesystem/tools/oidn/oidn_denoise_path" type="String" setter="" getter="">
The path to the directory containing the Open Image Denoise (OIDN) executable, used optionally for denoising lightmaps. It can be downloaded from [url=https://www.openimagedenoise.org/downloads.html]openimagedenoise.org[/url].
To enable this feature for your specific project, use [member ProjectSettings.rendering/lightmapping/denoising/denoiser].
</member>
+ <member name="input/buffering/agile_event_flushing" type="bool" setter="" getter="">
+ If [code]true[/code], input events will be flushed just before every idle and physics frame.
+ If [code]false[/code], these events will be flushed only once per process frame, between iterations of the engine.
+ Enabling this setting can greatly improve input responsiveness, especially in devices that struggle to run at the project's intended frame rate.
+ </member>
+ <member name="input/buffering/use_accumulated_input" type="bool" setter="" getter="">
+ If [code]true[/code], similar input events sent by the operating system are accumulated. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS.
+ Input accumulation can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage.
+ [b]Note:[/b] Input accumulation is [i]enabled[/i] by default.
+ </member>
<member name="interface/editor/accept_dialog_cancel_ok_buttons" type="int" setter="" getter="">
How to position the Cancel and OK buttons in the editor's [AcceptDialog]s. Different platforms have different standard behaviors for this, which can be overridden using this setting. This is useful if you use Godot both on Windows and macOS/Linux and your Godot muscle memory is stronger than your OS specific one.
- [b]Auto[/b] follows the platform convention: Cancel first on macOS and Linux, OK first on Windows.
@@ -623,10 +777,6 @@
The custom editor scale factor to use. This can be used for displays with very high DPI where a scale factor of 200% is not sufficient.
[b]Note:[/b] Only effective if [member interface/editor/display_scale] is set to [b]Custom[/b].
</member>
- <member name="interface/editor/debug/enable_pseudolocalization" type="bool" setter="" getter="">
- If [code]true[/code], lengthens the editor's localizable strings and replaces their characters with accented variants. This allows spotting non-localizable strings easily, while also ensuring the UI layout doesn't break when strings are made longer (as many languages require strings to be longer).
- This is a debugging feature and should only be enabled when working on the editor itself.
- </member>
<member name="interface/editor/display_scale" type="int" setter="" getter="">
The display scale factor to use for the editor interface. Higher values are more suited to hiDPI/Retina displays.
If set to [b]Auto[/b], the editor scale is automatically determined based on the screen resolution and reported display DPI. This heuristic is not always ideal, which means you can get better results by setting the editor scale manually.
@@ -640,12 +790,15 @@
Translations are provided by the community. If you spot a mistake, [url=$DOCS_URL/contributing/documentation/editor_and_docs_localization.html]contribute to editor translations on Weblate![/url]
</member>
<member name="interface/editor/editor_screen" type="int" setter="" getter="">
- The preferred monitor to display the editor.
+ The preferred monitor to display the editor. If [b]Auto[/b], the editor will remember the last screen it was displayed on across restarts.
</member>
<member name="interface/editor/expand_to_title" type="bool" setter="" getter="">
Expanding main editor window content to the title, if supported by [DisplayServer]. See [constant DisplayServer.WINDOW_FLAG_EXTEND_TO_TITLE].
Specific to the macOS platform.
</member>
+ <member name="interface/editor/font_allow_msdf" type="bool" setter="" getter="">
+ If set to [code]true[/code], MSDF font rendering will be used for the visual shader graph editor. You may need to set this to [code]false[/code] when using a custom main font, as some fonts will look broken due to the use of self-intersecting outlines in their font data. Downloading the font from the font maker's official website as opposed to a service like Google Fonts can help resolve this issue.
+ </member>
<member name="interface/editor/font_antialiasing" type="int" setter="" getter="">
FreeType's font anti-aliasing mode used to render the editor fonts. Most fonts are not designed to look good with anti-aliasing disabled, so it's recommended to leave this enabled unless you're using a pixel art font.
</member>
@@ -665,6 +818,9 @@
<member name="interface/editor/import_resources_when_unfocused" type="bool" setter="" getter="">
If [code]true[/code], (re)imports resources even if the editor window is unfocused or minimized. If [code]false[/code], resources are only (re)imported when the editor window is focused. This can be set to [code]true[/code] to speed up iteration by starting the import process earlier when saving files in the project folder. This also allows getting visual feedback on changes without having to click the editor window, which is useful with multi-monitor setups. The downside of setting this to [code]true[/code] is that it increases idle CPU usage and may steal CPU time from other applications when importing resources.
</member>
+ <member name="interface/editor/keep_screen_on" type="bool" setter="" getter="">
+ If [code]true[/code], keeps the screen on (even in case of inactivity), so the screensaver does not take over. Works on desktop and mobile platforms.
+ </member>
<member name="interface/editor/localize_settings" type="bool" setter="" getter="">
If [code]true[/code], setting names in the editor are localized when possible.
[b]Note:[/b] This setting affects most [EditorInspector]s in the editor UI, primarily Project Settings and Editor Settings. To control names displayed in the Inspector dock, use [member interface/inspector/default_property_name_style] instead.
@@ -706,9 +862,11 @@
Consider enabling this if you are developing editor plugins to ensure they only make the editor redraw when required.
The default [b]Auto[/b] value will only enable this if the editor was compiled with the [code]dev_build=yes[/code] SCons option (the default is [code]dev_build=no[/code]).
[b]Note:[/b] If [member interface/editor/update_continuously] is [code]true[/code], the spinner icon displays in red.
+ [b]Note:[/b] If the editor was started with the [code]--debug-canvas-item-redraw[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url], the update spinner will [i]never[/i] display regardless of this setting's value. This is to avoid confusion with what would cause redrawing in real world scenarios.
</member>
<member name="interface/editor/single_window_mode" type="bool" setter="" getter="">
- If [code]true[/code], embed modal windows such as docks inside the main editor window. When single-window mode is enabled, tooltips will also be embedded inside the main editor window, which means they can't be displayed outside of the editor window.
+ If [code]true[/code], embed modal windows such as docks inside the main editor window. When single-window mode is enabled, tooltips will also be embedded inside the main editor window, which means they can't be displayed outside of the editor window. Single-window mode can be faster as it does not need to create a separate window for every popup and tooltip, which can be a slow operation depending on the operating system and rendering method in use.
+ This is equivalent to [member ProjectSettings.display/window/subwindows/embed_subwindows] in the running project, except the setting's value is inverted.
[b]Note:[/b] To query whether the editor can use multiple windows in an editor plugin, use [method EditorInterface.is_multi_window_enabled] instead of querying the value of this editor setting.
</member>
<member name="interface/editor/ui_layout_direction" type="int" setter="" getter="">
@@ -734,6 +892,12 @@
Depending on the platform and used renderer, the engine will fall back to [b]Enabled[/b] if the desired mode is not supported.
[b]Note:[/b] V-Sync modes other than [b]Enabled[/b] are only supported in the Forward+ and Mobile rendering methods, not Compatibility.
</member>
+ <member name="interface/editors/derive_script_globals_by_name" type="bool" setter="" getter="">
+ If [code]true[/code], when extending a script, the global class name of the script is inserted in the script creation dialog, if it exists. If [code]false[/code], the script's file path is always inserted.
+ </member>
+ <member name="interface/editors/show_scene_tree_root_selection" type="bool" setter="" getter="">
+ If [code]true[/code], the Scene dock will display buttons to quickly add a root node to a newly created scene.
+ </member>
<member name="interface/inspector/auto_unfold_foreign_scenes" type="bool" setter="" getter="">
If [code]true[/code], automatically expands property groups in the Inspector dock when opening a scene that hasn't been opened previously. If [code]false[/code], all groups remain collapsed by default.
</member>
@@ -755,7 +919,7 @@
</member>
<member name="interface/inspector/delimitate_all_container_and_resources" type="bool" setter="" getter="">
If [code]true[/code], add a margin around Array, Dictionary, and Resource Editors that are not already colored.
- [b]Note:[/b] If [member interface/inspector/nested_color_mode] is set to [b]Containers &amp; Resources[/b] this parameter will have no effect since those editors will already be colored
+ [b]Note:[/b] If [member interface/inspector/nested_color_mode] is set to [b]Containers &amp; Resources[/b] this parameter will have no effect since those editors will already be colored.
</member>
<member name="interface/inspector/disable_folding" type="bool" setter="" getter="">
If [code]true[/code], forces all property groups to be expanded in the Inspector dock and prevents collapsing them.
@@ -897,7 +1061,7 @@
Determines whether online features are enabled in the editor, such as the Asset Library or update checks. Disabling these online features helps alleviate privacy concerns by preventing the editor from making HTTP requests to the Godot website or third-party platforms hosting assets from the Asset Library.
</member>
<member name="network/debug/remote_host" type="String" setter="" getter="">
- The address to listen to when starting the remote debugger. This can be set to [code]0.0.0.0[/code] to allow external clients to connect to the remote debugger (instead of restricting the remote debugger to connections from [code]localhost[/code]).
+ The address to listen to when starting the remote debugger. This can be set to this device's local IP address to allow external clients to connect to the remote debugger (instead of restricting the remote debugger to connections from [code]localhost[/code]).
</member>
<member name="network/debug/remote_port" type="int" setter="" getter="">
The port to listen to when starting the remote debugger. Godot will try to use port numbers above the configured number if the configured number is already taken by another application.
@@ -927,9 +1091,11 @@
</member>
<member name="run/bottom_panel/action_on_play" type="int" setter="" getter="">
The action to execute on the bottom panel when running the project.
+ [b]Note:[/b] This option won't do anything if the bottom panel switching is locked using the pin button in the corner of the bottom panel.
</member>
<member name="run/bottom_panel/action_on_stop" type="int" setter="" getter="">
The action to execute on the bottom panel when stopping the project.
+ [b]Note:[/b] This option won't do anything if the bottom panel switching is locked using the pin button in the corner of the bottom panel.
</member>
<member name="run/output/always_clear_output_on_play" type="bool" setter="" getter="">
If [code]true[/code], the editor will clear the Output panel when running the project.
@@ -944,7 +1110,18 @@
If [code]true[/code], on Linux/BSD, the editor will check for Wayland first instead of X11 (if available).
</member>
<member name="run/window_placement/android_window" type="int" setter="" getter="">
- The Android window to display the project on when starting the project from the editor.
+ Specifies how the Play window is launched relative to the Android editor.
+ - [b]Auto (based on screen size)[/b] (default) will automatically choose how to launch the Play window based on the device and screen metrics. Defaults to [b]Same as Editor[/b] on phones and [b]Side-by-side with Editor[/b] on tablets.
+ - [b]Same as Editor[/b] will launch the Play window in the same window as the Editor.
+ - [b]Side-by-side with Editor[/b] will launch the Play window side-by-side with the Editor window.
+ - [b]Launch in PiP mode[/b] will launch the Play window directly in picture-in-picture (PiP) mode if PiP mode is supported and enabled. When maximized, the Play window will occupy the same window as the Editor.
+ [b]Note:[/b] Only available in the Android editor.
+ </member>
+ <member name="run/window_placement/play_window_pip_mode" type="int" setter="" getter="">
+ Specifies the picture-in-picture (PiP) mode for the Play window.
+ - [b]Disabled:[/b] PiP is disabled for the Play window.
+ - [b]Enabled:[/b] If the device supports it, PiP is always enabled for the Play window. The Play window will contain a button to enter PiP mode.
+ - [b]Enabled when Play window is same as Editor[/b] (default for Android editor): If the device supports it, PiP is enabled when the Play window is the same as the Editor. The Play window will contain a button to enter PiP mode.
[b]Note:[/b] Only available in the Android editor.
</member>
<member name="run/window_placement/rect" type="int" setter="" getter="">
@@ -1016,6 +1193,9 @@
<member name="text_editor/appearance/whitespace/line_spacing" type="int" setter="" getter="">
The space to add between lines (in pixels). Greater line spacing can help improve readability at the cost of displaying fewer lines on screen.
</member>
+ <member name="text_editor/behavior/files/auto_reload_and_parse_scripts_on_save" type="bool" setter="" getter="">
+ If [code]true[/code], tool scripts will be automatically soft-reloaded after they are saved.
+ </member>
<member name="text_editor/behavior/files/auto_reload_scripts_on_external_change" type="bool" setter="" getter="">
If [code]true[/code], automatically reloads scripts in the editor when they have been modified and saved by external editors.
</member>
@@ -1025,6 +1205,9 @@
<member name="text_editor/behavior/files/convert_indent_on_save" type="bool" setter="" getter="">
If [code]true[/code], converts indentation to match the script editor's indentation settings when saving a script. See also [member text_editor/behavior/indent/type].
</member>
+ <member name="text_editor/behavior/files/open_dominant_script_on_scene_change" type="bool" setter="" getter="">
+ If [code]true[/code], opening a scene automatically opens the script attached to the root node, or the topmost node if the root has no script.
+ </member>
<member name="text_editor/behavior/files/restore_scripts_on_load" type="bool" setter="" getter="">
If [code]true[/code], reopens scripts that were opened in the last session when the editor is reopened on a given project.
</member>
@@ -1034,6 +1217,9 @@
<member name="text_editor/behavior/files/trim_trailing_whitespace_on_save" type="bool" setter="" getter="">
If [code]true[/code], trims trailing whitespace when saving a script. Trailing whitespace refers to tab and space characters placed at the end of lines. Since these serve no practical purpose, they can and should be removed to make version control diffs less noisy.
</member>
+ <member name="text_editor/behavior/general/empty_selection_clipboard" type="bool" setter="" getter="">
+ If [code]true[/code], copying or cutting without a selection is performed on all lines with a caret. Otherwise, copy and cut require a selection.
+ </member>
<member name="text_editor/behavior/indent/auto_indent" type="bool" setter="" getter="">
If [code]true[/code], automatically indents code when pressing the [kbd]Enter[/kbd] key based on blocks above the new line.
</member>
@@ -1047,6 +1233,9 @@
The indentation style to use (tabs or spaces).
[b]Note:[/b] The [url=$DOCS_URL/tutorials/scripting/gdscript/gdscript_styleguide.html]GDScript style guide[/url] recommends using tabs for indentation. It is advised to change this setting only if you need to work on a project that currently uses spaces for indentation.
</member>
+ <member name="text_editor/behavior/navigation/custom_word_separators" type="String" setter="" getter="">
+ The characters to consider as word delimiters if [member text_editor/behavior/navigation/use_custom_word_separators] is [code]true[/code]. This is in addition to default characters if [member text_editor/behavior/navigation/use_default_word_separators] is [code]true[/code]. The characters should be defined without separation, for example [code]_♥=[/code].
+ </member>
<member name="text_editor/behavior/navigation/drag_and_drop_selection" type="bool" setter="" getter="">
If [code]true[/code], allows drag-and-dropping text in the script editor to move text. Disable this if you find yourself accidentally drag-and-dropping text in the script editor.
</member>
@@ -1060,14 +1249,20 @@
If [code]true[/code], allows scrolling past the end of the file.
</member>
<member name="text_editor/behavior/navigation/smooth_scrolling" type="bool" setter="" getter="">
- If [code]true[/code], allows scrolling in sub-line intervals and enables a smooth scrolling animation when using the mouse wheel to scroll.
+ If [code]true[/code], enables a smooth scrolling animation when using the mouse wheel to scroll. See [member text_editor/behavior/navigation/v_scroll_speed] for the speed of this animation.
[b]Note:[/b] [member text_editor/behavior/navigation/smooth_scrolling] currently behaves poorly in projects where [member ProjectSettings.physics/common/physics_ticks_per_second] has been increased significantly from its default value ([code]60[/code]). In this case, it is recommended to disable this setting.
</member>
<member name="text_editor/behavior/navigation/stay_in_script_editor_on_node_selected" type="bool" setter="" getter="">
If [code]true[/code], prevents automatically switching between the Script and 2D/3D screens when selecting a node in the Scene tree dock.
</member>
+ <member name="text_editor/behavior/navigation/use_custom_word_separators" type="bool" setter="" getter="">
+ If [code]true[/code], uses the characters in [member text_editor/behavior/navigation/custom_word_separators] as word separators for word navigation and operations. This is in addition to the default characters if [member text_editor/behavior/navigation/use_default_word_separators] is also enabled. Word navigation and operations include double-clicking on a word or holding [kbd]Ctrl[/kbd] ([kbd]Cmd[/kbd] on macOS) while pressing [kbd]left[/kbd], [kbd]right[/kbd], [kbd]backspace[/kbd], or [kbd]delete[/kbd].
+ </member>
+ <member name="text_editor/behavior/navigation/use_default_word_separators" type="bool" setter="" getter="">
+ If [code]true[/code], uses the characters in [code]`!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^`{|}~[/code], the Unicode General Punctuation table, and the Unicode CJK Punctuation table as word separators for word navigation and operations. If [code]false[/code], a subset of these characters are used and does not include the characters [code]&lt;&gt;$~^=+|[/code]. This is in addition to custom characters if [member text_editor/behavior/navigation/use_custom_word_separators] is also enabled. These characters are used to determine where a word stops. Word navigation and operations include double-clicking on a word or holding [kbd]Ctrl[/kbd] ([kbd]Cmd[/kbd] on macOS) while pressing [kbd]left[/kbd], [kbd]right[/kbd], [kbd]backspace[/kbd], or [kbd]delete[/kbd].
+ </member>
<member name="text_editor/behavior/navigation/v_scroll_speed" type="int" setter="" getter="">
- The number of pixels to scroll with every mouse wheel increment. Higher values make the script scroll by faster when using the mouse wheel.
+ The speed of scrolling in lines per second when [member text_editor/behavior/navigation/smooth_scrolling] is [code]true[/code]. Higher values make the script scroll by faster when using the mouse wheel.
[b]Note:[/b] You can hold down [kbd]Alt[/kbd] while using the mouse wheel to temporarily scroll 5 times faster.
</member>
<member name="text_editor/completion/add_node_path_literals" type="bool" setter="" getter="">
@@ -1086,7 +1281,7 @@
The delay in seconds after which autocompletion suggestions should be displayed when the user stops typing.
</member>
<member name="text_editor/completion/code_complete_enabled" type="bool" setter="" getter="">
- If [code]true[/code], code completion will be triggered automatically after [member text_editor/completion/code_complete_delay]. If [code]false[/code], you can still trigger completion manually by pressing [kbd]Ctrl + Space[/kbd] ([kbd]Cmd + Space[/kbd] on macOS).
+ If [code]true[/code], code completion will be triggered automatically after [member text_editor/completion/code_complete_delay]. Even if [code]false[/code], code completion can be triggered manually with the [code]ui_text_completion_query[/code] action (by default [kbd]Ctrl + Space[/kbd] or [kbd]Cmd + Space[/kbd] on macOS).
</member>
<member name="text_editor/completion/colorize_suggestions" type="bool" setter="" getter="">
If [code]true[/code] enables the coloring for some items in the autocompletion suggestions, like vector components.
@@ -1103,6 +1298,15 @@
<member name="text_editor/completion/use_single_quotes" type="bool" setter="" getter="">
If [code]true[/code], performs string autocompletion with single quotes. If [code]false[/code], performs string autocompletion with double quotes (which matches the [url=$DOCS_URL/tutorials/scripting/gdscript/gdscript_styleguide.html]GDScript style guide[/url]).
</member>
+ <member name="text_editor/external/exec_flags" type="String" setter="" getter="">
+ The command-line arguments to pass to the external text editor that is run when [member text_editor/external/use_external_editor] is [code]true[/code]. See also [member text_editor/external/exec_path].
+ </member>
+ <member name="text_editor/external/exec_path" type="String" setter="" getter="">
+ The path to the text editor executable used to edit text files if [member text_editor/external/use_external_editor] is [code]true[/code].
+ </member>
+ <member name="text_editor/external/use_external_editor" type="bool" setter="" getter="">
+ If [code]true[/code], uses an external editor instead of the built-in Script Editor. See also [member text_editor/external/exec_path] and [member text_editor/external/exec_flags].
+ </member>
<member name="text_editor/help/class_reference_examples" type="int" setter="" getter="">
Controls which multi-line code blocks should be displayed in the editor help. This setting does not affect single-line code literals in the editor help.
</member>
@@ -1118,6 +1322,24 @@
<member name="text_editor/help/show_help_index" type="bool" setter="" getter="">
If [code]true[/code], displays a table of contents at the left of the editor help (at the location where the members overview would appear when editing a script).
</member>
+ <member name="text_editor/help/sort_functions_alphabetically" type="bool" setter="" getter="">
+ If [code]true[/code], the script's method list in the Script Editor is sorted alphabetically.
+ </member>
+ <member name="text_editor/script_list/group_help_pages" type="bool" setter="" getter="">
+ If [code]true[/code], class reference pages are grouped together at the bottom of the Script Editor's script list.
+ </member>
+ <member name="text_editor/script_list/highlight_scene_scripts" type="bool" setter="" getter="">
+ If [code]true[/code], the scripts that are used by the current scene are highlighted in the Script Editor's script list.
+ </member>
+ <member name="text_editor/script_list/list_script_names_as" type="int" setter="" getter="">
+ Specifies how script paths should be displayed in Script Editor's script list. If using the "Name" option and some scripts share the same file name, more parts of their paths are revealed to avoid conflicts.
+ </member>
+ <member name="text_editor/script_list/script_temperature_enabled" type="bool" setter="" getter="">
+ If [code]true[/code], the names of recently opened scripts in the Script Editor are highlighted with the accent color, with its intensity based on how recently they were opened.
+ </member>
+ <member name="text_editor/script_list/script_temperature_history_size" type="int" setter="" getter="">
+ How many script names can be highlighted at most, if [member text_editor/script_list/script_temperature_enabled] is [code]true[/code]. Scripts older than this value use the default font color.
+ </member>
<member name="text_editor/script_list/show_members_overview" type="bool" setter="" getter="">
If [code]true[/code], displays an overview of the current script's member variables and functions at the left of the script editor. See also [member text_editor/script_list/sort_members_outline_alphabetically].
</member>
@@ -1125,6 +1347,9 @@
If [code]true[/code], sorts the members outline (located at the left of the script editor) using alphabetical order. If [code]false[/code], sorts the members outline depending on the order in which members are found in the script.
[b]Note:[/b] Only effective if [member text_editor/script_list/show_members_overview] is [code]true[/code].
</member>
+ <member name="text_editor/script_list/sort_scripts_by" type="int" setter="" getter="">
+ Specifies sorting used for Script Editor's open script list.
+ </member>
<member name="text_editor/theme/color_theme" type="String" setter="" getter="">
The syntax theme to use in the script editor.
You can save your own syntax theme from your current settings by using [b]File &gt; Theme &gt; Save As...[/b] at the top of the script editor. The syntax theme will then be available locally in the list of color themes.
@@ -1187,7 +1412,7 @@
The script editor's documentation comment color. In GDScript, this is used for comments starting with [code]##[/code]. In C#, this is used for comments starting with [code]///[/code] or [code]/**[/code].
</member>
<member name="text_editor/theme/highlighting/engine_type_color" type="Color" setter="" getter="">
- The script editor's engine type color ([Vector2], [Vector3], [Color], ...).
+ The script editor's engine type color ([Object], [Mesh], [Node], ...).
</member>
<member name="text_editor/theme/highlighting/executing_line_color" type="Color" setter="" getter="">
The script editor's color for the debugger's executing line icon (displayed in the gutter).
@@ -1249,6 +1474,18 @@
<member name="text_editor/theme/highlighting/word_highlighted_color" type="Color" setter="" getter="">
The script editor's color for words highlighted by selecting them. Only visible if [member text_editor/appearance/caret/highlight_all_occurrences] is [code]true[/code].
</member>
+ <member name="text_editor/theme/line_spacing" type="int" setter="" getter="">
+ The vertical line separation used in text editors, in pixels.
+ </member>
+ <member name="version_control/ssh_private_key_path" type="String" setter="" getter="">
+ Path to private SSH key file for the editor's Version Control integration credentials.
+ </member>
+ <member name="version_control/ssh_public_key_path" type="String" setter="" getter="">
+ Path to public SSH key file for the editor's Version Control integration credentials.
+ </member>
+ <member name="version_control/username" type="String" setter="" getter="">
+ Default username for editor's Version Control integration.
+ </member>
</members>
<signals>
<signal name="settings_changed">
diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml
index 783f1243e2..83c65b736e 100644
--- a/doc/classes/EditorSpinSlider.xml
+++ b/doc/classes/EditorSpinSlider.xml
@@ -51,4 +51,12 @@
</description>
</signal>
</signals>
+ <theme_items>
+ <theme_item name="updown" data_type="icon" type="Texture2D">
+ Single texture representing both the up and down buttons.
+ </theme_item>
+ <theme_item name="updown_disabled" data_type="icon" type="Texture2D">
+ Single texture representing both the up and down buttons, when the control is readonly or disabled.
+ </theme_item>
+ </theme_items>
</class>
diff --git a/doc/classes/EditorToaster.xml b/doc/classes/EditorToaster.xml
new file mode 100644
index 0000000000..c30b94c989
--- /dev/null
+++ b/doc/classes/EditorToaster.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorToaster" inherits="HBoxContainer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+ <brief_description>
+ Manages toast notifications within the editor.
+ </brief_description>
+ <description>
+ This object manages the functionality and display of toast notifications within the editor, ensuring timely and informative alerts are presented to users.
+ [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_editor_toaster].
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="push_toast">
+ <return type="void" />
+ <param index="0" name="message" type="String" />
+ <param index="1" name="severity" type="int" enum="EditorToaster.Severity" default="0" />
+ <param index="2" name="tooltip" type="String" default="&quot;&quot;" />
+ <description>
+ Pushes a toast notification to the editor for display.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ <constant name="SEVERITY_INFO" value="0" enum="Severity">
+ Toast will display with an INFO severity.
+ </constant>
+ <constant name="SEVERITY_WARNING" value="1" enum="Severity">
+ Toast will display with a WARNING severity and have a corresponding color.
+ </constant>
+ <constant name="SEVERITY_ERROR" value="2" enum="Severity">
+ Toast will display with an ERROR severity and have a corresponding color.
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml
index a47a41594e..43bbeaefa7 100644
--- a/doc/classes/EditorTranslationParserPlugin.xml
+++ b/doc/classes/EditorTranslationParserPlugin.xml
@@ -69,8 +69,7 @@
msgidsContextPlural.Add(new Godot.Collections.Array{"Only with context", "a friendly context", ""});
[/csharp]
[/codeblocks]
- [b]Note:[/b] If you override parsing logic for standard script types (GDScript, C#, etc.), it would be better to load the [code]path[/code] argument using [method ResourceLoader.load]. This is because built-in scripts are loaded as [Resource] type, not [FileAccess] type.
- For example:
+ [b]Note:[/b] If you override parsing logic for standard script types (GDScript, C#, etc.), it would be better to load the [code]path[/code] argument using [method ResourceLoader.load]. This is because built-in scripts are loaded as [Resource] type, not [FileAccess] type. For example:
[codeblocks]
[gdscript]
func _parse_file(path, msgids, msgids_context_plural):
diff --git a/doc/classes/EditorUndoRedoManager.xml b/doc/classes/EditorUndoRedoManager.xml
index 26580bbf06..6a66a35ce8 100644
--- a/doc/classes/EditorUndoRedoManager.xml
+++ b/doc/classes/EditorUndoRedoManager.xml
@@ -68,11 +68,26 @@
Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!).
</description>
</method>
+ <method name="clear_history">
+ <return type="void" />
+ <param index="0" name="id" type="int" default="-99" />
+ <param index="1" name="increase_version" type="bool" default="true" />
+ <description>
+ Clears the given undo history. You can clear history for a specific scene, global history, or for all scenes at once if [param id] is [constant INVALID_HISTORY].
+ If [param increase_version] is [code]true[/code], the undo history version will be increased, marking it as unsaved. Useful for operations that modify the scene, but don't support undo.
+ [codeblock]
+ var scene_root = EditorInterface.get_edited_scene_root()
+ var undo_redo = EditorInterface.get_editor_undo_redo()
+ undo_redo.clear_history(undo_redo.get_object_history_id(scene_root))
+ [/codeblock]
+ [b]Note:[/b] If you want to mark an edited scene as unsaved without clearing its history, use [method EditorInterface.mark_scene_as_unsaved] instead.
+ </description>
+ </method>
<method name="commit_action">
<return type="void" />
<param index="0" name="execute" type="bool" default="true" />
<description>
- Commit the action. If [param execute] is true (default), all "do" methods/properties are called/set when this function is called.
+ Commits the action. If [param execute] is [code]true[/code] (default), all "do" methods/properties are called/set when this function is called.
</description>
</method>
<method name="create_action">
@@ -88,6 +103,13 @@
The way undo operation are ordered in actions is dictated by [param backward_undo_ops]. When [param backward_undo_ops] is [code]false[/code] undo option are ordered in the same order they were added. Which means the first operation to be added will be the first to be undone.
</description>
</method>
+ <method name="force_fixed_history">
+ <return type="void" />
+ <description>
+ Forces the next operation (e.g. [method add_do_method]) to use the action's history rather than guessing it from the object. This is sometimes needed when a history can't be correctly determined, like for a nested resource that doesn't have a path yet.
+ This method should only be used when absolutely necessary, otherwise it might cause invalid history state. For most of complex cases, the [code]custom_context[/code] parameter of [method create_action] is sufficient.
+ </description>
+ </method>
<method name="get_history_undo_redo" qualifiers="const">
<return type="UndoRedo" />
<param index="0" name="id" type="int" />
diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml
index ca78054875..bba5157053 100644
--- a/doc/classes/Engine.xml
+++ b/doc/classes/Engine.xml
@@ -337,6 +337,10 @@
[b]Note:[/b] This property does not impact the editor's Errors tab when running a project from the editor.
[b]Warning:[/b] If set to [code]false[/code] anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. In a [code]@tool[/code] script, this will also impact the editor itself. Do [i]not[/i] report bugs before ensuring error messages are enabled (as they are by default).
</member>
+ <member name="print_to_stdout" type="bool" setter="set_print_to_stdout" getter="is_printing_to_stdout" default="true">
+ If [code]false[/code], stops printing messages (for example using [method @GlobalScope.print]) to the console, log files, and editor Output log. This property is equivalent to the [member ProjectSettings.application/run/disable_stdout] project setting.
+ [b]Note:[/b] This does not stop printing errors or warnings produced by scripts to the console or log files, for more details see [member print_error_messages].
+ </member>
<member name="time_scale" type="float" setter="set_time_scale" getter="get_time_scale" default="1.0">
The speed multiplier at which the in-game clock updates, compared to real time. For example, if set to [code]2.0[/code] the game runs twice as fast, and if set to [code]0.5[/code] the game runs half as fast.
This value affects [Timer], [SceneTreeTimer], and all other simulations that make use of [code]delta[/code] time (such as [method Node._process] and [method Node._physics_process]).
diff --git a/doc/classes/EngineDebugger.xml b/doc/classes/EngineDebugger.xml
index 7583520da0..3540f098ba 100644
--- a/doc/classes/EngineDebugger.xml
+++ b/doc/classes/EngineDebugger.xml
@@ -87,7 +87,7 @@
<method name="line_poll">
<return type="void" />
<description>
- Forces a processing loop of debugger events. The purpose of this method is just processing events every now and then when the script might get too busy, so that bugs like infinite loops can be caught
+ Forces a processing loop of debugger events. The purpose of this method is just processing events every now and then when the script might get too busy, so that bugs like infinite loops can be caught.
</description>
</method>
<method name="profiler_add_frame_data">
@@ -113,7 +113,8 @@
<param index="1" name="callable" type="Callable" />
<description>
Registers a message capture with given [param name]. If [param name] is "my_message" then messages starting with "my_message:" will be called with the given callable.
- Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return [code]true[/code] otherwise [code]false[/code].
+ The callable must accept a message string and a data array as argument. The callable should return [code]true[/code] if the message is recognized.
+ [b]Note:[/b] The callable will receive the message with the prefix stripped, unlike [method EditorDebuggerPlugin._capture]. See the [EditorDebuggerPlugin] description for an example.
</description>
</method>
<method name="register_profiler">
diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml
index 8c26509812..47fc48305b 100644
--- a/doc/classes/Environment.xml
+++ b/doc/classes/Environment.xml
@@ -81,8 +81,9 @@
The background mode. See [enum BGMode] for possible values.
</member>
<member name="fog_aerial_perspective" type="float" setter="set_fog_aerial_perspective" getter="get_fog_aerial_perspective" default="0.0">
- If set above [code]0.0[/code] (exclusive), blends between the fog's color and the color of the background [Sky]. This has a small performance cost when set above [code]0.0[/code]. Must have [member background_mode] set to [constant BG_SKY].
+ If set above [code]0.0[/code] (exclusive), blends between the fog's color and the color of the background [Sky], as read from the radiance cubemap. This has a small performance cost when set above [code]0.0[/code]. Must have [member background_mode] set to [constant BG_SKY].
This is useful to simulate [url=https://en.wikipedia.org/wiki/Aerial_perspective]aerial perspective[/url] in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to [code]1.0[/code], the fog color comes completely from the [Sky]. If set to [code]0.0[/code], aerial perspective is disabled.
+ Notice that this does not sample the [Sky] directly, but rather the radiance cubemap. The cubemap is sampled at a mipmap level depending on the depth of the rendered pixel; the farther away, the higher the resolution of the sampled mipmap. This results in the actual color being a blurred version of the sky, with more blur closer to the camera. The highest mipmap resolution is used at a depth of [member Camera3D.far].
</member>
<member name="fog_density" type="float" setter="set_fog_density" getter="get_fog_density" default="0.01">
The fog density to be used. This is demonstrated in different ways depending on the [member fog_mode] mode chosen:
@@ -181,7 +182,8 @@
[b]Note:[/b] [member glow_map] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
</member>
<member name="glow_map_strength" type="float" setter="set_glow_map_strength" getter="get_glow_map_strength" default="0.8">
- How strong of an impact the [member glow_map] should have on the overall glow effect. A strength of [code]0.0[/code] means the glow map has no effect on the overall glow effect. A strength of [code]1.0[/code] means the glow has a full effect on the overall glow effect (and can turn off glow entirely in specific areas of the screen if the glow map has black areas).
+ How strong of an influence the [member glow_map] should have on the overall glow effect. A strength of [code]0.0[/code] means the glow map has no influence, while a strength of [code]1.0[/code] means the glow map has full influence.
+ [b]Note:[/b] If the glow map has black areas, a value of [code]1.0[/code] can also turn off the glow effect entirely in specific areas of the screen.
[b]Note:[/b] [member glow_map_strength] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
</member>
<member name="glow_mix" type="float" setter="set_glow_mix" getter="get_glow_mix" default="0.05">
@@ -414,7 +416,7 @@
Linear tonemapper operator. Reads the linear data and passes it on unmodified. This can cause bright lighting to look blown out, with noticeable clipping in the output colors.
</constant>
<constant name="TONE_MAPPER_REINHARDT" value="1" enum="ToneMapper">
- Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: [code]color = color / (1 + color)[/code]. This avoids clipping bright highlights, but the resulting image can look a bit dull.
+ Reinhard tonemapper operator. Performs a variation on rendered pixels' colors by this formula: [code]color = color * (1 + color / (white * white)) / (1 + color)[/code]. This avoids clipping bright highlights, but the resulting image can look a bit dull. When [member tonemap_white] is left at the default value of [code]1.0[/code] this is identical to [constant TONE_MAPPER_LINEAR] while also being slightly less performant.
</constant>
<constant name="TONE_MAPPER_FILMIC" value="2" enum="ToneMapper">
Filmic tonemapper operator. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than [constant TONE_MAPPER_REINHARDT].
diff --git a/doc/classes/ExternalTexture.xml b/doc/classes/ExternalTexture.xml
new file mode 100644
index 0000000000..6f27b62f24
--- /dev/null
+++ b/doc/classes/ExternalTexture.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="ExternalTexture" inherits="Texture2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+ <brief_description>
+ Texture which displays the content of an external buffer.
+ </brief_description>
+ <description>
+ Displays the content of an external buffer provided by the platform.
+ Requires the [url=https://registry.khronos.org/OpenGL/extensions/OES/OES_EGL_image_external.txt]OES_EGL_image_external[/url] extension (OpenGL) or [url=https://registry.khronos.org/vulkan/specs/1.1-extensions/html/vkspec.html#VK_ANDROID_external_memory_android_hardware_buffer]VK_ANDROID_external_memory_android_hardware_buffer[/url] extension (Vulkan).
+ [b]Note:[/b] This is currently only supported in Android builds.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="get_external_texture_id" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the external texture ID.
+ Depending on your use case, you may need to pass this to platform APIs, for example, when creating an [code]android.graphics.SurfaceTexture[/code] on Android.
+ </description>
+ </method>
+ <method name="set_external_buffer_id">
+ <return type="void" />
+ <param index="0" name="external_buffer_id" type="int" />
+ <description>
+ Sets the external buffer ID.
+ Depending on your use case, you may need to call this with data received from a platform API, for example, [code]SurfaceTexture.getHardwareBuffer()[/code] on Android.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" />
+ <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(256, 256)">
+ External texture size.
+ </member>
+ </members>
+</class>
diff --git a/doc/classes/FileAccess.xml b/doc/classes/FileAccess.xml
index 71a1fc8e09..b782937a8a 100644
--- a/doc/classes/FileAccess.xml
+++ b/doc/classes/FileAccess.xml
@@ -34,7 +34,7 @@
[/codeblocks]
In the example above, the file will be saved in the user data folder as specified in the [url=$DOCS_URL/tutorials/io/data_paths.html]Data paths[/url] documentation.
[FileAccess] will close when it's freed, which happens when it goes out of scope or when it gets assigned with [code]null[/code]. [method close] can be used to close it before then explicitly. In C# the reference must be disposed manually, which can be done with the [code]using[/code] statement or by calling the [code]Dispose[/code] method directly.
- [b]Note:[/b] To access project resources once exported, it is recommended to use [ResourceLoader] instead of [FileAccess], as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package.
+ [b]Note:[/b] To access project resources once exported, it is recommended to use [ResourceLoader] instead of [FileAccess], as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package. If using [FileAccess], make sure the file is included in the export by changing its import mode to [b]Keep File (exported as is)[/b] in the Import dock, or, for files where this option is not available, change the non-resource export filter in the Export dialog to include the file's extension (e.g. [code]*.txt[/code]).
[b]Note:[/b] Files are automatically closed only if the process exits "normally" (such as by clicking the window manager's close button or pressing [b]Alt + F4[/b]). If you stop the project execution by pressing [b]F8[/b] while the project is running, the file won't be closed as the game process will be killed. You can work around this by calling [method flush] at regular intervals.
</description>
<tutorials>
@@ -474,7 +474,7 @@
<return type="void" />
<param index="0" name="line" type="String" />
<description>
- Appends [param line] to the file followed by a line return character ([code]\n[/code]), encoding the text as UTF-8.
+ Stores [param line] in the file followed by a newline character ([code]\n[/code]), encoding the text as UTF-8.
</description>
</method>
<method name="store_pascal_string">
@@ -496,7 +496,7 @@
<return type="void" />
<param index="0" name="string" type="String" />
<description>
- Appends [param string] to the file without a line return, encoding the text as UTF-8.
+ Stores [param string] in the file without a newline character ([code]\n[/code]), encoding the text as UTF-8.
[b]Note:[/b] This method is intended to be used to write text files. The string is stored as a UTF-8 encoded buffer without string length or terminating zero, which means that it can't be loaded back easily. If you want to store a retrievable string in a binary file, consider using [method store_pascal_string] instead. For retrieving strings from a text file, you can use [code]get_buffer(length).get_string_from_utf8()[/code] (if you know the length) or [method get_as_text].
</description>
</method>
diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml
index dec3160ffe..64369bec30 100644
--- a/doc/classes/FileDialog.xml
+++ b/doc/classes/FileDialog.xml
@@ -29,6 +29,12 @@
[param default_value_index] should be an index of the value in the [param values]. If [param values] is empty it should be either [code]1[/code] (checked), or [code]0[/code] (unchecked).
</description>
</method>
+ <method name="clear_filename_filter">
+ <return type="void" />
+ <description>
+ Clear the filter for file names.
+ </description>
+ </method>
<method name="clear_filters">
<return type="void" />
<description>
@@ -80,12 +86,14 @@
<description>
Returns the vertical box container of the dialog, custom controls can be added to it.
[b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
+ [b]Note:[/b] Changes to this node are ignored by native file dialogs, use [method add_option] to add custom elements to the dialog instead.
</description>
</method>
<method name="invalidate">
<return type="void" />
<description>
Invalidate and update the current dialog content list.
+ [b]Note:[/b] This method does nothing on native file dialogs.
</description>
</method>
<method name="set_option_default">
@@ -116,10 +124,11 @@
<members>
<member name="access" type="int" setter="set_access" getter="get_access" enum="FileDialog.Access" default="0">
The file system access scope. See [enum Access] constants.
- [b]Warning:[/b] Currently, in sandboxed environments such as Web builds or sandboxed macOS apps, FileDialog cannot access the host file system. See [url=https://github.com/godotengine/godot-proposals/issues/1123]godot-proposals#1123[/url].
+ [b]Warning:[/b] In Web builds, FileDialog cannot access the host file system. In sandboxed Linux and macOS environments, [member use_native_dialog] is automatically used to allow limited access to host file system.
</member>
<member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir">
The current working directory of the file dialog.
+ [b]Note:[/b] For native file dialogs, this property is only treated as a hint and may not be respected by specific OS implementations.
</member>
<member name="current_file" type="String" setter="set_current_file" getter="get_current_file">
The currently selected file of the file dialog.
@@ -131,8 +140,13 @@
<member name="file_mode" type="int" setter="set_file_mode" getter="get_file_mode" enum="FileDialog.FileMode" default="4">
The dialog's open or save mode, which affects the selection behavior. See [enum FileMode].
</member>
+ <member name="filename_filter" type="String" setter="set_filename_filter" getter="get_filename_filter" default="&quot;&quot;">
+ The filter for file names (case-insensitive). When set to a non-empty string, only files that contains the substring will be shown. [member filename_filter] can be edited by the user with the filter button at the top of the file dialog.
+ See also [member filters], which should be used to restrict the file types that can be selected instead of [member filename_filter] which is meant to be set by the user.
+ </member>
<member name="filters" type="PackedStringArray" setter="set_filters" getter="get_filters" default="PackedStringArray()">
The available file type filters. Each filter string in the array should be formatted like this: [code]*.txt,*.doc;Text Files[/code]. The description text of the filter is optional and can be omitted.
+ [b]Note:[/b] For android native dialog, MIME types are used like this: [code]image/*, application/pdf[/code].
</member>
<member name="mode_overrides_title" type="bool" setter="set_mode_overrides_title" getter="is_mode_overriding_title" default="true">
If [code]true[/code], changing the [member file_mode] property will set the window title accordingly (e.g. setting [member file_mode] to [constant FILE_MODE_OPEN_FILE] will change the window title to "Open a File").
@@ -142,14 +156,20 @@
</member>
<member name="root_subfolder" type="String" setter="set_root_subfolder" getter="get_root_subfolder" default="&quot;&quot;">
If non-empty, the given sub-folder will be "root" of this [FileDialog], i.e. user won't be able to go to its parent directory.
+ [b]Note:[/b] This property is ignored by native file dialogs.
</member>
<member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files" default="false">
If [code]true[/code], the dialog will show hidden files.
+ [b]Note:[/b] This property is ignored by native file dialogs on Android and Linux.
</member>
+ <member name="size" type="Vector2i" setter="set_size" getter="get_size" overrides="Window" default="Vector2i(640, 360)" />
<member name="title" type="String" setter="set_title" getter="get_title" overrides="Window" default="&quot;Save a File&quot;" />
<member name="use_native_dialog" type="bool" setter="set_use_native_dialog" getter="get_use_native_dialog" default="false">
- If [code]true[/code], [member access] is set to [constant ACCESS_FILESYSTEM], and it is supported by the current [DisplayServer], OS native dialog will be used instead of custom one.
- [b]Note:[/b] On macOS, sandboxed apps always use native dialogs to access host filesystem.
+ If [code]true[/code], and if supported by the current [DisplayServer], OS native dialog will be used instead of custom one.
+ [b]Note:[/b] On Android, it is only supported when using [constant ACCESS_FILESYSTEM]. For access mode [constant ACCESS_RESOURCES] and [constant ACCESS_USERDATA], the system will fall back to custom FileDialog.
+ [b]Note:[/b] On Linux and macOS, sandboxed apps always use native dialogs to access the host file system.
+ [b]Note:[/b] On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use [method OS.get_granted_permissions] to get a list of saved bookmarks.
+ [b]Note:[/b] Native dialogs are isolated from the base process, file dialog properties can't be modified once the dialog is shown.
</member>
</members>
<signals>
@@ -165,6 +185,12 @@
Emitted when the user selects a file by double-clicking it or pressing the [b]OK[/b] button.
</description>
</signal>
+ <signal name="filename_filter_changed">
+ <param index="0" name="filter" type="String" />
+ <description>
+ Emitted when the filter for file names changes.
+ </description>
+ </signal>
<signal name="files_selected">
<param index="0" name="paths" type="PackedStringArray" />
<description>
@@ -229,6 +255,9 @@
<theme_item name="reload" data_type="icon" type="Texture2D">
Custom icon for the reload button.
</theme_item>
+ <theme_item name="toggle_filename_filter" data_type="icon" type="Texture2D">
+ Custom icon for the toggle button for the filter for file names.
+ </theme_item>
<theme_item name="toggle_hidden" data_type="icon" type="Texture2D">
Custom icon for the toggle hidden button.
</theme_item>
diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml
index e979a0b875..0b487f8525 100644
--- a/doc/classes/Font.xml
+++ b/doc/classes/Font.xml
@@ -279,7 +279,7 @@
To print available variation axes of a variable font:
[codeblock]
var fv = FontVariation.new()
- fv.set_base_font = load("res://RobotoFlex.ttf")
+ fv.base_font = load("res://RobotoFlex.ttf")
var variation_list = fv.get_supported_variation_list()
for tag in variation_list:
var name = TextServerManager.get_primary_interface().tag_to_name(tag)
diff --git a/doc/classes/FontFile.xml b/doc/classes/FontFile.xml
index 1b8fa00772..c230bf5ad2 100644
--- a/doc/classes/FontFile.xml
+++ b/doc/classes/FontFile.xml
@@ -58,7 +58,7 @@
<return type="void" />
<param index="0" name="cache_index" type="int" />
<description>
- Removes all font sizes from the cache entry
+ Removes all font sizes from the cache entry.
</description>
</method>
<method name="clear_textures">
diff --git a/doc/classes/FontVariation.xml b/doc/classes/FontVariation.xml
index 8a09c49f48..1de6d695a9 100644
--- a/doc/classes/FontVariation.xml
+++ b/doc/classes/FontVariation.xml
@@ -9,8 +9,8 @@
[codeblocks]
[gdscript]
var fv = FontVariation.new()
- fv.set_base_font(load("res://BarlowCondensed-Regular.ttf"))
- fv.set_variation_embolden(1.2)
+ fv.base_font = load("res://BarlowCondensed-Regular.ttf")
+ fv.variation_embolden = 1.2
$Label.add_theme_font_override("font", fv)
$Label.add_theme_font_size_override("font_size", 64)
[/gdscript]
diff --git a/doc/classes/GDExtensionManager.xml b/doc/classes/GDExtensionManager.xml
index 211bc023c0..97d2d08752 100644
--- a/doc/classes/GDExtensionManager.xml
+++ b/doc/classes/GDExtensionManager.xml
@@ -56,6 +56,20 @@
</method>
</methods>
<signals>
+ <signal name="extension_loaded">
+ <param index="0" name="extension" type="GDExtension" />
+ <description>
+ Emitted after the editor has finished loading a new extension.
+ [b]Note:[/b] This signal is only emitted in editor builds.
+ </description>
+ </signal>
+ <signal name="extension_unloading">
+ <param index="0" name="extension" type="GDExtension" />
+ <description>
+ Emitted before the editor starts unloading an extension.
+ [b]Note:[/b] This signal is only emitted in editor builds.
+ </description>
+ </signal>
<signal name="extensions_reloaded">
<description>
Emitted after the editor has finished reloading one or more extensions.
diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml
index 3c48f5ba31..96232f4277 100644
--- a/doc/classes/GPUParticles2D.xml
+++ b/doc/classes/GPUParticles2D.xml
@@ -136,7 +136,7 @@
<signal name="finished">
<description>
Emitted when all active particles have finished processing. To immediately restart the emission cycle, call [method restart].
- Never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously.
+ This signal is never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously.
[b]Note:[/b] For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the signal during which setting [member emitting] to [code]true[/code] will not restart the emission cycle. This delay is avoided by instead calling [method restart].
</description>
</signal>
diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml
index 61a3b467f1..f5df857391 100644
--- a/doc/classes/GPUParticles3D.xml
+++ b/doc/classes/GPUParticles3D.xml
@@ -160,8 +160,8 @@
<signals>
<signal name="finished">
<description>
- Emitted when all active particles have finished processing. To immediately emit new particles, call [method restart].
- Never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously.
+ Emitted when all active particles have finished processing. To immediately restart the emission cycle, call [method restart].
+ This signal is never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously.
[b]Note:[/b] For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the signal during which setting [member emitting] to [code]true[/code] will not restart the emission cycle. This delay is avoided by instead calling [method restart].
</description>
</signal>
diff --git a/doc/classes/GPUParticlesCollision3D.xml b/doc/classes/GPUParticlesCollision3D.xml
index 089747b7ee..2d398edd5e 100644
--- a/doc/classes/GPUParticlesCollision3D.xml
+++ b/doc/classes/GPUParticlesCollision3D.xml
@@ -16,8 +16,8 @@
<members>
<member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295">
The particle rendering layers ([member VisualInstance3D.layers]) that will be affected by the collision shape. By default, all particles that have [member ParticleProcessMaterial.collision_mode] set to [constant ParticleProcessMaterial.COLLISION_RIGID] or [constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] will be affected by a collision shape.
- After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by attractors. For example, this can be used if you're using an attractor as part of a spell effect but don't want the attractor to affect unrelated weather particles at the same position.
- Particle attraction can also be disabled on a per-process material basis by setting [member ParticleProcessMaterial.attractor_interaction_enabled] on the [GPUParticles3D] node.
+ After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by colliders. For example, this can be used if you're using a collider as part of a spell effect but don't want the collider to affect unrelated weather particles at the same position.
+ Particle collision can also be disabled on a per-process material basis by setting [member ParticleProcessMaterial.collision_mode] on the [GPUParticles3D] node.
</member>
</members>
</class>
diff --git a/doc/classes/Geometry2D.xml b/doc/classes/Geometry2D.xml
index f21696d02c..71e6cf93ae 100644
--- a/doc/classes/Geometry2D.xml
+++ b/doc/classes/Geometry2D.xml
@@ -9,6 +9,20 @@
<tutorials>
</tutorials>
<methods>
+ <method name="bresenham_line">
+ <return type="Vector2i[]" />
+ <param index="0" name="from" type="Vector2i" />
+ <param index="1" name="to" type="Vector2i" />
+ <description>
+ Returns the [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham line[/url] between the [param from] and [param to] points. A Bresenham line is a series of pixels that draws a line and is always 1-pixel thick on every row and column of the drawing (never more, never less).
+ Example code to draw a line between two [Marker2D] nodes using a series of [method CanvasItem.draw_rect] calls:
+ [codeblock]
+ func _draw():
+ for pixel in Geometry2D.bresenham_line($MarkerA.position, $MarkerB.position):
+ draw_rect(Rect2(pixel, Vector2.ONE), Color.WHITE)
+ [/codeblock]
+ </description>
+ </method>
<method name="clip_polygons">
<return type="PackedVector2Array[]" />
<param index="0" name="polygon_a" type="PackedVector2Array" />
@@ -126,8 +140,34 @@
<param index="2" name="from_b" type="Vector2" />
<param index="3" name="dir_b" type="Vector2" />
<description>
- Checks if the two lines ([param from_a], [param dir_a]) and ([param from_b], [param dir_b]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns [code]null[/code].
- [b]Note:[/b] The lines are specified using direction vectors, not end points.
+ Returns the point of intersection between the two lines ([param from_a], [param dir_a]) and ([param from_b], [param dir_b]). Returns a [Vector2], or [code]null[/code] if the lines are parallel.
+ [code]from[/code] and [code]dir[/code] are [i]not[/i] endpoints of a line segment or ray but the slope ([code]dir[/code]) and a known point ([code]from[/code]) on that line.
+ [codeblocks]
+ [gdscript]
+ var from_a = Vector2.ZERO
+ var dir_a = Vector2.RIGHT
+ var from_b = Vector2.DOWN
+
+ # Returns Vector2(1, 0)
+ Geometry2D.line_intersects_line(from_a, dir_a, from_b, Vector2(1, -1))
+ # Returns Vector2(-1, 0)
+ Geometry2D.line_intersects_line(from_a, dir_a, from_b, Vector2(-1, -1))
+ # Returns null
+ Geometry2D.line_intersects_line(from_a, dir_a, from_b, Vector2.RIGHT)
+ [/gdscript]
+ [csharp]
+ var fromA = Vector2.Zero;
+ var dirA = Vector2.Right;
+ var fromB = Vector2.Down;
+
+ // Returns new Vector2(1, 0)
+ Geometry2D.LineIntersectsLine(fromA, dirA, fromB, new Vector2(1, -1));
+ // Returns new Vector2(-1, 0)
+ Geometry2D.LineIntersectsLine(fromA, dirA, fromB, new Vector2(-1, -1));
+ // Returns null
+ Geometry2D.LineIntersectsLine(fromA, dirA, fromB, Vector2.Right);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="make_atlas">
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml
index 001839d745..3451e427f3 100644
--- a/doc/classes/GraphEdit.xml
+++ b/doc/classes/GraphEdit.xml
@@ -7,6 +7,7 @@
[GraphEdit] provides tools for creation, manipulation, and display of various graphs. Its main purpose in the engine is to power the visual programming systems, such as visual shaders, but it is also available for use in user projects.
[GraphEdit] by itself is only an empty container, representing an infinite grid where [GraphNode]s can be placed. Each [GraphNode] represents a node in the graph, a single unit of data in the connected scheme. [GraphEdit], in turn, helps to control various interactions with nodes and between nodes. When the user attempts to connect, disconnect, or delete a [GraphNode], a signal is emitted in the [GraphEdit], but no action is taken by default. It is the responsibility of the programmer utilizing this control to implement the necessary logic to determine how each request should be handled.
[b]Performance:[/b] It is greatly advised to enable low-processor usage mode (see [member OS.low_processor_usage_mode]) when using GraphEdits.
+ [b]Note:[/b] Keep in mind that [method Node.get_children] will also return the connection layer node named [code]_connection_layer[/code] due to technical limitations. This behavior may change in future releases.
</description>
<tutorials>
</tutorials>
@@ -398,6 +399,11 @@
Emitted when this [GraphEdit] captures a [code]ui_copy[/code] action ([kbd]Ctrl + C[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be copied.
</description>
</signal>
+ <signal name="cut_nodes_request">
+ <description>
+ Emitted when this [GraphEdit] captures a [code]ui_cut[/code] action ([kbd]Ctrl + X[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be cut.
+ </description>
+ </signal>
<signal name="delete_nodes_request">
<param index="0" name="nodes" type="StringName[]" />
<description>
diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml
index cc3acad6d6..fc8bc15b5c 100644
--- a/doc/classes/GraphNode.xml
+++ b/doc/classes/GraphNode.xml
@@ -154,7 +154,7 @@
<return type="bool" />
<param index="0" name="slot_index" type="int" />
<description>
- Returns true if the background [StyleBox] of the slot with the given [param slot_index] is drawn.
+ Returns [code]true[/code] if the background [StyleBox] of the slot with the given [param slot_index] is drawn.
</description>
</method>
<method name="is_slot_enabled_left" qualifiers="const">
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index b6007a3b6b..366038e43f 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -12,7 +12,7 @@
[b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.
[b]Note:[/b] It's recommended to use transport encryption (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 Web, 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] 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]Note:[/b] TLS support is currently limited to TLSv1.2 and TLSv1.3. Attempting to connect to a server that only supports older (insecure) TLS versions will return an error.
[b]Warning:[/b] 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.
</description>
<tutorials>
@@ -59,8 +59,7 @@
<method name="get_response_headers_as_dictionary">
<return type="Dictionary" />
<description>
- Returns all response headers as a Dictionary of structure [code]{ "key": "value1; value2" }[/code] where the case-sensitivity of the keys and values is kept like the server delivers it. A value is a simple String, this string can have more than one value where "; " is used as separator.
- [b]Example:[/b]
+ Returns all response headers as a [Dictionary]. Each entry is composed by the header name, and a [String] containing the values separated by [code]"; "[/code]. The casing is kept the same as the headers were received.
[codeblock]
{
"content-length": 12,
@@ -278,7 +277,11 @@
HTTP status code [code]102 Processing[/code] (WebDAV). Indicates that the server has received and is processing the request, but no response is available yet.
</constant>
<constant name="RESPONSE_OK" value="200" enum="ResponseCode">
- HTTP status code [code]200 OK[/code]. The request has succeeded. Default response for successful requests. Meaning varies depending on the request. GET: The resource has been fetched and is transmitted in the message body. HEAD: The entity headers are in the message body. POST: The resource describing the result of the action is transmitted in the message body. TRACE: The message body contains the request message as received by the server.
+ HTTP status code [code]200 OK[/code]. The request has succeeded. Default response for successful requests. Meaning varies depending on the request:
+ - [constant METHOD_GET]: The resource has been fetched and is transmitted in the message body.
+ - [constant METHOD_HEAD]: The entity headers are in the message body.
+ - [constant METHOD_POST]: The resource describing the result of the action is transmitted in the message body.
+ - [constant METHOD_TRACE]: The message body contains the request message as received by the server.
</constant>
<constant name="RESPONSE_CREATED" value="201" enum="ResponseCode">
HTTP status code [code]201 Created[/code]. The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index 6efa675a71..36f5e82652 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -8,7 +8,7 @@
Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP.
[b]Warning:[/b] See the notes and warnings on [HTTPClient] for limitations, especially regarding TLS security.
[b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.
- [b]Example of contacting a REST API and printing one of its returned fields:[/b]
+ [b]Example:[/b] Contact a REST API and print one of its returned fields:
[codeblocks]
[gdscript]
func _ready():
@@ -80,7 +80,7 @@
}
[/csharp]
[/codeblocks]
- [b]Example of loading and displaying an image using HTTPRequest:[/b]
+ [b]Example:[/b] Load an image using [HTTPRequest] and display it:
[codeblocks]
[gdscript]
func _ready():
@@ -150,7 +150,7 @@
}
[/csharp]
[/codeblocks]
- [b]Gzipped response bodies[/b]: HTTPRequest will automatically handle decompression of response bodies. A [code]Accept-Encoding[/code] header will be automatically added to each of your requests, unless one is already specified. Any response with a [code]Content-Encoding: gzip[/code] header will automatically be decompressed and delivered to you as uncompressed bytes.
+ [b]Note:[/b] [HTTPRequest] nodes will automatically handle decompression of response bodies. A [code]Accept-Encoding[/code] header will be automatically added to each of your requests, unless one is already specified. Any response with a [code]Content-Encoding: gzip[/code] header will automatically be decompressed and delivered to you as uncompressed bytes.
</description>
<tutorials>
<link title="Making HTTP requests">$DOCS_URL/tutorials/networking/http_request_class.html</link>
@@ -275,6 +275,7 @@
Request successful.
</constant>
<constant name="RESULT_CHUNKED_BODY_SIZE_MISMATCH" value="1" enum="Result">
+ Request failed due to a mismatch between the expected and actual chunked body size during transfer. Possible causes include network errors, server misconfiguration, or issues with chunked encoding.
</constant>
<constant name="RESULT_CANT_CONNECT" value="2" enum="Result">
Request failed while connecting.
@@ -295,6 +296,7 @@
Request exceeded its maximum size limit, see [member body_size_limit].
</constant>
<constant name="RESULT_BODY_DECOMPRESS_FAILED" value="8" enum="Result">
+ Request failed due to an error while decompressing the response body. Possible causes include unsupported or incorrect compression format, corrupted data, or incomplete transfer.
</constant>
<constant name="RESULT_REQUEST_FAILED" value="9" enum="Result">
Request failed (currently unused).
diff --git a/doc/classes/HashingContext.xml b/doc/classes/HashingContext.xml
index f2681ae7b3..b42acb2b99 100644
--- a/doc/classes/HashingContext.xml
+++ b/doc/classes/HashingContext.xml
@@ -20,8 +20,9 @@
# Open the file to hash.
var file = FileAccess.open(path, FileAccess.READ)
# Update the context after reading each chunk.
- while not file.eof_reached():
- ctx.update(file.get_buffer(CHUNK_SIZE))
+ while file.get_position() &lt; file.get_length():
+ var remaining = file.get_length() - file.get_position()
+ ctx.update(file.get_buffer(min(remaining, CHUNK_SIZE)))
# Get the computed hash.
var res = ctx.finish()
# Print the result as hex string and array.
@@ -43,9 +44,10 @@
// Open the file to hash.
using var file = FileAccess.Open(path, FileAccess.ModeFlags.Read);
// Update the context after reading each chunk.
- while (!file.EofReached())
+ while (file.GetPosition() &lt; file.GetLength())
{
- ctx.Update(file.GetBuffer(ChunkSize));
+ int remaining = (int)(file.GetLength() - file.GetPosition());
+ ctx.Update(file.GetBuffer(Mathf.Min(remaining, ChunkSize)));
}
// Get the computed hash.
byte[] res = ctx.Finish();
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index db7796778e..4421318be7 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -48,6 +48,7 @@
<param index="2" name="dst" type="Vector2i" />
<description>
Copies [param src_rect] from [param src] image to this image at coordinates [param dst], clipped accordingly to both image bounds. This image and [param src] image [b]must[/b] have the same format. [param src_rect] with non-positive size is treated as empty.
+ [b]Note:[/b] The alpha channel data in [param src] will overwrite the corresponding data in this image at the target position. To blend alpha channels, use [method blend_rect] instead.
</description>
</method>
<method name="blit_rect_mask">
@@ -321,6 +322,12 @@
Returns [code]true[/code] if all the image's pixels have an alpha value of 0. Returns [code]false[/code] if any pixel has an alpha value higher than 0.
</description>
</method>
+ <method name="linear_to_srgb">
+ <return type="void" />
+ <description>
+ Converts the entire image from the linear colorspace to the sRGB colorspace. Only works on images with [constant FORMAT_RGB8] or [constant FORMAT_RGBA8] formats.
+ </description>
+ </method>
<method name="load">
<return type="int" enum="Error" />
<param index="0" name="path" type="String" />
@@ -504,7 +511,7 @@
<param index="1" name="lossy" type="bool" default="false" />
<param index="2" name="quality" type="float" default="0.75" />
<description>
- Saves the image as a WebP (Web Picture) file to the file at [param path]. By default it will save lossless. If [param lossy] is true, the image will be saved lossy, using the [param quality] setting between 0.0 and 1.0 (inclusive). Lossless WebP offers more efficient compression than PNG.
+ Saves the image as a WebP (Web Picture) file to the file at [param path]. By default it will save lossless. If [param lossy] is [code]true[/code], the image will be saved lossy, using the [param quality] setting between [code]0.0[/code] and [code]1.0[/code] (inclusive). Lossless WebP offers more efficient compression than PNG.
[b]Note:[/b] The WebP format is limited to a size of 16383×16383 pixels, while PNG can save larger images.
</description>
</method>
@@ -513,7 +520,7 @@
<param index="0" name="lossy" type="bool" default="false" />
<param index="1" name="quality" type="float" default="0.75" />
<description>
- Saves the image as a WebP (Web Picture) file to a byte array. By default it will save lossless. If [param lossy] is true, the image will be saved lossy, using the [param quality] setting between 0.0 and 1.0 (inclusive). Lossless WebP offers more efficient compression than PNG.
+ Saves the image as a WebP (Web Picture) file to a byte array. By default it will save lossless. If [param lossy] is [code]true[/code], the image will be saved lossy, using the [param quality] setting between [code]0.0[/code] and [code]1.0[/code] (inclusive). Lossless WebP offers more efficient compression than PNG.
[b]Note:[/b] The WebP format is limited to a size of 16383×16383 pixels, while PNG can save larger images.
</description>
</method>
@@ -535,7 +542,6 @@
<param index="2" name="color" type="Color" />
<description>
Sets the [Color] of the pixel at [code](x, y)[/code] to [param color].
- [b]Example:[/b]
[codeblocks]
[gdscript]
var img_width = 10
@@ -561,7 +567,6 @@
<param index="1" name="color" type="Color" />
<description>
Sets the [Color] of the pixel at [param point] to [param color].
- [b]Example:[/b]
[codeblocks]
[gdscript]
var img_width = 10
@@ -590,7 +595,7 @@
<method name="srgb_to_linear">
<return type="void" />
<description>
- Converts the raw data from the sRGB colorspace to a linear scale.
+ Converts the raw data from the sRGB colorspace to a linear scale. Only works on images with [constant FORMAT_RGB8] or [constant FORMAT_RGBA8] formats.
</description>
</method>
</methods>
diff --git a/doc/classes/ImporterMesh.xml b/doc/classes/ImporterMesh.xml
index eeabcd6e12..745d7a3d5d 100644
--- a/doc/classes/ImporterMesh.xml
+++ b/doc/classes/ImporterMesh.xml
@@ -49,7 +49,8 @@
<param index="2" name="bone_transform_array" type="Array" />
<description>
Generates all lods for this ImporterMesh.
- [param normal_merge_angle] and [param normal_split_angle] are in degrees and used in the same way as the importer settings in [code]lods[/code]. As a good default, use 25 and 60 respectively.
+ [param normal_merge_angle] is in degrees and used in the same way as the importer settings in [code]lods[/code].
+ [param normal_split_angle] is not used and only remains for compatibility with older versions of the API.
The number of generated lods can be accessed using [method get_surface_lod_count], and each LOD is available in [method get_surface_lod_size] and [method get_surface_lod_indices].
[param bone_transform_array] is an [Array] which can be either empty or contain [Transform3D]s which, for each of the mesh's bone IDs, will apply mesh skinning when generating the LOD mesh variations. This is usually used to account for discrepancies in scale between the mesh itself and its skinning data.
</description>
@@ -191,8 +192,4 @@
</description>
</method>
</methods>
- <members>
- <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" default="{ &quot;surfaces&quot;: [] }">
- </member>
- </members>
</class>
diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml
index 1e7b63ecce..6fe5b7a802 100644
--- a/doc/classes/Input.xml
+++ b/doc/classes/Input.xml
@@ -133,6 +133,7 @@
[code]vendor_id[/code]: The USB vendor ID of the device.
[code]product_id[/code]: The USB product ID of the device.
[code]steam_input_index[/code]: The Steam Input gamepad index, if the device is not a Steam Input device this key won't be present.
+ [b]Note:[/b] The returned dictionary is always empty on Web, iOS, Android, and macOS.
</description>
</method>
<method name="get_joy_name">
@@ -286,7 +287,6 @@
<param index="0" name="event" type="InputEvent" />
<description>
Feeds an [InputEvent] to the game. Can be used to artificially trigger input events from code. Also generates [method Node._input] calls.
- [b]Example:[/b]
[codeblocks]
[gdscript]
var cancel_event = InputEventAction.new()
diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml
index 6f2e6aac20..6cf490accb 100644
--- a/doc/classes/InputEvent.xml
+++ b/doc/classes/InputEvent.xml
@@ -77,10 +77,11 @@
Returns [code]true[/code] if this input event has been canceled.
</description>
</method>
- <method name="is_echo" qualifiers="const">
+ <method name="is_echo" qualifiers="const" keywords="is_repeat">
<return type="bool" />
<description>
- Returns [code]true[/code] if this input event is an echo event (only for events of type [InputEventKey]). Any other event type returns [code]false[/code].
+ Returns [code]true[/code] if this input event is an echo event (only for events of type [InputEventKey]). An echo event is a repeated key event sent when the user is holding down the key. Any other event type returns [code]false[/code].
+ [b]Note:[/b] The rate at which echo events are sent is typically around 20 events per second (after holding down the key for roughly half a second). However, the key repeat delay/speed can be changed by the user or disabled entirely in the operating system settings. To ensure your project works correctly on all configurations, do not assume the user has a specific key repeat configuration in your project's behavior.
</description>
</method>
<method name="is_match" qualifiers="const">
@@ -90,6 +91,7 @@
<description>
Returns [code]true[/code] if the specified [param event] matches this event. Only valid for action events i.e key ([InputEventKey]), button ([InputEventMouseButton] or [InputEventJoypadButton]), axis [InputEventJoypadMotion] or action ([InputEventAction]) events.
If [param exact_match] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events.
+ [b]Note:[/b] Only considers the event configuration (such as the keyboard key or joypad axis), not state information like [method is_pressed], [method is_released], [method is_echo], or [method is_canceled].
</description>
</method>
<method name="is_pressed" qualifiers="const">
diff --git a/doc/classes/InputEventKey.xml b/doc/classes/InputEventKey.xml
index dc4872ba03..69c447ba01 100644
--- a/doc/classes/InputEventKey.xml
+++ b/doc/classes/InputEventKey.xml
@@ -59,8 +59,9 @@
</method>
</methods>
<members>
- <member name="echo" type="bool" setter="set_echo" getter="is_echo" default="false">
- If [code]true[/code], the key was already pressed before this event. It means the user is holding the key down.
+ <member name="echo" type="bool" setter="set_echo" getter="is_echo" default="false" keywords="repeat">
+ If [code]true[/code], the key was already pressed before this event. An echo event is a repeated key event sent when the user is holding down the key.
+ [b]Note:[/b] The rate at which echo events are sent is typically around 20 events per second (after holding down the key for roughly half a second). However, the key repeat delay/speed can be changed by the user or disabled entirely in the operating system settings. To ensure your project works correctly on all configurations, do not assume the user has a specific key repeat configuration in your project's behavior.
</member>
<member name="key_label" type="int" setter="set_key_label" getter="get_key_label" enum="Key" default="0">
Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants or any valid Unicode character.
diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml
index 98a0221fe8..4c1461d03a 100644
--- a/doc/classes/InputEventMouseMotion.xml
+++ b/doc/classes/InputEventMouseMotion.xml
@@ -5,7 +5,8 @@
</brief_description>
<description>
Stores information about a mouse or a pen motion. This includes relative position, absolute position, and velocity. See [method Node._input].
- [b]Note:[/b] By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, set [member Input.use_accumulated_input] to [code]false[/code] to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider implementing [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to avoid visible gaps in lines if the user is moving the mouse quickly.
+ [b]Note:[/b] By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, set [member Input.use_accumulated_input] to [code]false[/code] to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider using [method Geometry2D.bresenham_line] as well to avoid visible gaps in lines if the user is moving the mouse quickly.
+ [b]Note:[/b] This event may be emitted even when the mouse hasn't moved, either by the operating system or by Godot itself. If you really need to know if the mouse has moved (e.g. to suppress displaying a tooltip), you should check that [code]relative.is_zero_approx()[/code] is [code]false[/code].
</description>
<tutorials>
<link title="Using InputEvent">$DOCS_URL/tutorials/inputs/inputevent.html</link>
@@ -22,12 +23,13 @@
</member>
<member name="relative" type="Vector2" setter="set_relative" getter="get_relative" default="Vector2(0, 0)">
The mouse position relative to the previous position (position at the last frame).
- [b]Note:[/b] Since [InputEventMouseMotion] is only emitted when the mouse moves, the last event won't have a relative position of [code]Vector2(0, 0)[/code] when the user stops moving the mouse.
+ [b]Note:[/b] Since [InputEventMouseMotion] may only be emitted when the mouse moves, it is not possible to reliably detect when the mouse has stopped moving by checking this property. A separate, short timer may be necessary.
[b]Note:[/b] [member relative] is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means mouse sensitivity will appear different depending on resolution when using [member relative] in a script that handles mouse aiming with the [constant Input.MOUSE_MODE_CAPTURED] mouse mode. To avoid this, use [member screen_relative] instead.
</member>
<member name="screen_relative" type="Vector2" setter="set_screen_relative" getter="get_screen_relative" default="Vector2(0, 0)">
The unscaled mouse position relative to the previous position in the coordinate system of the screen (position at the last frame).
- [b]Note:[/b] Since [InputEventMouseMotion] is only emitted when the mouse moves, the last event won't have a relative position of [code]Vector2(0, 0)[/code] when the user stops moving the mouse. This coordinate is [i]not[/i] scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member relative] for mouse aiming when using the [constant Input.MOUSE_MODE_CAPTURED] mouse mode, regardless of the project's stretch mode.
+ [b]Note:[/b] Since [InputEventMouseMotion] may only be emitted when the mouse moves, it is not possible to reliably detect when the mouse has stopped moving by checking this property. A separate, short timer may be necessary.
+ [b]Note:[/b] This coordinate is [i]not[/i] scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member relative] for mouse aiming when using the [constant Input.MOUSE_MODE_CAPTURED] mouse mode, regardless of the project's stretch mode.
</member>
<member name="screen_velocity" type="Vector2" setter="set_screen_velocity" getter="get_screen_velocity" default="Vector2(0, 0)">
The unscaled mouse velocity in pixels per second in screen coordinates. This velocity is [i]not[/i] scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member velocity] for mouse aiming when using the [constant Input.MOUSE_MODE_CAPTURED] mouse mode, regardless of the project's stretch mode.
diff --git a/doc/classes/InputEventShortcut.xml b/doc/classes/InputEventShortcut.xml
index 3c698fd4fb..414dd7e8ce 100644
--- a/doc/classes/InputEventShortcut.xml
+++ b/doc/classes/InputEventShortcut.xml
@@ -4,7 +4,7 @@
Represents a triggered keyboard [Shortcut].
</brief_description>
<description>
- InputEventShortcut is a special event that can be received in [method Node._unhandled_key_input]. It is typically sent by the editor's Command Palette to trigger actions, but can also be sent manually using [method Viewport.push_input].
+ InputEventShortcut is a special event that can be received in [method Node._input], [method Node._shortcut_input], and [method Node._unhandled_input]. It is typically sent by the editor's Command Palette to trigger actions, but can also be sent manually using [method Viewport.push_input].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml
index ff04040826..0abd7c6974 100644
--- a/doc/classes/InputMap.xml
+++ b/doc/classes/InputMap.xml
@@ -67,7 +67,7 @@
<method name="add_action">
<return type="void" />
<param index="0" name="action" type="StringName" />
- <param index="1" name="deadzone" type="float" default="0.5" />
+ <param index="1" name="deadzone" type="float" default="0.2" />
<description>
Adds an empty action to the [InputMap] with a configurable [param deadzone].
An [InputEvent] can then be added to this action with [method action_add_event].
diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml
index a1e5d9cbd9..7754a61e8c 100644
--- a/doc/classes/ItemList.xml
+++ b/doc/classes/ItemList.xml
@@ -29,7 +29,7 @@
<description>
Adds an item to the item list with specified text. Returns the index of an added item.
Specify an [param icon], or use [code]null[/code] as the [param icon] for a list item with no icon.
- If selectable is [code]true[/code], the list item will be selectable.
+ If [param selectable] is [code]true[/code], the list item will be selectable.
</description>
</method>
<method name="clear">
@@ -73,6 +73,13 @@
[b]Note:[/b] The returned value is unreliable if called right after modifying the [ItemList], before it redraws in the next frame.
</description>
</method>
+ <method name="get_item_auto_translate_mode" qualifiers="const">
+ <return type="int" enum="Node.AutoTranslateMode" />
+ <param index="0" name="idx" type="int" />
+ <description>
+ Returns item's auto translate mode.
+ </description>
+ </method>
<method name="get_item_custom_bg_color" qualifiers="const">
<return type="Color" />
<param index="0" name="idx" type="int" />
@@ -230,6 +237,15 @@
[b]Note:[/b] This method does not trigger the item selection signal.
</description>
</method>
+ <method name="set_item_auto_translate_mode">
+ <return type="void" />
+ <param index="0" name="idx" type="int" />
+ <param index="1" name="mode" type="int" enum="Node.AutoTranslateMode" />
+ <description>
+ Sets the auto translate mode of the item associated with the specified index.
+ Items use [constant Node.AUTO_TRANSLATE_MODE_INHERIT] by default, which uses the same auto translate mode as the [ItemList] itself.
+ </description>
+ </method>
<method name="set_item_custom_bg_color">
<return type="void" />
<param index="0" name="idx" type="int" />
@@ -363,6 +379,9 @@
<member name="auto_height" type="bool" setter="set_auto_height" getter="has_auto_height" default="false">
If [code]true[/code], the control will automatically resize the height to fit its content.
</member>
+ <member name="auto_width" type="bool" setter="set_auto_width" getter="has_auto_width" default="false">
+ If [code]true[/code], the control will automatically resize the width to fit its content.
+ </member>
<member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" />
<member name="fixed_column_width" type="int" setter="set_fixed_column_width" getter="get_fixed_column_width" default="0">
The width all columns will be adjusted to.
@@ -407,13 +426,14 @@
<param index="0" name="at_position" type="Vector2" />
<param index="1" name="mouse_button_index" type="int" />
<description>
- Triggered when any mouse click is issued within the rect of the list but on empty space.
+ Emitted when any mouse click is issued within the rect of the list but on empty space.
+ [param at_position] is the click position in this control's local coordinate system.
</description>
</signal>
<signal name="item_activated">
<param index="0" name="index" type="int" />
<description>
- Triggered when specified list item is activated via double-clicking or by pressing [kbd]Enter[/kbd].
+ Emitted when specified list item is activated via double-clicking or by pressing [kbd]Enter[/kbd].
</description>
</signal>
<signal name="item_clicked">
@@ -421,14 +441,14 @@
<param index="1" name="at_position" type="Vector2" />
<param index="2" name="mouse_button_index" type="int" />
<description>
- Triggered when specified list item has been clicked with any mouse button.
- The click position is also provided to allow appropriate popup of context menus at the correct location.
+ Emitted when specified list item has been clicked with any mouse button.
+ [param at_position] is the click position in this control's local coordinate system.
</description>
</signal>
<signal name="item_selected">
<param index="0" name="index" type="int" />
<description>
- Triggered when specified item has been selected.
+ Emitted when specified item has been selected. Only applicable in single selection mode.
[member allow_reselect] must be enabled to reselect an item.
</description>
</signal>
@@ -436,7 +456,7 @@
<param index="0" name="index" type="int" />
<param index="1" name="selected" type="bool" />
<description>
- Triggered when a multiple selection is altered on a list allowing multiple selection.
+ Emitted when a multiple selection is altered on a list allowing multiple selection.
</description>
</signal>
</signals>
diff --git a/doc/classes/JSON.xml b/doc/classes/JSON.xml
index b73ca4a1a6..fe5fdfa89a 100644
--- a/doc/classes/JSON.xml
+++ b/doc/classes/JSON.xml
@@ -4,10 +4,9 @@
Helper class for creating and parsing JSON data.
</brief_description>
<description>
- The [JSON] enables all data types to be converted to and from a JSON string. This useful for serializing data to save to a file or send over the network.
+ The [JSON] class enables all data types to be converted to and from a JSON string. This is useful for serializing data, e.g. to save to a file or send over the network.
[method stringify] is used to convert any data type into a JSON string.
- [method parse] is used to convert any existing JSON data into a [Variant] that can be used within Godot. If successfully parsed, use [member data] to retrieve the [Variant], and use [code]typeof[/code] to check if the Variant's type is what you expect. JSON Objects are converted into a [Dictionary], but JSON data can be used to store [Array]s, numbers, [String]s and even just a boolean.
- [b]Example[/b]
+ [method parse] is used to convert any existing JSON data into a [Variant] that can be used within Godot. If successfully parsed, use [member data] to retrieve the [Variant], and use [method @GlobalScope.typeof] to check if the Variant's type is what you expect. JSON Objects are converted into a [Dictionary], but JSON data can be used to store [Array]s, numbers, [String]s and even just a boolean.
[codeblock]
var data_to_send = ["a", "b", "c"]
var json_string = JSON.stringify(data_to_send)
@@ -25,7 +24,7 @@
else:
print("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line())
[/codeblock]
- Alternatively, you can parse string using the static [method parse_string] method, but it doesn't allow to handle errors.
+ Alternatively, you can parse strings using the static [method parse_string] method, but it doesn't handle errors.
[codeblock]
var data = JSON.parse_string(json_string) # Returns null if parsing failed.
[/codeblock]
@@ -33,11 +32,21 @@
- Trailing commas in arrays or objects are ignored, instead of causing a parser error.
- New line and tab characters are accepted in string literals, and are treated like their corresponding escape sequences [code]\n[/code] and [code]\t[/code].
- Numbers are parsed using [method String.to_float] which is generally more lax than the JSON specification.
- - Certain errors, such as invalid Unicode sequences, do not cause a parser error. Instead, the string is cleansed and an error is logged to the console.
+ - Certain errors, such as invalid Unicode sequences, do not cause a parser error. Instead, the string is cleaned up and an error is logged to the console.
</description>
<tutorials>
</tutorials>
<methods>
+ <method name="from_native" qualifiers="static">
+ <return type="Variant" />
+ <param index="0" name="variant" type="Variant" />
+ <param index="1" name="allow_classes" type="bool" default="false" />
+ <param index="2" name="allow_scripts" type="bool" default="false" />
+ <description>
+ Converts a native engine type to a JSON-compliant dictionary.
+ By default, classes and scripts are ignored for security reasons, unless [param allow_classes] or [param allow_scripts] are specified.
+ </description>
+ </method>
<method name="get_error_line" qualifiers="const">
<return type="int" />
<description>
@@ -53,7 +62,7 @@
<method name="get_parsed_text" qualifiers="const">
<return type="String" />
<description>
- Return the text parsed by [method parse] as long as the function is instructed to keep it.
+ Return the text parsed by [method parse] (requires passing [code]keep_text[/code] to [method parse]).
</description>
</method>
<method name="parse">
@@ -62,7 +71,7 @@
<param index="1" name="keep_text" type="bool" default="false" />
<description>
Attempts to parse the [param json_text] provided.
- Returns an [enum Error]. If the parse was successful, it returns [constant OK] and the result can be retrieved using [member data]. If unsuccessful, use [method get_error_line] and [method get_error_message] for identifying the source of the failure.
+ Returns an [enum Error]. If the parse was successful, it returns [constant OK] and the result can be retrieved using [member data]. If unsuccessful, use [method get_error_line] and [method get_error_message] to identify the source of the failure.
Non-static variant of [method parse_string], if you want custom error handling.
The optional [param keep_text] argument instructs the parser to keep a copy of the original text. This text can be obtained later by using the [method get_parsed_text] function and is used when saving the resource (instead of generating new text from [member data]).
</description>
@@ -84,7 +93,7 @@
Converts a [Variant] var to JSON text and returns the result. Useful for serializing data to store or send over the network.
[b]Note:[/b] The JSON specification does not define integer or float types, but only a [i]number[/i] type. Therefore, converting a Variant to JSON text will convert all numerical values to [float] types.
[b]Note:[/b] If [param full_precision] is [code]true[/code], when stringifying floats, the unreliable digits are stringified in addition to the reliable digits to guarantee exact decoding.
- The [param indent] parameter controls if and how something is indented, the string used for this parameter will be used where there should be an indent in the output, even spaces like [code]" "[/code] will work. [code]\t[/code] and [code]\n[/code] can also be used for a tab indent, or to make a newline for each indent respectively.
+ The [param indent] parameter controls if and how something is indented; its contents will be used where there should be an indent in the output. Even spaces like [code]" "[/code] will work. [code]\t[/code] and [code]\n[/code] can also be used for a tab indent, or to make a newline for each indent respectively.
[b]Example output:[/b]
[codeblock]
## JSON.stringify(my_dictionary)
@@ -124,6 +133,16 @@
[/codeblock]
</description>
</method>
+ <method name="to_native" qualifiers="static">
+ <return type="Variant" />
+ <param index="0" name="json" type="Variant" />
+ <param index="1" name="allow_classes" type="bool" default="false" />
+ <param index="2" name="allow_scripts" type="bool" default="false" />
+ <description>
+ Converts a JSON-compliant dictionary that was created with [method from_native] back to native engine types.
+ By default, classes and scripts are ignored for security reasons, unless [param allow_classes] or [param allow_scripts] are specified.
+ </description>
+ </method>
</methods>
<members>
<member name="data" type="Variant" setter="set_data" getter="get_data" default="null">
diff --git a/doc/classes/JavaClass.xml b/doc/classes/JavaClass.xml
index ecfcaa8781..9a6c30df10 100644
--- a/doc/classes/JavaClass.xml
+++ b/doc/classes/JavaClass.xml
@@ -1,13 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="JavaClass" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Represents an object from the Java Native Interface.
+ Represents a class from the Java Native Interface.
</brief_description>
<description>
- Represents an object from the Java Native Interface. It is returned from [method JavaClassWrapper.wrap].
- [b]Note:[/b] This class only works on Android. For any other build, this class does nothing.
+ Represents a class from the Java Native Interface. It is returned from [method JavaClassWrapper.wrap].
+ [b]Note:[/b] This class only works on Android. On any other platform, this class does nothing.
[b]Note:[/b] This class is not to be confused with [JavaScriptObject].
</description>
<tutorials>
</tutorials>
+ <methods>
+ <method name="get_java_class_name" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the Java class name.
+ </description>
+ </method>
+ <method name="get_java_method_list" qualifiers="const">
+ <return type="Dictionary[]" />
+ <description>
+ Returns the object's Java methods and their signatures as an [Array] of dictionaries, in the same format as [method Object.get_method_list].
+ </description>
+ </method>
+ <method name="get_java_parent_class" qualifiers="const">
+ <return type="JavaClass" />
+ <description>
+ Returns a [JavaClass] representing the Java parent class of this class.
+ </description>
+ </method>
+ </methods>
</class>
diff --git a/doc/classes/JavaClassWrapper.xml b/doc/classes/JavaClassWrapper.xml
index 01c3392b04..b43e149e9f 100644
--- a/doc/classes/JavaClassWrapper.xml
+++ b/doc/classes/JavaClassWrapper.xml
@@ -6,6 +6,15 @@
<description>
The JavaClassWrapper singleton provides a way for the Godot application to send and receive data through the [url=https://developer.android.com/training/articles/perf-jni]Java Native Interface[/url] (JNI).
[b]Note:[/b] This singleton is only available in Android builds.
+ [codeblock]
+ var LocalDateTime = JavaClassWrapper.wrap("java.time.LocalDateTime")
+ var DateTimeFormatter = JavaClassWrapper.wrap("java.time.format.DateTimeFormatter")
+
+ var datetime = LocalDateTime.now()
+ var formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss")
+
+ print(datetime.format(formatter))
+ [/codeblock]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/JavaObject.xml b/doc/classes/JavaObject.xml
new file mode 100644
index 0000000000..f38070e7d9
--- /dev/null
+++ b/doc/classes/JavaObject.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="JavaObject" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+ <brief_description>
+ Represents an object from the Java Native Interface.
+ </brief_description>
+ <description>
+ Represents an object from the Java Native Interface. It can be returned from Java methods called on [JavaClass] or other [JavaObject]s. See [JavaClassWrapper] for an example.
+ [b]Note:[/b] This class only works on Android. On any other platform, this class does nothing.
+ [b]Note:[/b] This class is not to be confused with [JavaScriptObject].
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="get_java_class" qualifiers="const">
+ <return type="JavaClass" />
+ <description>
+ Returns the [JavaClass] that this object is an instance of.
+ </description>
+ </method>
+ </methods>
+</class>
diff --git a/doc/classes/JavaScriptBridge.xml b/doc/classes/JavaScriptBridge.xml
index faf5424c47..ea3ede8857 100644
--- a/doc/classes/JavaScriptBridge.xml
+++ b/doc/classes/JavaScriptBridge.xml
@@ -60,6 +60,20 @@
Returns an interface to a JavaScript object that can be used by scripts. The [param interface] must be a valid property of the JavaScript [code]window[/code]. The callback must accept a single [Array] argument, which will contain the JavaScript [code]arguments[/code]. See [JavaScriptObject] for usage.
</description>
</method>
+ <method name="is_js_buffer">
+ <return type="bool" />
+ <param index="0" name="javascript_object" type="JavaScriptObject" />
+ <description>
+ Returns [code]true[/code] if the given [param javascript_object] is of type [url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer][code]ArrayBuffer[/code][/url], [url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView][code]DataView[/code][/url], or one of the many [url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray]typed array objects[/url].
+ </description>
+ </method>
+ <method name="js_buffer_to_packed_byte_array">
+ <return type="PackedByteArray" />
+ <param index="0" name="javascript_buffer" type="JavaScriptObject" />
+ <description>
+ Returns a copy of [param javascript_buffer]'s contents as a [PackedByteArray]. See also [method is_js_buffer].
+ </description>
+ </method>
<method name="pwa_needs_update" qualifiers="const">
<return type="bool" />
<description>
diff --git a/doc/classes/JavaScriptObject.xml b/doc/classes/JavaScriptObject.xml
index 73a06c4719..914fd997f4 100644
--- a/doc/classes/JavaScriptObject.xml
+++ b/doc/classes/JavaScriptObject.xml
@@ -5,7 +5,6 @@
</brief_description>
<description>
JavaScriptObject is used to interact with JavaScript objects retrieved or created via [method JavaScriptBridge.get_interface], [method JavaScriptBridge.create_object], or [method JavaScriptBridge.create_callback].
- [b]Example:[/b]
[codeblock]
extends Node
diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml
index 8acd05cbd1..ae5a62753f 100644
--- a/doc/classes/Label.xml
+++ b/doc/classes/Label.xml
@@ -14,7 +14,7 @@
<return type="Rect2" />
<param index="0" name="pos" type="int" />
<description>
- Returns the bounding rectangle of the character at position [param pos]. If the character is a non-visual character or [param pos] is outside the valid range, an empty [Rect2] is returned. If the character is a part of a composite grapheme, the bounding rectangle of the whole grapheme is returned.
+ Returns the bounding rectangle of the character at position [param pos] in the label's local coordinate system. If the character is a non-visual character or [param pos] is outside the valid range, an empty [Rect2] is returned. If the character is a part of a composite grapheme, the bounding rectangle of the whole grapheme is returned.
</description>
</method>
<method name="get_line_count" qualifiers="const">
@@ -59,7 +59,7 @@
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
- Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
+ Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
</member>
<member name="label_settings" type="LabelSettings" setter="set_label_settings" getter="get_label_settings">
A [LabelSettings] resource that can be shared between multiple [Label] nodes. Takes priority over theme properties.
@@ -122,7 +122,7 @@
[Color] of the text's shadow effect.
</theme_item>
<theme_item name="line_spacing" data_type="constant" type="int" default="3">
- Vertical space between lines in multiline [Label].
+ Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
Text outline size.
diff --git a/doc/classes/Label3D.xml b/doc/classes/Label3D.xml
index 4c70897452..7584a1d526 100644
--- a/doc/classes/Label3D.xml
+++ b/doc/classes/Label3D.xml
@@ -73,13 +73,13 @@
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
- Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
+ Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</member>
<member name="line_spacing" type="float" setter="set_line_spacing" getter="get_line_spacing" default="0.0">
- Vertical space between lines in multiline [Label3D].
+ Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
</member>
<member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)" keywords="color, colour">
Text [Color] of the [Label3D].
diff --git a/doc/classes/LabelSettings.xml b/doc/classes/LabelSettings.xml
index 8cdb30c303..ff7b8e7b0e 100644
--- a/doc/classes/LabelSettings.xml
+++ b/doc/classes/LabelSettings.xml
@@ -19,7 +19,7 @@
Size of the text.
</member>
<member name="line_spacing" type="float" setter="set_line_spacing" getter="get_line_spacing" default="3.0">
- Vertical space between lines when the text is multiline.
+ Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
</member>
<member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color" default="Color(1, 1, 1, 1)">
The color of the outline.
diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml
index bda5fb69de..966d0fdcb4 100644
--- a/doc/classes/Light3D.xml
+++ b/doc/classes/Light3D.xml
@@ -115,6 +115,9 @@
<member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0">
Blurs the edges of the shadow. Can be used to hide pixel artifacts in low-resolution shadow maps. A high value can impact performance, make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible.
</member>
+ <member name="shadow_caster_mask" type="int" setter="set_shadow_caster_mask" getter="get_shadow_caster_mask" default="4294967295">
+ The light will only cast shadows using objects in the selected layers.
+ </member>
<member name="shadow_enabled" type="bool" setter="set_shadow" getter="has_shadow" default="false">
If [code]true[/code], the light will cast real-time shadows. This has a significant performance cost. Only enable shadow rendering when it makes a noticeable difference in the scene's appearance, and consider using [member distance_fade_enabled] to hide the light when far away from the [Camera3D].
</member>
diff --git a/doc/classes/LightmapGI.xml b/doc/classes/LightmapGI.xml
index 6fb15e4d21..139bf6e4d1 100644
--- a/doc/classes/LightmapGI.xml
+++ b/doc/classes/LightmapGI.xml
@@ -66,7 +66,7 @@
</member>
<member name="quality" type="int" setter="set_bake_quality" getter="get_bake_quality" enum="LightmapGI.BakeQuality" default="1">
The quality preset to use when baking lightmaps. This affects bake times, but output file sizes remain mostly identical across quality levels.
- To further speed up bake times, decrease [member bounces], disable [member use_denoiser] and increase the lightmap texel size on 3D scenes in the Import doc.
+ To further speed up bake times, decrease [member bounces], disable [member use_denoiser] and increase the lightmap texel size on 3D scenes in the Import dock.
</member>
<member name="texel_scale" type="float" setter="set_texel_scale" getter="get_texel_scale" default="1.0">
Scales the lightmap texel density of all meshes for the current bake. This is a multiplier that builds upon the existing lightmap texel size defined in each imported 3D scene, along with the per-mesh density multiplier (which is designed to be used when the same mesh is used at different scales). Lower values will result in faster bake times.
@@ -137,6 +137,12 @@
<constant name="BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL" value="9" enum="BakeError">
Lightmap baking failed as the maximum texture size is too small to fit some of the meshes marked for baking.
</constant>
+ <constant name="BAKE_ERROR_LIGHTMAP_TOO_SMALL" value="10" enum="BakeError">
+ Lightmap baking failed as the lightmap is too small.
+ </constant>
+ <constant name="BAKE_ERROR_ATLAS_TOO_SMALL" value="11" enum="BakeError">
+ Lightmap baking failed as the lightmap was unable to fit into an atlas.
+ </constant>
<constant name="ENVIRONMENT_MODE_DISABLED" value="0" enum="EnvironmentMode">
Ignore environment lighting when baking lightmaps.
</constant>
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index 77fff22157..91c9072f73 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -4,7 +4,14 @@
An input field for single-line text.
</brief_description>
<description>
- [LineEdit] provides an input field for editing a single line of text. It features many built-in shortcuts that are always available ([kbd]Ctrl[/kbd] here maps to [kbd]Cmd[/kbd] on macOS):
+ [LineEdit] provides an input field for editing a single line of text.
+ - When the [LineEdit] control is focused using the keyboard arrow keys, it will only gain focus and not enter edit mode.
+ - To enter edit mode, click on the control with the mouse or press the [code]ui_text_submit[/code] action (by default [kbd]Enter[/kbd] or [kbd]Kp Enter[/kbd]).
+ - To exit edit mode, press [code]ui_text_submit[/code] or [code]ui_cancel[/code] (by default [kbd]Escape[/kbd]) actions.
+ - Check [method edit], [method unedit], [method is_editing], and [signal editing_toggled] for more information.
+ [b]Important:[/b]
+ - Focusing the [LineEdit] with [code]ui_focus_next[/code] (by default [kbd]Tab[/kbd]) or [code]ui_focus_prev[/code] (by default [kbd]Shift + Tab[/kbd]) or [method Control.grab_focus] still enters edit mode (for compatibility).
+ [LineEdit] features many built-in shortcuts that are always available ([kbd]Ctrl[/kbd] here maps to [kbd]Cmd[/kbd] on macOS):
- [kbd]Ctrl + C[/kbd]: Copy
- [kbd]Ctrl + X[/kbd]: Cut
- [kbd]Ctrl + V[/kbd] or [kbd]Ctrl + Y[/kbd]: Paste/"yank"
@@ -26,10 +33,23 @@
- [kbd]Cmd + E[/kbd]: Same as [kbd]End[/kbd], move the caret to the end of the line
- [kbd]Cmd + Left Arrow[/kbd]: Same as [kbd]Home[/kbd], move the caret to the beginning of the line
- [kbd]Cmd + Right Arrow[/kbd]: Same as [kbd]End[/kbd], move the caret to the end of the line
+ [b]Note:[/b] Caret movement shortcuts listed above are not affected by [member shortcut_keys_enabled].
</description>
<tutorials>
</tutorials>
<methods>
+ <method name="apply_ime">
+ <return type="void" />
+ <description>
+ Applies text from the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) and closes the IME if it is open.
+ </description>
+ </method>
+ <method name="cancel_ime">
+ <return type="void" />
+ <description>
+ Closes the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) if it is open. Any text in the IME will be lost.
+ </description>
+ </method>
<method name="clear">
<return type="void" />
<description>
@@ -56,6 +76,13 @@
Clears the current selection.
</description>
</method>
+ <method name="edit">
+ <return type="void" />
+ <description>
+ Allows entering edit mode whether the [LineEdit] is focused or not.
+ Use [method Callable.call_deferred] if you want to enter edit mode on [signal text_submitted].
+ </description>
+ </method>
<method name="get_menu" qualifiers="const">
<return type="PopupMenu" />
<description>
@@ -126,12 +153,30 @@
Returns the selection end column.
</description>
</method>
+ <method name="has_ime_text" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the user has text in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME).
+ </description>
+ </method>
+ <method name="has_redo" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if a "redo" action is available.
+ </description>
+ </method>
<method name="has_selection" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the user has selected text.
</description>
</method>
+ <method name="has_undo" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if an "undo" action is available.
+ </description>
+ </method>
<method name="insert_text_at_caret">
<return type="void" />
<param index="0" name="text" type="String" />
@@ -139,6 +184,12 @@
Inserts [param text] at the caret. If the resulting value is longer than [member max_length], nothing happens.
</description>
</method>
+ <method name="is_editing" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns whether the [LineEdit] is being edited.
+ </description>
+ </method>
<method name="is_menu_visible" qualifiers="const">
<return type="bool" />
<description>
@@ -180,6 +231,12 @@
Selects the whole [String].
</description>
</method>
+ <method name="unedit">
+ <return type="void" />
+ <description>
+ Allows exiting edit mode while preserving focus.
+ </description>
+ </method>
</methods>
<members>
<member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0">
@@ -231,8 +288,8 @@
</member>
<member name="max_length" type="int" setter="set_max_length" getter="get_max_length" default="0">
Maximum number of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit.
- When a limit is defined, characters that would exceed [member max_length] are truncated. This happens both for existing [member text] contents when setting the max length, or for new text inserted in the [LineEdit], including pasting. If any input text is truncated, the [signal text_change_rejected] signal is emitted with the truncated substring as parameter.
- [b]Example:[/b]
+ When a limit is defined, characters that would exceed [member max_length] are truncated. This happens both for existing [member text] contents when setting the max length, or for new text inserted in the [LineEdit], including pasting.
+ If any input text is truncated, the [signal text_change_rejected] signal is emitted with the truncated substring as parameter:
[codeblocks]
[gdscript]
text = "Hello world"
@@ -278,7 +335,7 @@
If [code]false[/code], it's impossible to select the text using mouse nor keyboard.
</member>
<member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true">
- If [code]false[/code], using shortcuts will be disabled.
+ If [code]true[/code], shortcut keys for context menu items are enabled, even if the context menu is disabled.
</member>
<member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="TextServer.StructuredTextParser" default="0">
Set BiDi algorithm override for the structured text.
@@ -301,6 +358,12 @@
</member>
</members>
<signals>
+ <signal name="editing_toggled">
+ <param index="0" name="toggled_on" type="bool" />
+ <description>
+ Emitted when the [LineEdit] switches in or out of edit mode.
+ </description>
+ </signal>
<signal name="text_change_rejected">
<param index="0" name="rejected_substring" type="String" />
<description>
@@ -316,7 +379,7 @@
<signal name="text_submitted">
<param index="0" name="new_text" type="String" />
<description>
- Emitted when the user presses [constant KEY_ENTER] on the [LineEdit].
+ Emitted when the user presses the [code]ui_text_submit[/code] action (by default: [kbd]Enter[/kbd] or [kbd]Kp Enter[/kbd]) while the [LineEdit] has focus.
</description>
</signal>
</signals>
diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml
index bcdffcd1ee..b1b3d74711 100644
--- a/doc/classes/LinkButton.xml
+++ b/doc/classes/LinkButton.xml
@@ -32,7 +32,6 @@
</member>
<member name="uri" type="String" setter="set_uri" getter="get_uri" default="&quot;&quot;">
The [url=https://en.wikipedia.org/wiki/Uniform_Resource_Identifier]URI[/url] for this [LinkButton]. If set to a valid URI, pressing the button opens the URI using the operating system's default program for the protocol (via [method OS.shell_open]). HTTP and HTTPS URLs open the default web browser.
- [b]Examples:[/b]
[codeblocks]
[gdscript]
uri = "https://godotengine.org" # Opens the URL in the default web browser.
diff --git a/doc/classes/LookAtModifier3D.xml b/doc/classes/LookAtModifier3D.xml
new file mode 100644
index 0000000000..e85da06c3a
--- /dev/null
+++ b/doc/classes/LookAtModifier3D.xml
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="LookAtModifier3D" inherits="SkeletonModifier3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+ <brief_description>
+ The [SkeletonModifier3D] rotates a bone to look a target.
+ </brief_description>
+ <description>
+ This [SkeletonModifier3D] rotates a bone to look a target. This is helpful for moving character's head to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily.
+ When applying multiple [LookAtModifier3D]s, the [LookAtModifier3D] assigned to the parent bone must be put above the [LookAtModifier3D] assigned to the child bone in the list in order for the child bone results to be correct.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="get_interpolation_remaining" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the remaining seconds of the time-based interpolation.
+ </description>
+ </method>
+ <method name="is_interpolating" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns whether the time-based interpolation is running or not. If [code]true[/code], it is equivalent to [method get_interpolation_remaining] being [code]0[/code].
+ This is useful to determine whether a [LookAtModifier3D] can be removed safely.
+ </description>
+ </method>
+ <method name="is_target_within_limitation" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns whether the target is within the angle limitations. It is useful for unsetting the [member target_node] when the target is outside of the angle limitations.
+ [b]Note:[/b] The value is updated after [method SkeletonModifier3D._process_modification]. To retrieve this value correctly, we recommend using the signal [signal SkeletonModifier3D.modification_processed].
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="bone" type="int" setter="set_bone" getter="get_bone" default="0">
+ The bone index of the [Skeleton3D] that the modification will operate on.
+ </member>
+ <member name="duration" type="float" setter="set_duration" getter="get_duration" default="0.0">
+ The duration of the time-based interpolation. Interpolation is triggered at the following cases:
+ - When the target node is changed
+ - When an axis is flipped due to angle limitation
+ [b]Note:[/b] The flipping occurs when the target is outside the angle limitation and the internally computed secondary rotation axis of the forward vector is flipped. Visually, it occurs when the target is outside the angle limitation and crosses the plane of the [member forward_axis] and [member primary_rotation_axis].
+ </member>
+ <member name="ease_type" type="int" setter="set_ease_type" getter="get_ease_type" enum="Tween.EaseType" default="0">
+ The ease type of the time-based interpolation. See also [enum Tween.EaseType].
+ </member>
+ <member name="forward_axis" type="int" setter="set_forward_axis" getter="get_forward_axis" enum="LookAtModifier3D.BoneAxis" default="4">
+ The forward axis of the bone. This [SkeletonModifier3D] modifies the bone so that this axis points toward the [member target_node].
+ </member>
+ <member name="origin_bone" type="int" setter="set_origin_bone" getter="get_origin_bone">
+ If [member origin_from] is [constant ORIGIN_FROM_SPECIFIC_BONE], the bone global pose position specified for this is used as origin.
+ </member>
+ <member name="origin_external_node" type="NodePath" setter="set_origin_external_node" getter="get_origin_external_node">
+ If [member origin_from] is [constant ORIGIN_FROM_EXTERNAL_NODE], the global position of the [Node3D] specified for this is used as origin.
+ </member>
+ <member name="origin_from" type="int" setter="set_origin_from" getter="get_origin_from" enum="LookAtModifier3D.OriginFrom" default="0">
+ This value determines from what origin is retrieved for use in the calculation of the forward vector.
+ </member>
+ <member name="origin_offset" type="Vector3" setter="set_origin_offset" getter="get_origin_offset" default="Vector3(0, 0, 0)">
+ The offset of the bone pose origin. Matching the origins by offset is useful for cases where multiple bones must always face the same direction, such as the eyes.
+ [b]Note:[/b] This value indicates the local position of the object set in [member origin_from].
+ </member>
+ <member name="origin_safe_margin" type="float" setter="set_origin_safe_margin" getter="get_origin_safe_margin" default="0.1">
+ If the target passes through too close to the origin than this value, time-based interpolation is used even if the target is within the angular limitations, to prevent the angular velocity from becoming too high.
+ </member>
+ <member name="primary_damp_threshold" type="float" setter="set_primary_damp_threshold" getter="get_primary_damp_threshold">
+ The threshold to start damping for [member primary_limit_angle]. It provides non-linear (b-spline) interpolation, let it feel more resistance the more it rotate to the edge limit. This is useful for simulating the limits of human motion.
+ If [code]1.0[/code], no damping is performed. If [code]0.0[/code], damping is always performed.
+ </member>
+ <member name="primary_limit_angle" type="float" setter="set_primary_limit_angle" getter="get_primary_limit_angle">
+ The limit angle of the primary rotation when [member symmetry_limitation] is [code]true[/code].
+ </member>
+ <member name="primary_negative_damp_threshold" type="float" setter="set_primary_negative_damp_threshold" getter="get_primary_negative_damp_threshold">
+ The threshold to start damping for [member primary_negative_limit_angle].
+ </member>
+ <member name="primary_negative_limit_angle" type="float" setter="set_primary_negative_limit_angle" getter="get_primary_negative_limit_angle">
+ The limit angle of negative side of the primary rotation when [member symmetry_limitation] is [code]false[/code].
+ </member>
+ <member name="primary_positive_damp_threshold" type="float" setter="set_primary_positive_damp_threshold" getter="get_primary_positive_damp_threshold">
+ The threshold to start damping for [member primary_positive_limit_angle].
+ </member>
+ <member name="primary_positive_limit_angle" type="float" setter="set_primary_positive_limit_angle" getter="get_primary_positive_limit_angle">
+ The limit angle of positive side of the primary rotation when [member symmetry_limitation] is [code]false[/code].
+ </member>
+ <member name="primary_rotation_axis" type="int" setter="set_primary_rotation_axis" getter="get_primary_rotation_axis" enum="Vector3.Axis" default="1">
+ The axis of the first rotation. This [SkeletonModifier3D] works by compositing the rotation by Euler angles to prevent to rotate the [member forward_axis].
+ </member>
+ <member name="secondary_damp_threshold" type="float" setter="set_secondary_damp_threshold" getter="get_secondary_damp_threshold">
+ The threshold to start damping for [member secondary_limit_angle].
+ </member>
+ <member name="secondary_limit_angle" type="float" setter="set_secondary_limit_angle" getter="get_secondary_limit_angle">
+ The limit angle of the secondary rotation when [member symmetry_limitation] is [code]true[/code].
+ </member>
+ <member name="secondary_negative_damp_threshold" type="float" setter="set_secondary_negative_damp_threshold" getter="get_secondary_negative_damp_threshold">
+ The threshold to start damping for [member secondary_negative_limit_angle].
+ </member>
+ <member name="secondary_negative_limit_angle" type="float" setter="set_secondary_negative_limit_angle" getter="get_secondary_negative_limit_angle">
+ The limit angle of negative side of the secondary rotation when [member symmetry_limitation] is [code]false[/code].
+ </member>
+ <member name="secondary_positive_damp_threshold" type="float" setter="set_secondary_positive_damp_threshold" getter="get_secondary_positive_damp_threshold">
+ The threshold to start damping for [member secondary_positive_limit_angle].
+ </member>
+ <member name="secondary_positive_limit_angle" type="float" setter="set_secondary_positive_limit_angle" getter="get_secondary_positive_limit_angle">
+ The limit angle of positive side of the secondary rotation when [member symmetry_limitation] is [code]false[/code].
+ </member>
+ <member name="symmetry_limitation" type="bool" setter="set_symmetry_limitation" getter="is_limitation_symmetry">
+ If [code]true[/code], the limitations are spread from the bone symmetrically.
+ If [code]false[/code], the limitation can be specified separately for each side of the bone rest.
+ </member>
+ <member name="target_node" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath(&quot;&quot;)">
+ The [NodePath] to the node that is the target for the look at modification. This node is what the modification will rotate the bone to.
+ </member>
+ <member name="transition_type" type="int" setter="set_transition_type" getter="get_transition_type" enum="Tween.TransitionType" default="0">
+ The transition type of the time-based interpolation. See also [enum Tween.TransitionType].
+ </member>
+ <member name="use_angle_limitation" type="bool" setter="set_use_angle_limitation" getter="is_using_angle_limitation" default="false">
+ If [code]true[/code], limits the degree of rotation. This helps prevent the character's neck from rotating 360 degrees.
+ [b]Note:[/b] As with [AnimationTree] blending, interpolation is provided that favors [method Skeleton3D.get_bone_rest]. This means that interpolation does not select the shortest path in some cases.
+ [b]Note:[/b] Some [member transition_type] may exceed the limitations (e.g. `Back`, `Elastic`, and `Spring`). If interpolation occurs while overshooting the limitations, the result might possibly not respect the bone rest.
+ </member>
+ <member name="use_secondary_rotation" type="bool" setter="set_use_secondary_rotation" getter="is_using_secondary_rotation" default="true">
+ If [code]true[/code], provides rotation by two axes.
+ </member>
+ </members>
+ <constants>
+ <constant name="BONE_AXIS_PLUS_X" value="0" enum="BoneAxis">
+ Enumerated value for the +X axis.
+ </constant>
+ <constant name="BONE_AXIS_MINUS_X" value="1" enum="BoneAxis">
+ Enumerated value for the -X axis.
+ </constant>
+ <constant name="BONE_AXIS_PLUS_Y" value="2" enum="BoneAxis">
+ Enumerated value for the +Y axis.
+ </constant>
+ <constant name="BONE_AXIS_MINUS_Y" value="3" enum="BoneAxis">
+ Enumerated value for the -Y axis.
+ </constant>
+ <constant name="BONE_AXIS_PLUS_Z" value="4" enum="BoneAxis">
+ Enumerated value for the +Z axis.
+ </constant>
+ <constant name="BONE_AXIS_MINUS_Z" value="5" enum="BoneAxis">
+ Enumerated value for the -Z axis.
+ </constant>
+ <constant name="ORIGIN_FROM_SELF" value="0" enum="OriginFrom">
+ The bone rest position of the bone specified in [member bone] is used as origin.
+ </constant>
+ <constant name="ORIGIN_FROM_SPECIFIC_BONE" value="1" enum="OriginFrom">
+ The bone global pose position of the bone specified in [member origin_bone] is used as origin.
+ [b]Note:[/b] It is recommended that you select only the parent bone unless you are familiar with the bone processing process. The specified bone pose at the time the [LookAtModifier3D] is processed is used as a reference. In other words, if you specify a child bone and the [LookAtModifier3D] causes the child bone to move, the rendered result and direction will not match.
+ </constant>
+ <constant name="ORIGIN_FROM_EXTERNAL_NODE" value="2" enum="OriginFrom">
+ The global position of the [Node3D] specified in [member origin_external_node] is used as origin.
+ [b]Note:[/b] Same as [constant ORIGIN_FROM_SPECIFIC_BONE], when specifying a [BoneAttachment3D] with a child bone assigned, the rendered result and direction will not match.
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml
index 760773d5d9..94d12018ca 100644
--- a/doc/classes/Material.xml
+++ b/doc/classes/Material.xml
@@ -45,7 +45,7 @@
<method name="inspect_native_shader_code">
<return type="void" />
<description>
- Only available when running in the editor. Opens a popup that visualizes the generated shader code, including all variants and internal shader code.
+ Only available when running in the editor. Opens a popup that visualizes the generated shader code, including all variants and internal shader code. See also [method Shader.inspect_native_shader_code].
</description>
</method>
</methods>
diff --git a/doc/classes/MenuBar.xml b/doc/classes/MenuBar.xml
index 9e4287331c..bcf63f0610 100644
--- a/doc/classes/MenuBar.xml
+++ b/doc/classes/MenuBar.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MenuBar" inherits="Control" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- A horizontal menu bar that creates a [MenuButton] for each [PopupMenu] child.
+ A horizontal menu bar that creates a menu for each [PopupMenu] child.
</brief_description>
<description>
- A horizontal menu bar that creates a [MenuButton] for each [PopupMenu] child. New items are created by adding [PopupMenu]s to this node.
+ A horizontal menu bar that creates a menu for each [PopupMenu] child. New items are created by adding [PopupMenu]s to this node.
</description>
<tutorials>
</tutorials>
@@ -105,9 +105,11 @@
</member>
<member name="prefer_global_menu" type="bool" setter="set_prefer_global_menu" getter="is_prefer_global_menu" default="true">
If [code]true[/code], [MenuBar] will use system global menu when supported.
+ [b]Note:[/b] If [code]true[/code] and global menu is supported, this node is not displayed, has zero size, and all its child nodes except [PopupMenu]s are inaccessible.
+ [b]Note:[/b] This property overrides the value of the [member PopupMenu.prefer_native_menu] property of the child nodes.
</member>
<member name="start_index" type="int" setter="set_start_index" getter="get_start_index" default="-1">
- Position in the global menu to insert first [MenuBar] item at.
+ Position order in the global menu to insert [MenuBar] items at. All menu items in the [MenuBar] are always inserted as a continuous range. Menus with lower [member start_index] are inserted first. Menus with [member start_index] equal to [code]-1[/code] are inserted last.
</member>
<member name="switch_on_hover" type="bool" setter="set_switch_on_hover" getter="is_switch_on_hover" default="true">
If [code]true[/code], when the cursor hovers above menu item, it will close the current [PopupMenu] and open the other one.
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index 6b5a50d97b..7f4dd5af37 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -223,6 +223,7 @@
</constant>
<constant name="ARRAY_NORMAL" value="1" enum="ArrayType">
[PackedVector3Array] of vertex normals.
+ [b]Note:[/b] The array has to consist of normal vectors, otherwise they will be normalized by the engine, potentially causing visual discrepancies.
</constant>
<constant name="ARRAY_TANGENT" value="2" enum="ArrayType">
[PackedFloat32Array] of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
diff --git a/doc/classes/MeshDataTool.xml b/doc/classes/MeshDataTool.xml
index 0b9890b2ec..f339a26e93 100644
--- a/doc/classes/MeshDataTool.xml
+++ b/doc/classes/MeshDataTool.xml
@@ -139,8 +139,7 @@
<param index="1" name="vertex" type="int" />
<description>
Returns the specified vertex index of the given face.
- Vertex argument must be either 0, 1, or 2 because faces contain three vertices.
- [b]Example:[/b]
+ [param vertex] must be either [code]0[/code], [code]1[/code], or [code]2[/code] because faces contain three vertices.
[codeblocks]
[gdscript]
var index = mesh_data_tool.get_face_vertex(0, 1) # Gets the index of the second vertex of the first face.
diff --git a/doc/classes/MeshInstance3D.xml b/doc/classes/MeshInstance3D.xml
index abbb4c4eeb..a0a773b90a 100644
--- a/doc/classes/MeshInstance3D.xml
+++ b/doc/classes/MeshInstance3D.xml
@@ -21,6 +21,14 @@
[b]Performance:[/b] [Mesh] data needs to be received from the GPU, stalling the [RenderingServer] in the process.
</description>
</method>
+ <method name="bake_mesh_from_current_skeleton_pose">
+ <return type="ArrayMesh" />
+ <param index="0" name="existing" type="ArrayMesh" default="null" />
+ <description>
+ Takes a snapshot of the current animated skeleton pose of the skinned mesh and bakes it to the provided [param existing] mesh. If no [param existing] mesh is provided a new [ArrayMesh] is created, baked, and returned. Requires a skeleton with a registered skin to work. Blendshapes are ignored. Mesh surface materials are not copied.
+ [b]Performance:[/b] [Mesh] data needs to be retrieved from the GPU, stalling the [RenderingServer] in the process.
+ </description>
+ </method>
<method name="create_convex_collision">
<return type="void" />
<param index="0" name="clean" type="bool" default="true" />
@@ -112,7 +120,7 @@
<param index="1" name="material" type="Material" />
<description>
Sets the override [param material] for the specified [param surface] of the [Mesh] resource. This material is associated with this [MeshInstance3D] rather than with [member mesh].
- [b]Note:[/b] This assigns the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, not the material within the [Mesh] resource. To set the material within the [Mesh] resource, use [method Mesh.surface_get_material] instead.
+ [b]Note:[/b] This assigns the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, not the material within the [Mesh] resource. To set the material within the [Mesh] resource, use [method Mesh.surface_set_material] instead.
</description>
</method>
</methods>
diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml
index 406aacc75c..e99694c3f0 100644
--- a/doc/classes/MultiMesh.xml
+++ b/doc/classes/MultiMesh.xml
@@ -51,12 +51,31 @@
Returns the [Transform2D] of a specific instance.
</description>
</method>
+ <method name="reset_instance_physics_interpolation">
+ <return type="void" />
+ <param index="0" name="instance" type="int" />
+ <description>
+ When using [i]physics interpolation[/i], this function allows you to prevent interpolation on an instance in the current physics tick.
+ This allows you to move instances instantaneously, and should usually be used when initially placing an instance such as a bullet to prevent graphical glitches.
+ </description>
+ </method>
+ <method name="set_buffer_interpolated">
+ <return type="void" />
+ <param index="0" name="buffer_curr" type="PackedFloat32Array" />
+ <param index="1" name="buffer_prev" type="PackedFloat32Array" />
+ <description>
+ An alternative to setting the [member buffer] property, which can be used with [i]physics interpolation[/i]. This method takes two arrays, and can set the data for the current and previous tick in one go. The renderer will automatically interpolate the data at each frame.
+ This is useful for situations where the order of instances may change from physics tick to tick, such as particle systems.
+ When the order of instances is coherent, the simpler alternative of setting [member buffer] can still be used with interpolation.
+ </description>
+ </method>
<method name="set_instance_color">
<return type="void" />
<param index="0" name="instance" type="int" />
<param index="1" name="color" type="Color" />
<description>
Sets the color of a specific instance by [i]multiplying[/i] the mesh's existing vertex colors. This allows for different color tinting per instance.
+ [b]Note:[/b] Each component is stored in 32 bits in the Forward+ and Mobile rendering methods, but is packed into 16 bits in the Compatibility rendering method.
For the color to take effect, ensure that [member use_colors] is [code]true[/code] on the [MultiMesh] and [member BaseMaterial3D.vertex_color_use_as_albedo] is [code]true[/code] on the material. If you intend to set an absolute color instead of tinting, make sure the material's albedo color is set to pure white ([code]Color(1, 1, 1)[/code]).
</description>
</method>
@@ -66,6 +85,7 @@
<param index="1" name="custom_data" type="Color" />
<description>
Sets custom data for a specific instance. [param custom_data] is a [Color] type only to contain 4 floating-point numbers.
+ [b]Note:[/b] Each number is stored in 32 bits in the Forward+ and Mobile rendering methods, but is packed into 16 bits in the Compatibility rendering method.
For the custom data to be used, ensure that [member use_custom_data] is [code]true[/code].
This custom instance data has to be manually accessed in your custom shader using [code]INSTANCE_CUSTOM[/code].
</description>
@@ -107,6 +127,11 @@
[Mesh] resource to be instanced.
The looks of the individual instances can be modified using [method set_instance_color] and [method set_instance_custom_data].
</member>
+ <member name="physics_interpolation_quality" type="int" setter="set_physics_interpolation_quality" getter="get_physics_interpolation_quality" enum="MultiMesh.PhysicsInterpolationQuality" default="0">
+ Choose whether to use an interpolation method that favors speed or quality.
+ When using low physics tick rates (typically below 20) or high rates of object rotation, you may get better results from the high quality setting.
+ [b]Note:[/b] Fast quality does not equate to low quality. Except in the special cases mentioned above, the quality should be comparable to high quality.
+ </member>
<member name="transform_2d_array" type="PackedVector2Array" setter="_set_transform_2d_array" getter="_get_transform_2d_array" deprecated="Accessing this property is very slow. Use [method set_instance_transform_2d] and [method get_instance_transform_2d] instead.">
Array containing each [Transform2D] value used by all instances of this mesh, as a [PackedVector2Array]. Each transform is divided into 3 [Vector2] values corresponding to the transforms' [code]x[/code], [code]y[/code], and [code]origin[/code].
</member>
@@ -133,5 +158,11 @@
<constant name="TRANSFORM_3D" value="1" enum="TransformFormat">
Use this when using 3D transforms.
</constant>
+ <constant name="INTERP_QUALITY_FAST" value="0" enum="PhysicsInterpolationQuality">
+ Always interpolate using Basis lerping, which can produce warping artifacts in some situations.
+ </constant>
+ <constant name="INTERP_QUALITY_HIGH" value="1" enum="PhysicsInterpolationQuality">
+ Attempt to interpolate using Basis slerping (spherical linear interpolation) where possible, otherwise fall back to lerping.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index d5016867a7..75cb13d25d 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -88,7 +88,7 @@
<param index="3" name="arguments" type="Array" default="[]" />
<description>
Sends an RPC to the target [param peer]. The given [param method] will be called on the remote [param object] with the provided [param arguments]. The RPC may also be called locally depending on the implementation and RPC configuration. See [method Node.rpc] and [method Node.rpc_config].
- [b]Note:[/b] Prefer using [method Node.rpc], [method Node.rpc_id], or [code]my_method.rpc(peer, arg1, arg2, ...)[/code] (in GDScript), since they are faster. This method is mostly useful in conjunction with [MultiplayerAPIExtension] when augmenting or replacing the multiplayer capabilities.
+ [b]Note:[/b] Prefer using [method Node.rpc], [method Node.rpc_id], or [code]my_method.rpc(peer, arg1, arg2, ...)[/code] (in GDScript), since they are faster. This method is mostly useful in conjunction with [MultiplayerAPIExtension] when extending or replacing the multiplayer capabilities.
</description>
</method>
<method name="set_default_interface" qualifiers="static">
diff --git a/doc/classes/MultiplayerAPIExtension.xml b/doc/classes/MultiplayerAPIExtension.xml
index cc6d3b7fcf..acb6a2c176 100644
--- a/doc/classes/MultiplayerAPIExtension.xml
+++ b/doc/classes/MultiplayerAPIExtension.xml
@@ -4,14 +4,14 @@
Base class used for extending the [MultiplayerAPI].
</brief_description>
<description>
- This class can be used to augment or replace the default [MultiplayerAPI] implementation via script or extensions.
- The following example augment the default implementation ([SceneMultiplayer]) by logging every RPC being made, and every object being configured for replication.
+ This class can be used to extend or replace the default [MultiplayerAPI] implementation via script or extensions.
+ The following example extend the default implementation ([SceneMultiplayer]) by logging every RPC being made, and every object being configured for replication.
[codeblocks]
[gdscript]
extends MultiplayerAPIExtension
class_name LogMultiplayer
- # We want to augment the default SceneMultiplayer.
+ # We want to extend the default SceneMultiplayer.
var base_multiplayer = SceneMultiplayer.new()
func _init():
@@ -49,7 +49,7 @@
print("Removing node %s from the spawn list. Spawner: %s" % [object, config])
return base_multiplayer.object_configuration_remove(object, config)
- # These can be optional, but in our case we want to augment SceneMultiplayer, so forward everything.
+ # These can be optional, but in our case we want to extend SceneMultiplayer, so forward everything.
func _set_multiplayer_peer(p_peer: MultiplayerPeer):
base_multiplayer.multiplayer_peer = p_peer
@@ -69,7 +69,7 @@
# autoload.gd
func _enter_tree():
# Sets our custom multiplayer as the main one in SceneTree.
- get_tree().set_multiplayer(LogMultiplayer.new())
+ get_tree().set_multiplayer(LogMultiplayer.new())
[/gdscript]
[/codeblocks]
Native extensions can alternatively use the [method MultiplayerAPI.set_default_interface] method during initialization to configure themselves as the default implementation.
diff --git a/doc/classes/MultiplayerPeer.xml b/doc/classes/MultiplayerPeer.xml
index edb2c39e24..cec9464102 100644
--- a/doc/classes/MultiplayerPeer.xml
+++ b/doc/classes/MultiplayerPeer.xml
@@ -65,7 +65,7 @@
<method name="is_server_relay_supported" qualifiers="const">
<return type="bool" />
<description>
- Returns true if the server can act as a relay in the current configuration (i.e. if the higher level [MultiplayerAPI] should notify connected clients of other peers, and implement a relay protocol to allow communication between them).
+ Returns [code]true[/code] if the server can act as a relay in the current configuration. That is, if the higher level [MultiplayerAPI] should notify connected clients of other peers, and implement a relay protocol to allow communication between them.
</description>
</method>
<method name="poll">
diff --git a/doc/classes/NavigationLink2D.xml b/doc/classes/NavigationLink2D.xml
index 0892c9ec44..2e1c962dd1 100644
--- a/doc/classes/NavigationLink2D.xml
+++ b/doc/classes/NavigationLink2D.xml
@@ -29,6 +29,12 @@
Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32.
</description>
</method>
+ <method name="get_navigation_map" qualifiers="const">
+ <return type="RID" />
+ <description>
+ Returns the current navigation map [RID] used by this link.
+ </description>
+ </method>
<method name="get_rid" qualifiers="const">
<return type="RID" />
<description>
@@ -57,6 +63,13 @@
Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32.
</description>
</method>
+ <method name="set_navigation_map">
+ <return type="void" />
+ <param index="0" name="navigation_map" type="RID" />
+ <description>
+ Sets the [RID] of the navigation map this link should use. By default the link will automatically join the [World2D] default navigation map so this function is only required to override the default map.
+ </description>
+ </method>
</methods>
<members>
<member name="bidirectional" type="bool" setter="set_bidirectional" getter="is_bidirectional" default="true">
diff --git a/doc/classes/NavigationLink3D.xml b/doc/classes/NavigationLink3D.xml
index 0fcc106beb..174228ea5b 100644
--- a/doc/classes/NavigationLink3D.xml
+++ b/doc/classes/NavigationLink3D.xml
@@ -29,6 +29,12 @@
Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32.
</description>
</method>
+ <method name="get_navigation_map" qualifiers="const">
+ <return type="RID" />
+ <description>
+ Returns the current navigation map [RID] used by this link.
+ </description>
+ </method>
<method name="get_rid" qualifiers="const">
<return type="RID" />
<description>
@@ -57,6 +63,13 @@
Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32.
</description>
</method>
+ <method name="set_navigation_map">
+ <return type="void" />
+ <param index="0" name="navigation_map" type="RID" />
+ <description>
+ Sets the [RID] of the navigation map this link should use. By default the link will automatically join the [World3D] default navigation map so this function is only required to override the default map.
+ </description>
+ </method>
</methods>
<members>
<member name="bidirectional" type="bool" setter="set_bidirectional" getter="is_bidirectional" default="true">
diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml
index 8be8a89543..5898e6841a 100644
--- a/doc/classes/NavigationMesh.xml
+++ b/doc/classes/NavigationMesh.xml
@@ -139,7 +139,7 @@
The physics layers to scan for static colliders.
Only used when [member geometry_parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH].
</member>
- <member name="geometry_parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" enum="NavigationMesh.ParsedGeometryType" default="0">
+ <member name="geometry_parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" enum="NavigationMesh.ParsedGeometryType" default="2">
Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values.
</member>
<member name="geometry_source_geometry_mode" type="int" setter="set_source_geometry_mode" getter="get_source_geometry_mode" enum="NavigationMesh.SourceGeometryMode" default="0">
diff --git a/doc/classes/NavigationMeshSourceGeometryData2D.xml b/doc/classes/NavigationMeshSourceGeometryData2D.xml
index 1d8689420b..82b6e077fe 100644
--- a/doc/classes/NavigationMeshSourceGeometryData2D.xml
+++ b/doc/classes/NavigationMeshSourceGeometryData2D.xml
@@ -57,6 +57,12 @@
Clears all projected obstructions.
</description>
</method>
+ <method name="get_bounds">
+ <return type="Rect2" />
+ <description>
+ Returns an axis-aligned bounding box that covers all the stored geometry data. The bounds are calculated when calling this function with the result cached until further geometry changes are made.
+ </description>
+ </method>
<method name="get_obstruction_outlines" qualifiers="const">
<return type="PackedVector2Array[]" />
<description>
diff --git a/doc/classes/NavigationMeshSourceGeometryData3D.xml b/doc/classes/NavigationMeshSourceGeometryData3D.xml
index 0b3126a63b..aa43dff52d 100644
--- a/doc/classes/NavigationMeshSourceGeometryData3D.xml
+++ b/doc/classes/NavigationMeshSourceGeometryData3D.xml
@@ -63,6 +63,12 @@
Clears all projected obstructions.
</description>
</method>
+ <method name="get_bounds">
+ <return type="AABB" />
+ <description>
+ Returns an axis-aligned bounding box that covers all the stored geometry data. The bounds are calculated when calling this function with the result cached until further geometry changes are made.
+ </description>
+ </method>
<method name="get_indices" qualifiers="const">
<return type="PackedInt32Array" />
<description>
diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml
index eebdc817a7..68fbc05931 100644
--- a/doc/classes/NavigationPolygon.xml
+++ b/doc/classes/NavigationPolygon.xml
@@ -193,6 +193,9 @@
<member name="parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" enum="NavigationPolygon.ParsedGeometryType" default="2">
Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values.
</member>
+ <member name="sample_partition_type" type="int" setter="set_sample_partition_type" getter="get_sample_partition_type" enum="NavigationPolygon.SamplePartitionType" default="0">
+ Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] for possible values.
+ </member>
<member name="source_geometry_group_name" type="StringName" setter="set_source_geometry_group_name" getter="get_source_geometry_group_name" default="&amp;&quot;navigation_polygon_source_geometry_group&quot;">
The group name of nodes that should be parsed for baking source geometry.
Only used when [member source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT].
@@ -202,6 +205,15 @@
</member>
</members>
<constants>
+ <constant name="SAMPLE_PARTITION_CONVEX_PARTITION" value="0" enum="SamplePartitionType">
+ Convex partitioning that yields navigation mesh with convex polygons.
+ </constant>
+ <constant name="SAMPLE_PARTITION_TRIANGULATE" value="1" enum="SamplePartitionType">
+ Triangulation partitioning that yields navigation mesh with triangle polygons.
+ </constant>
+ <constant name="SAMPLE_PARTITION_MAX" value="2" enum="SamplePartitionType">
+ Represents the size of the [enum SamplePartitionType] enum.
+ </constant>
<constant name="PARSED_GEOMETRY_MESH_INSTANCES" value="0" enum="ParsedGeometryType">
Parses mesh instances as obstruction geometry. This includes [Polygon2D], [MeshInstance2D], [MultiMeshInstance2D], and [TileMap] nodes.
Meshes are only parsed when they use a 2D vertices surface format.
diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml
index a0d03d7a01..5c19a6b355 100644
--- a/doc/classes/NavigationServer2D.xml
+++ b/doc/classes/NavigationServer2D.xml
@@ -133,7 +133,7 @@
<return type="bool" />
<param index="0" name="agent" type="RID" />
<description>
- Returns true if the map got changed the previous frame.
+ Returns [code]true[/code] if the map got changed the previous frame.
</description>
</method>
<method name="agent_set_avoidance_callback">
@@ -215,7 +215,7 @@
<param index="0" name="agent" type="RID" />
<param index="1" name="paused" type="bool" />
<description>
- If [param paused] is true the specified [param agent] will not be processed, e.g. calculate avoidance velocities or receive avoidance callbacks.
+ If [param paused] is [code]true[/code] the specified [param agent] will not be processed, e.g. calculate avoidance velocities or receive avoidance callbacks.
</description>
</method>
<method name="agent_set_position">
@@ -486,7 +486,7 @@
<param index="0" name="map" type="RID" />
<param index="1" name="to_point" type="Vector2" />
<description>
- Returns the point closest to the provided [param to_point] on the navigation mesh surface.
+ Returns the navigation mesh surface point closest to the provided [param to_point] on the navigation [param map].
</description>
</method>
<method name="map_get_closest_point_owner" qualifiers="const">
@@ -494,7 +494,7 @@
<param index="0" name="map" type="RID" />
<param index="1" name="to_point" type="Vector2" />
<description>
- Returns the owner region RID for the point returned by [method map_get_closest_point].
+ Returns the owner region RID for the navigation mesh surface point closest to the provided [param to_point] on the navigation [param map].
</description>
</method>
<method name="map_get_edge_connection_margin" qualifiers="const">
@@ -573,7 +573,7 @@
<return type="bool" />
<param index="0" name="map" type="RID" />
<description>
- Returns true if the map is active.
+ Returns [code]true[/code] if the map is active.
</description>
</method>
<method name="map_set_active">
@@ -707,7 +707,7 @@
<param index="0" name="obstacle" type="RID" />
<param index="1" name="paused" type="bool" />
<description>
- If [param paused] is true the specified [param obstacle] will not be processed, e.g. affect avoidance velocities.
+ If [param paused] is [code]true[/code] the specified [param obstacle] will not be processed, e.g. affect avoidance velocities.
</description>
</method>
<method name="obstacle_set_position">
@@ -768,6 +768,14 @@
Creates a new region.
</description>
</method>
+ <method name="region_get_closest_point" qualifiers="const">
+ <return type="Vector2" />
+ <param index="0" name="region" type="RID" />
+ <param index="1" name="to_point" type="Vector2" />
+ <description>
+ Returns the navigation mesh surface point closest to the provided [param to_point] on the navigation [param region].
+ </description>
+ </method>
<method name="region_get_connection_pathway_end" qualifiers="const">
<return type="Vector2" />
<param index="0" name="region" type="RID" />
diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml
index ff3e6fd8a6..66a286758b 100644
--- a/doc/classes/NavigationServer3D.xml
+++ b/doc/classes/NavigationServer3D.xml
@@ -147,7 +147,7 @@
<return type="bool" />
<param index="0" name="agent" type="RID" />
<description>
- Returns true if the map got changed the previous frame.
+ Returns [code]true[/code] if the map got changed the previous frame.
</description>
</method>
<method name="agent_set_avoidance_callback">
@@ -237,7 +237,7 @@
<param index="0" name="agent" type="RID" />
<param index="1" name="paused" type="bool" />
<description>
- If [param paused] is true the specified [param agent] will not be processed, e.g. calculate avoidance velocities or receive avoidance callbacks.
+ If [param paused] is [code]true[/code] the specified [param agent] will not be processed, e.g. calculate avoidance velocities or receive avoidance callbacks.
</description>
</method>
<method name="agent_set_position">
@@ -532,7 +532,7 @@
<param index="0" name="map" type="RID" />
<param index="1" name="to_point" type="Vector3" />
<description>
- Returns the point closest to the provided [param to_point] on the navigation mesh surface.
+ Returns the navigation mesh surface point closest to the provided [param to_point] on the navigation [param map].
</description>
</method>
<method name="map_get_closest_point_normal" qualifiers="const">
@@ -540,7 +540,7 @@
<param index="0" name="map" type="RID" />
<param index="1" name="to_point" type="Vector3" />
<description>
- Returns the normal for the point returned by [method map_get_closest_point].
+ Returns the navigation mesh surface normal closest to the provided [param to_point] on the navigation [param map].
</description>
</method>
<method name="map_get_closest_point_owner" qualifiers="const">
@@ -548,7 +548,7 @@
<param index="0" name="map" type="RID" />
<param index="1" name="to_point" type="Vector3" />
<description>
- Returns the owner region RID for the point returned by [method map_get_closest_point].
+ Returns the owner region RID for the navigation mesh surface point closest to the provided [param to_point] on the navigation [param map].
</description>
</method>
<method name="map_get_closest_point_to_segment" qualifiers="const">
@@ -558,7 +558,8 @@
<param index="2" name="end" type="Vector3" />
<param index="3" name="use_collision" type="bool" default="false" />
<description>
- Returns the closest point between the navigation surface and the segment.
+ Returns the navigation mesh surface point closest to the provided [param start] and [param end] segment on the navigation [param map].
+ If [param use_collision] is [code]true[/code], a closest point test is only done when the segment intersects with the navigation mesh surface.
</description>
</method>
<method name="map_get_edge_connection_margin" qualifiers="const">
@@ -644,14 +645,14 @@
<return type="bool" />
<param index="0" name="map" type="RID" />
<description>
- Returns true if the navigation [param map] allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
+ Returns [code]true[/code] if the navigation [param map] allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
</description>
</method>
<method name="map_is_active" qualifiers="const">
<return type="bool" />
<param index="0" name="map" type="RID" />
<description>
- Returns true if the map is active.
+ Returns [code]true[/code] if the map is active.
</description>
</method>
<method name="map_set_active">
@@ -831,7 +832,7 @@
<param index="0" name="obstacle" type="RID" />
<param index="1" name="paused" type="bool" />
<description>
- If [param paused] is true the specified [param obstacle] will not be processed, e.g. affect avoidance velocities.
+ If [param paused] is [code]true[/code] the specified [param obstacle] will not be processed, e.g. affect avoidance velocities.
</description>
</method>
<method name="obstacle_set_position">
@@ -908,6 +909,33 @@
Creates a new region.
</description>
</method>
+ <method name="region_get_closest_point" qualifiers="const">
+ <return type="Vector3" />
+ <param index="0" name="region" type="RID" />
+ <param index="1" name="to_point" type="Vector3" />
+ <description>
+ Returns the navigation mesh surface point closest to the provided [param to_point] on the navigation [param region].
+ </description>
+ </method>
+ <method name="region_get_closest_point_normal" qualifiers="const">
+ <return type="Vector3" />
+ <param index="0" name="region" type="RID" />
+ <param index="1" name="to_point" type="Vector3" />
+ <description>
+ Returns the navigation mesh surface normal closest to the provided [param to_point] on the navigation [param region].
+ </description>
+ </method>
+ <method name="region_get_closest_point_to_segment" qualifiers="const">
+ <return type="Vector3" />
+ <param index="0" name="region" type="RID" />
+ <param index="1" name="start" type="Vector3" />
+ <param index="2" name="end" type="Vector3" />
+ <param index="3" name="use_collision" type="bool" default="false" />
+ <description>
+ Returns the navigation mesh surface point closest to the provided [param start] and [param end] segment on the navigation [param region].
+ If [param use_collision] is [code]true[/code], a closest point test is only done when the segment intersects with the navigation mesh surface.
+ </description>
+ </method>
<method name="region_get_connection_pathway_end" qualifiers="const">
<return type="Vector3" />
<param index="0" name="region" type="RID" />
@@ -995,7 +1023,7 @@
<return type="bool" />
<param index="0" name="region" type="RID" />
<description>
- Returns true if the navigation [param region] is set to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
+ Returns [code]true[/code] if the navigation [param region] is set to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
</description>
</method>
<method name="region_owns_point" qualifiers="const">
@@ -1167,5 +1195,8 @@
<constant name="INFO_EDGE_FREE_COUNT" value="8" enum="ProcessInfo">
Constant to get the number of navigation mesh polygon edges that could not be merged but may be still connected by edge proximity or with links.
</constant>
+ <constant name="INFO_OBSTACLE_COUNT" value="9" enum="ProcessInfo">
+ Constant to get the number of active navigation obstacles.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 2662b34aec..3cb76e2926 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -73,6 +73,7 @@
<description>
Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [param delta] variable should be constant. [param delta] is in seconds.
It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process].
+ Processing happens in order of [member process_physics_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).
Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification].
[b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
</description>
@@ -83,6 +84,7 @@
<description>
Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [param delta] time since the previous frame is not constant. [param delta] is in seconds.
It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process].
+ Processing happens in order of [member process_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).
Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification].
[b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
</description>
@@ -255,7 +257,7 @@
<return type="Node" />
<param index="0" name="flags" type="int" default="15" />
<description>
- Duplicates the node, returning a new node with all of its properties, signals and groups copied from the original. The behavior can be tweaked through the [param flags] (see [enum DuplicateFlags]).
+ Duplicates the node, returning a new node with all of its properties, signals, groups, and children copied from the original. The behavior can be tweaked through the [param flags] (see [enum DuplicateFlags]).
[b]Note:[/b] For nodes with a [Script] attached, if [method Object._init] has been defined with required parameters, the duplicated node will not have a [Script].
</description>
</method>
@@ -498,6 +500,12 @@
Returns the time elapsed (in seconds) since the last process callback. This value is identical to [method _process]'s [code]delta[/code] parameter, and may vary from frame to frame. See also [constant NOTIFICATION_PROCESS].
</description>
</method>
+ <method name="get_rpc_config" qualifiers="const">
+ <return type="Variant" />
+ <description>
+ Returns a [Dictionary] mapping method names to their RPC configuration defined for this node using [method rpc_config].
+ </description>
+ </method>
<method name="get_scene_instance_load_placeholder" qualifiers="const">
<return type="bool" />
<description>
@@ -967,6 +975,13 @@
Similar to [method call_thread_safe], but for setting properties.
</description>
</method>
+ <method name="set_translation_domain_inherited">
+ <return type="void" />
+ <description>
+ Makes this node inherit the translation domain from its parent node. If this node has no parent, the main translation domain will be used.
+ This is the default behavior for all nodes. Calling [method Object.set_translation_domain] disables this behavior.
+ </description>
+ </method>
<method name="update_configuration_warnings">
<return type="void" />
<description>
@@ -991,8 +1006,8 @@
[b]Note:[/b] When changing the name, the following characters will be replaced with an underscore: ([code].[/code] [code]:[/code] [code]@[/code] [code]/[/code] [code]"[/code] [code]%[/code]). In particular, the [code]@[/code] character is reserved for auto-generated names. See also [method String.validate_node_name].
</member>
<member name="owner" type="Node" setter="set_owner" getter="get_owner">
- The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a [PackedScene], all the nodes it owns are also saved with it.
- [b]Note:[/b] In the editor, nodes not owned by the scene root are usually not displayed in the Scene dock, and will [b]not[/b] be saved. To prevent this, remember to set the owner after calling [method add_child]. See also (see [member unique_name_in_owner])
+ The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a [PackedScene], all the nodes it owns are also saved with it. See also [member unique_name_in_owner].
+ [b]Note:[/b] In the editor, nodes not owned by the scene root are usually not displayed in the Scene dock, and will [b]not[/b] be saved. To prevent this, remember to set the owner after calling [method add_child].
</member>
<member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" enum="Node.PhysicsInterpolationMode" default="0">
Allows enabling or disabling physics interpolation per node, offering a finer grain of control than turning physics interpolation on and off globally. See [member ProjectSettings.physics/common/physics_interpolation] and [member SceneTree.physics_interpolation] for the global setting.
@@ -1002,10 +1017,10 @@
The node's processing behavior (see [enum ProcessMode]). To check if the node can process in its current mode, use [method can_process].
</member>
<member name="process_physics_priority" type="int" setter="set_physics_process_priority" getter="get_physics_process_priority" default="0">
- Similar to [member process_priority] but for [constant NOTIFICATION_PHYSICS_PROCESS], [method _physics_process] or the internal version.
+ Similar to [member process_priority] but for [constant NOTIFICATION_PHYSICS_PROCESS], [method _physics_process], or [constant NOTIFICATION_INTERNAL_PHYSICS_PROCESS].
</member>
<member name="process_priority" type="int" setter="set_process_priority" getter="get_process_priority" default="0">
- The node's execution order of the process callbacks ([method _process], [method _physics_process], and internal processing). Nodes whose priority value is [i]lower[/i] call their process callbacks first, regardless of tree order.
+ The node's execution order of the process callbacks ([method _process], [constant NOTIFICATION_PROCESS], and [constant NOTIFICATION_INTERNAL_PROCESS]). Nodes whose priority value is [i]lower[/i] call their process callbacks first, regardless of tree order.
</member>
<member name="process_thread_group" type="int" setter="set_process_thread_group" getter="get_process_thread_group" enum="Node.ProcessThreadGroup" default="0">
Set the process thread group for this node (basically, whether it receives [constant NOTIFICATION_PROCESS], [constant NOTIFICATION_PHYSICS_PROCESS], [method _process] or [method _physics_process] (and the internal versions) on the main thread or in a sub-thread.
@@ -1187,7 +1202,7 @@
</constant>
<constant name="NOTIFICATION_WM_GO_BACK_REQUEST" value="1007">
Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android).
- Implemented only on iOS.
+ Implemented only on Android.
</constant>
<constant name="NOTIFICATION_WM_SIZE_CHANGED" value="1008">
Notification received when the window is resized.
diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml
index 851290de7b..0b2dfcea03 100644
--- a/doc/classes/Node2D.xml
+++ b/doc/classes/Node2D.xml
@@ -95,43 +95,44 @@
</methods>
<members>
<member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position">
- Global position.
+ Global position. See also [member position].
</member>
<member name="global_rotation" type="float" setter="set_global_rotation" getter="get_global_rotation">
- Global rotation in radians.
+ Global rotation in radians. See also [member rotation].
</member>
<member name="global_rotation_degrees" type="float" setter="set_global_rotation_degrees" getter="get_global_rotation_degrees">
- Helper property to access [member global_rotation] in degrees instead of radians.
+ Helper property to access [member global_rotation] in degrees instead of radians. See also [member rotation_degrees].
</member>
<member name="global_scale" type="Vector2" setter="set_global_scale" getter="get_global_scale">
- Global scale.
+ Global scale. See also [member scale].
</member>
<member name="global_skew" type="float" setter="set_global_skew" getter="get_global_skew">
- Global skew in radians.
+ Global skew in radians. See also [member skew].
</member>
<member name="global_transform" type="Transform2D" setter="set_global_transform" getter="get_global_transform">
- Global [Transform2D].
+ Global [Transform2D]. See also [member transform].
</member>
<member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)">
- Position, relative to the node's parent.
+ Position, relative to the node's parent. See also [member global_position].
</member>
<member name="rotation" type="float" setter="set_rotation" getter="get_rotation" default="0.0">
- Rotation in radians, relative to the node's parent.
+ Rotation in radians, relative to the node's parent. See also [member global_rotation].
[b]Note:[/b] This property is edited in the inspector in degrees. If you want to use degrees in a script, use [member rotation_degrees].
</member>
<member name="rotation_degrees" type="float" setter="set_rotation_degrees" getter="get_rotation_degrees">
- Helper property to access [member rotation] in degrees instead of radians.
+ Helper property to access [member rotation] in degrees instead of radians. See also [member global_rotation_degrees].
</member>
<member name="scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)">
- The node's scale. Unscaled value: [code](1, 1)[/code].
+ The node's scale, relative to the node's parent. Unscaled value: [code](1, 1)[/code]. See also [member global_scale].
[b]Note:[/b] Negative X scales in 2D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, negative scales on the X axis will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed.
</member>
<member name="skew" type="float" setter="set_skew" getter="get_skew" default="0.0">
- Slants the node.
- [b]Note:[/b] Skew is X axis only.
+ If set to a non-zero value, slants the node in one direction or another. This can be used for pseudo-3D effects. See also [member global_skew].
+ [b]Note:[/b] Skew is performed on the X axis only, and [i]between[/i] rotation and scaling.
+ [b]Note:[/b] This property is edited in the inspector in degrees. If you want to use degrees in a script, use [code]skew = deg_to_rad(value_in_degrees)[/code].
</member>
<member name="transform" type="Transform2D" setter="set_transform" getter="get_transform">
- Local [Transform2D].
+ The node's [Transform2D], relative to the node's parent. See also [member global_transform].
</member>
</members>
</class>
diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml
index 125c7ef3ee..ae13af4b82 100644
--- a/doc/classes/Node3D.xml
+++ b/doc/classes/Node3D.xml
@@ -46,6 +46,14 @@
Returns all the gizmos attached to this [Node3D].
</description>
</method>
+ <method name="get_global_transform_interpolated">
+ <return type="Transform3D" />
+ <description>
+ When using physics interpolation, there will be circumstances in which you want to know the interpolated (displayed) transform of a node rather than the standard transform (which may only be accurate to the most recent physics tick).
+ This is particularly important for frame-based operations that take place in [method Node._process], rather than [method Node._physics_process]. Examples include [Camera3D]s focusing on a node, or finding where to fire lasers from on a frame rather than physics tick.
+ [b]Note:[/b] This function creates an interpolation pump on the [Node3D] the first time it is called, which can respond to physics interpolation resets. If you get problems with "streaking" when initially following a [Node3D], be sure to call [method get_global_transform_interpolated] at least once [i]before[/i] resetting the [Node3D] physics interpolation.
+ </description>
+ </method>
<method name="get_parent_node_3d" qualifiers="const">
<return type="Node3D" />
<description>
diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml
index b4969b8906..628c7106f2 100644
--- a/doc/classes/NodePath.xml
+++ b/doc/classes/NodePath.xml
@@ -23,11 +23,12 @@
[/codeblock]
Despite their name, node paths may also point to a property:
[codeblock]
- ^"position" # Points to this object's position.
- ^"position:x" # Points to this object's position in the x axis.
+ ^":position" # Points to this object's position.
+ ^":position:x" # Points to this object's position in the x axis.
^"Camera3D:rotation:y" # Points to the child Camera3D and its y rotation.
^"/root:size:x" # Points to the root Window and its width.
[/codeblock]
+ In some situations, it's possible to omit the leading [code]:[/code] when pointing to an object's property. As an example, this is the case with [method Object.set_indexed] and [method Tween.tween_property], as those methods call [method NodePath.get_as_property_path] under the hood. However, it's generally recommended to keep the [code]:[/code] prefix.
Node paths cannot check whether they are valid and may point to nodes or properties that do not exist. Their meaning depends entirely on the context in which they're used.
You usually do not have to worry about the [NodePath] type, as strings are automatically converted to the type when necessary. There are still times when defining node paths is useful. For example, exported [NodePath] properties allow you to easily select any node within the currently edited scene. They are also automatically updated when moving, renaming or deleting nodes in the scene tree editor. See also [annotation @GDScript.@export_node_path].
See also [StringName], which is a similar type designed for optimized strings.
@@ -56,7 +57,7 @@
<description>
Constructs a [NodePath] from a [String]. The created path is absolute if prefixed with a slash (see [method is_absolute]).
The "subnames" optionally included after the path to the target node can point to properties, and can also be nested.
- Examples of strings that could be node paths:
+ The following strings can be valid node paths:
[codeblock]
# Points to the Sprite2D node.
"Level/RigidBody2D/Sprite2D"
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 3d048e2f63..5ab7c27f4f 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -23,7 +23,7 @@
<return type="void" />
<description>
Shuts down the system MIDI driver. Godot will no longer receive [InputEventMIDI]. See also [method open_midi_inputs] and [method get_connected_midi_inputs].
- [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ [b]Note:[/b] This method is implemented on Linux, macOS, and Windows.
</description>
</method>
<method name="crash">
@@ -53,7 +53,7 @@
Creates a new process that runs independently of Godot. It will not terminate when Godot terminates. The path specified in [param path] must exist and be an executable file or macOS [code].app[/code] bundle. The path is resolved based on the current platform. The [param arguments] are used in the given order and separated by a space.
On Windows, if [param open_console] is [code]true[/code] and the process is a console app, a new terminal window will be opened.
If the process is successfully created, this method returns its process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). Otherwise, this method returns [code]-1[/code].
- For example, running another instance of the project:
+ [b]Example:[/b] Run another instance of the project:
[codeblocks]
[gdscript]
var pid = OS.create_process(OS.get_executable_path(), [])
@@ -132,8 +132,10 @@
<return type="Dictionary" />
<param index="0" name="path" type="String" />
<param index="1" name="arguments" type="PackedStringArray" />
+ <param index="2" name="blocking" type="bool" default="true" />
<description>
Creates a new process that runs independently of Godot with redirected IO. It will not terminate when Godot terminates. The path specified in [param path] must exist and be an executable file or macOS [code].app[/code] bundle. The path is resolved based on the current platform. The [param arguments] are used in the given order and separated by a space.
+ If [param blocking] is [code]false[/code], created pipes work in non-blocking mode, i.e. read and write operations will return immediately. Use [method FileAccess.get_error] to check if the last read/write operation was successful.
If the process cannot be created, this method returns an empty [Dictionary]. Otherwise, this method returns a [Dictionary] with the following keys:
- [code]"stdio"[/code] - [FileAccess] to access the process stdin and stdout pipes (read/write).
- [code]"stderr"[/code] - [FileAccess] to access the process stderr pipe (read only).
@@ -182,7 +184,7 @@
Command-line arguments can be written in any form, including both [code]--key value[/code] and [code]--key=value[/code] forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments.
You can also incorporate environment variables using the [method get_environment] method.
You can set [member ProjectSettings.editor/run/main_run_args] to define command-line arguments to be passed by the editor when running the project.
- Here's a minimal example on how to parse command-line arguments into a [Dictionary] using the [code]--key=value[/code] form for arguments:
+ [b]Example:[/b] Parse command-line arguments into a [Dictionary] using the [code]--key=value[/code] form for arguments:
[codeblocks]
[gdscript]
var arguments = {}
@@ -242,7 +244,7 @@
<return type="PackedStringArray" />
<description>
Returns an array of connected MIDI device names, if they exist. Returns an empty array if the system MIDI driver has not previously been initialized with [method open_midi_inputs]. See also [method close_midi_inputs].
- [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ [b]Note:[/b] This method is implemented on Linux, macOS, and Windows.
</description>
</method>
<method name="get_data_dir" qualifiers="const">
@@ -283,7 +285,7 @@
<return type="String" />
<description>
Returns the file path to the current engine executable.
- [b]Note:[/b] On macOS, always use [method create_instance] instead of relying on executable path.
+ [b]Note:[/b] On macOS, if you want to launch another instance of Godot, always use [method create_instance] instead of relying on the executable path.
</description>
</method>
<method name="get_granted_permissions" qualifiers="const">
@@ -354,7 +356,7 @@
<return type="String" />
<description>
Returns the model name of the current device.
- [b]Note:[/b] This method is implemented on Android and iOS. Returns [code]"GenericDevice"[/code] on unsupported platforms.
+ [b]Note:[/b] This method is implemented on Android, iOS, macOS, and Windows. Returns [code]"GenericDevice"[/code] on unsupported platforms.
</description>
</method>
<method name="get_name" qualifiers="const">
@@ -422,6 +424,7 @@
<description>
Returns the exit code of a spawned process once it has finished running (see [method is_process_running]).
Returns [code]-1[/code] if the [param pid] is not a PID of a spawned child process, the process is still running, or the method is not implemented for the current platform.
+ [b]Note:[/b] Returns [code]-1[/code] if the [param pid] is a macOS bundled app process.
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows.
</description>
</method>
@@ -463,6 +466,24 @@
Returns the amount of static memory being used by the program in bytes. Only works in debug builds.
</description>
</method>
+ <method name="get_stderr_type" qualifiers="const">
+ <return type="int" enum="OS.StdHandleType" />
+ <description>
+ Returns type of the standard error device.
+ </description>
+ </method>
+ <method name="get_stdin_type" qualifiers="const">
+ <return type="int" enum="OS.StdHandleType" />
+ <description>
+ Returns type of the standard input device.
+ </description>
+ </method>
+ <method name="get_stdout_type" qualifiers="const">
+ <return type="int" enum="OS.StdHandleType" />
+ <description>
+ Returns type of the standard output device.
+ </description>
+ </method>
<method name="get_system_ca_certificates">
<return type="String" />
<description>
@@ -677,15 +698,31 @@
<return type="void" />
<description>
Initializes the singleton for the system MIDI driver, allowing Godot to receive [InputEventMIDI]. See also [method get_connected_midi_inputs] and [method close_midi_inputs].
- [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ [b]Note:[/b] This method is implemented on Linux, macOS, and Windows.
+ </description>
+ </method>
+ <method name="read_buffer_from_stdin">
+ <return type="PackedByteArray" />
+ <param index="0" name="buffer_size" type="int" />
+ <description>
+ Reads a user input as raw data from the standard input. This operation can be [i]blocking[/i], which causes the window to freeze if [method read_string_from_stdin] is called on the main thread.
+ - If standard input is console, this method will block until the program receives a line break in standard input (usually by the user pressing [kbd]Enter[/kbd]).
+ - If standard input is pipe, this method will block until a specific amount of data is read or pipe is closed.
+ - If standard input is a file, this method will read a specific amount of data (or less if end-of-file is reached) and return immediately.
+ [b]Note:[/b] This method is implemented on Linux, macOS, and Windows.
+ [b]Note:[/b] On exported Windows builds, run the console wrapper executable to access the terminal. If standard input is console, calling this method without console wrapped will freeze permanently. If standard input is pipe or file, it can be used without console wrapper. If you need a single executable with full console support, use a custom build compiled with the [code]windows_subsystem=console[/code] flag.
</description>
</method>
<method name="read_string_from_stdin">
<return type="String" />
+ <param index="0" name="buffer_size" type="int" />
<description>
- Reads a user input string from the standard input (usually the terminal). This operation is [i]blocking[/i], which causes the window to freeze if [method read_string_from_stdin] is called on the main thread. The thread calling [method read_string_from_stdin] will block until the program receives a line break in standard input (usually by the user pressing [kbd]Enter[/kbd]).
- [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
- [b]Note:[/b] On exported Windows builds, run the console wrapper executable to access the terminal. Otherwise, the standard input will not work correctly. If you need a single executable with console support, use a custom build compiled with the [code]windows_subsystem=console[/code] flag.
+ Reads a user input as a UTF-8 encoded string from the standard input. This operation can be [i]blocking[/i], which causes the window to freeze if [method read_string_from_stdin] is called on the main thread.
+ - If standard input is console, this method will block until the program receives a line break in standard input (usually by the user pressing [kbd]Enter[/kbd]).
+ - If standard input is pipe, this method will block until a specific amount of data is read or pipe is closed.
+ - If standard input is a file, this method will read a specific amount of data (or less if end-of-file is reached) and return immediately.
+ [b]Note:[/b] This method is implemented on Linux, macOS, and Windows.
+ [b]Note:[/b] On exported Windows builds, run the console wrapper executable to access the terminal. If standard input is console, calling this method without console wrapped will freeze permanently. If standard input is pipe or file, it can be used without console wrapper. If you need a single executable with full console support, use a custom build compiled with the [code]windows_subsystem=console[/code] flag.
</description>
</method>
<method name="request_permission">
@@ -801,6 +838,9 @@
<constant name="RENDERING_DRIVER_D3D12" value="2" enum="RenderingDriver">
The Direct3D 12 rendering driver.
</constant>
+ <constant name="RENDERING_DRIVER_METAL" value="3" enum="RenderingDriver">
+ The Metal rendering driver.
+ </constant>
<constant name="SYSTEM_DIR_DESKTOP" value="0" enum="SystemDir">
Refers to the Desktop directory path.
</constant>
@@ -825,5 +865,20 @@
<constant name="SYSTEM_DIR_RINGTONES" value="7" enum="SystemDir">
Refers to the Ringtones directory path.
</constant>
+ <constant name="STD_HANDLE_INVALID" value="0" enum="StdHandleType">
+ Standard I/O device is invalid. No data can be received from or sent to these standard I/O devices.
+ </constant>
+ <constant name="STD_HANDLE_CONSOLE" value="1" enum="StdHandleType">
+ Standard I/O device is a console. This typically occurs when Godot is run from a terminal with no redirection. This is also used for all standard I/O devices when running Godot from the editor, at least on desktop platforms.
+ </constant>
+ <constant name="STD_HANDLE_FILE" value="2" enum="StdHandleType">
+ Standard I/O device is a regular file. This typically occurs with redirection from a terminal, e.g. [code]godot &gt; stdout.txt[/code], [code]godot &lt; stdin.txt[/code] or [code]godot &gt; stdout_stderr.txt 2&gt;&amp;1[/code].
+ </constant>
+ <constant name="STD_HANDLE_PIPE" value="3" enum="StdHandleType">
+ Standard I/O device is a FIFO/pipe. This typically occurs with pipe usage from a terminal, e.g. [code]echo "Hello" | godot[/code].
+ </constant>
+ <constant name="STD_HANDLE_UNKNOWN" value="4" enum="StdHandleType">
+ Standard I/O device type is unknown.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index eecb3ca525..d0c193ea31 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -136,7 +136,7 @@
}
}
- private List&lt;int&gt; _numbers = new();
+ private Godot.Collections.Array&lt;int&gt; _numbers = new();
public override Godot.Collections.Array&lt;Godot.Collections.Dictionary&gt; _GetPropertyList()
{
@@ -173,7 +173,7 @@
if (propertyName.StartsWith("number_"))
{
int index = int.Parse(propertyName.Substring("number_".Length));
- numbers[index] = value.As&lt;int&gt;();
+ _numbers[index] = value.As&lt;int&gt;();
return true;
}
return false;
@@ -192,6 +192,55 @@
[b]Note:[/b] If [method _init] is defined with [i]required[/i] parameters, the Object with script may only be created directly. If any other means (such as [method PackedScene.instantiate] or [method Node.duplicate]) are used, the script's initialization will fail.
</description>
</method>
+ <method name="_iter_get" qualifiers="virtual">
+ <return type="Variant" />
+ <param index="0" name="iter" type="Variant" />
+ <description>
+ Returns the current iterable value. [param iter] stores the iteration state, but unlike [method _iter_init] and [method _iter_next] the state is supposed to be read-only, so there is no [Array] wrapper.
+ </description>
+ </method>
+ <method name="_iter_init" qualifiers="virtual">
+ <return type="bool" />
+ <param index="0" name="iter" type="Array" />
+ <description>
+ Initializes the iterator. [param iter] stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns [code]true[/code] so long as the iterator has not reached the end.
+ Example:
+ [codeblock]
+ class MyRange:
+ var _from
+ var _to
+
+ func _init(from, to):
+ assert(from &lt;= to)
+ _from = from
+ _to = to
+
+ func _iter_init(iter):
+ iter[0] = _from
+ return iter[0] &lt; _to
+
+ func _iter_next(iter):
+ iter[0] += 1
+ return iter[0] &lt; _to
+
+ func _iter_get(iter):
+ return iter
+
+ func _ready():
+ var my_range = MyRange.new(2, 5)
+ for x in my_range:
+ print(x) # Prints 2, 3, 4.
+ [/codeblock]
+ [b]Note:[/b] Alternatively, you can ignore [param iter] and use the object's state instead, see [url=$DOCS_URL/tutorials/scripting/gdscript/gdscript_advanced.html#custom-iterators]online docs[/url] for an example. Note that in this case you will not be able to reuse the same iterator instance in nested loops. Also, make sure you reset the iterator state in this method if you want to reuse the same instance multiple times.
+ </description>
+ </method>
+ <method name="_iter_next" qualifiers="virtual">
+ <return type="bool" />
+ <param index="0" name="iter" type="Array" />
+ <description>
+ Moves the iterator to the next iteration. [param iter] stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns [code]true[/code] so long as the iterator has not reached the end.
+ </description>
+ </method>
<method name="_notification" qualifiers="virtual">
<return type="void" />
<param index="0" name="what" type="int" />
@@ -294,7 +343,7 @@
return "Welcome to Godot 4!"
func _init():
- print(self) # Prints Welcome to Godot 4!"
+ print(self) # Prints "Welcome to Godot 4!"
var a = str(self) # a is "Welcome to Godot 4!"
[/codeblock]
</description>
@@ -341,7 +390,7 @@
public override void _ValidateProperty(Godot.Collections.Dictionary property)
{
- if (property["name"].AsStringName() == PropertyName.Number &amp;&amp; IsNumberEditable)
+ if (property["name"].AsStringName() == PropertyName.Number &amp;&amp; !IsNumberEditable)
{
var usage = property["usage"].As&lt;PropertyUsageFlags&gt;() | PropertyUsageFlags.ReadOnly;
property["usage"] = (int)usage;
@@ -357,7 +406,7 @@
<param index="0" name="signal" type="String" />
<param index="1" name="arguments" type="Array" default="[]" />
<description>
- Adds a user-defined [param signal]. Optional arguments for the signal can be added as an [Array] of dictionaries, each defining a [code]name[/code] [String] and a [code]type[/code] [int] (see [enum Variant.Type]). See also [method has_user_signal] and [method remove_user_signal].
+ Adds a user-defined signal named [param signal]. Optional arguments for the signal can be added as an [Array] of dictionaries, each defining a [code]name[/code] [String] and a [code]type[/code] [int] (see [enum Variant.Type]). See also [method has_user_signal] and [method remove_user_signal].
[codeblocks]
[gdscript]
add_user_signal("hurt", [
@@ -405,7 +454,7 @@
<return type="Variant" />
<param index="0" name="method" type="StringName" />
<description>
- Calls the [param method] on the object during idle time. Always returns null, [b]not[/b] the method's result.
+ Calls the [param method] on the object during idle time. Always returns [code]null[/code], [b]not[/b] the method's result.
Idle time happens mainly at the end of process and physics frames. In it, deferred calls will be run until there are none left, which means you can defer calls from other deferred calls and they'll still be run in the current idle time cycle. This means you should not call a method deferred from itself (or from a method called by it), as this causes infinite recursion the same way as if you had called the method directly.
This method supports a variable number of arguments, so parameters can be passed as a comma separated list.
[codeblocks]
@@ -769,6 +818,20 @@
[b]Note:[/b] Due of the implementation, each [Dictionary] is formatted very similarly to the returned values of [method get_method_list].
</description>
</method>
+ <method name="get_translation_domain" qualifiers="const">
+ <return type="StringName" />
+ <description>
+ Returns the name of the translation domain used by [method tr] and [method tr_n]. See also [TranslationServer].
+ </description>
+ </method>
+ <method name="has_connections" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="signal" type="StringName" />
+ <description>
+ Returns [code]true[/code] if any connection exists on the given [param signal] name.
+ [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call.
+ </description>
+ </method>
<method name="has_meta" qualifiers="const">
<return type="bool" />
<param index="0" name="name" type="StringName" />
@@ -791,7 +854,7 @@
<param index="0" name="signal" type="StringName" />
<description>
Returns [code]true[/code] if the given [param signal] name exists in the object.
- [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call.
+ [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call.
</description>
</method>
<method name="has_user_signal" qualifiers="const">
@@ -835,7 +898,7 @@
<param index="1" name="callable" type="Callable" />
<description>
Returns [code]true[/code] if a connection exists between the given [param signal] name and [param callable].
- [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call.
+ [b]Note:[/b] In C#, [param signal] must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the [code]SignalName[/code] class to avoid allocating a new [StringName] on each call.
</description>
</method>
<method name="is_queued_for_deletion" qualifiers="const">
@@ -1021,6 +1084,13 @@
If a script already exists, its instance is detached, and its property values and state are lost. Built-in property values are still kept.
</description>
</method>
+ <method name="set_translation_domain">
+ <return type="void" />
+ <param index="0" name="domain" type="StringName" />
+ <description>
+ Sets the name of the translation domain used by [method tr] and [method tr_n]. See also [TranslationServer].
+ </description>
+ </method>
<method name="to_string">
<return type="String" />
<description>
@@ -1072,7 +1142,7 @@
Notification received when the object is initialized, before its script is attached. Used internally.
</constant>
<constant name="NOTIFICATION_PREDELETE" value="1">
- Notification received when the object is about to be deleted. Can act as the deconstructor of some programming languages.
+ Notification received when the object is about to be deleted. Can be used like destructors in object-oriented programming languages.
</constant>
<constant name="NOTIFICATION_EXTENSION_RELOADED" value="2">
Notification received when the object finishes hot reloading. This notification is only sent for extensions classes and derived.
diff --git a/doc/classes/OccluderInstance3D.xml b/doc/classes/OccluderInstance3D.xml
index 6f45d72249..b3e6366c12 100644
--- a/doc/classes/OccluderInstance3D.xml
+++ b/doc/classes/OccluderInstance3D.xml
@@ -6,7 +6,7 @@
<description>
Occlusion culling can improve rendering performance in closed/semi-open areas by hiding geometry that is occluded by other objects.
The occlusion culling system is mostly static. [OccluderInstance3D]s can be moved or hidden at run-time, but doing so will trigger a background recomputation that can take several frames. It is recommended to only move [OccluderInstance3D]s sporadically (e.g. for procedural generation purposes), rather than doing so every frame.
- The occlusion culling system works by rendering the occluders on the CPU in parallel using [url=https://www.embree.org/]Embree[/url], drawing the result to a low-resolution buffer then using this to cull 3D nodes individually. In the 3D editor, you can preview the occlusion culling buffer by choosing [b]Perspective &gt; Debug Advanced... &gt; Occlusion Culling Buffer[/b] in the top-left corner of the 3D viewport. The occlusion culling buffer quality can be adjusted in the Project Settings.
+ The occlusion culling system works by rendering the occluders on the CPU in parallel using [url=https://www.embree.org/]Embree[/url], drawing the result to a low-resolution buffer then using this to cull 3D nodes individually. In the 3D editor, you can preview the occlusion culling buffer by choosing [b]Perspective &gt; Display Advanced... &gt; Occlusion Culling Buffer[/b] in the top-left corner of the 3D viewport. The occlusion culling buffer quality can be adjusted in the Project Settings.
[b]Baking:[/b] Select an [OccluderInstance3D] node, then use the [b]Bake Occluders[/b] button at the top of the 3D editor. Only opaque materials will be taken into account; transparent materials (alpha-blended or alpha-tested) will be ignored by the occluder generation.
[b]Note:[/b] Occlusion culling is only effective if [member ProjectSettings.rendering/occlusion_culling/use_occlusion_culling] is [code]true[/code]. Enabling occlusion culling has a cost on the CPU. Only enable occlusion culling if you actually plan to use it. Large open scenes with few or no objects blocking the view will generally not benefit much from occlusion culling. Large open scenes generally benefit more from mesh LOD and visibility ranges ([member GeometryInstance3D.visibility_range_begin] and [member GeometryInstance3D.visibility_range_end]) compared to occlusion culling.
[b]Note:[/b] Due to memory constraints, occlusion culling is not supported by default in Web export templates. It can be enabled by compiling custom Web export templates with [code]module_raycast_enabled=yes[/code].
diff --git a/doc/classes/OptimizedTranslation.xml b/doc/classes/OptimizedTranslation.xml
index 124f430f1b..bc158984d7 100644
--- a/doc/classes/OptimizedTranslation.xml
+++ b/doc/classes/OptimizedTranslation.xml
@@ -14,6 +14,7 @@
<param index="0" name="from" type="Translation" />
<description>
Generates and sets an optimized translation from the given [Translation] resource.
+ [b]Note:[/b] This method is intended to be used in the editor. It does nothing when called from an exported project.
</description>
</method>
</methods>
diff --git a/doc/classes/PCKPacker.xml b/doc/classes/PCKPacker.xml
index 494e9966ac..f8f7dbee01 100644
--- a/doc/classes/PCKPacker.xml
+++ b/doc/classes/PCKPacker.xml
@@ -26,11 +26,18 @@
<methods>
<method name="add_file">
<return type="int" enum="Error" />
- <param index="0" name="pck_path" type="String" />
+ <param index="0" name="target_path" type="String" />
<param index="1" name="source_path" type="String" />
<param index="2" name="encrypt" type="bool" default="false" />
<description>
- Adds the [param source_path] file to the current PCK package at the [param pck_path] internal path (should start with [code]res://[/code]).
+ Adds the [param source_path] file to the current PCK package at the [param target_path] internal path. The [code]res://[/code] prefix for [param target_path] is optional and stripped internally.
+ </description>
+ </method>
+ <method name="add_file_removal">
+ <return type="int" enum="Error" />
+ <param index="0" name="target_path" type="String" />
+ <description>
+ Registers a file removal of the [param target_path] internal path to the PCK. This is mainly used for patches. If the file at this path has been loaded from a previous PCK, it will be removed. The [code]res://[/code] prefix for [param target_path] is optional and stripped internally.
</description>
</method>
<method name="flush">
@@ -42,12 +49,12 @@
</method>
<method name="pck_start">
<return type="int" enum="Error" />
- <param index="0" name="pck_name" type="String" />
+ <param index="0" name="pck_path" type="String" />
<param index="1" name="alignment" type="int" default="32" />
<param index="2" name="key" type="String" default="&quot;0000000000000000000000000000000000000000000000000000000000000000&quot;" />
<param index="3" name="encrypt_directory" type="bool" default="false" />
<description>
- Creates a new PCK file with the name [param pck_name]. The [code].pck[/code] file extension isn't added automatically, so it should be part of [param pck_name] (even though it's not required).
+ Creates a new PCK file at the file path [param pck_path]. The [code].pck[/code] file extension isn't added automatically, so it should be part of [param pck_path] (even though it's not required).
</description>
</method>
</methods>
diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml
index e179c111a2..75193ae8ed 100644
--- a/doc/classes/PackedByteArray.xml
+++ b/doc/classes/PackedByteArray.xml
@@ -307,6 +307,13 @@
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the byte at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="get_string_from_ascii" qualifiers="const">
<return type="String" />
<description>
diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml
index 57295cb1e3..b9cef0ead6 100644
--- a/doc/classes/PackedColorArray.xml
+++ b/doc/classes/PackedColorArray.xml
@@ -94,6 +94,13 @@
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="Color" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the [Color] at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="Color" />
diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml
index 2db1386fd0..d421993b8f 100644
--- a/doc/classes/PackedFloat32Array.xml
+++ b/doc/classes/PackedFloat32Array.xml
@@ -93,6 +93,13 @@
[b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="float" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the 32-bit float at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="float" />
diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml
index 0bcee918ed..4622d63258 100644
--- a/doc/classes/PackedFloat64Array.xml
+++ b/doc/classes/PackedFloat64Array.xml
@@ -94,6 +94,13 @@
[b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="float" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the 64-bit float at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="float" />
diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml
index 93b2ae7394..3a3596b2d0 100644
--- a/doc/classes/PackedInt32Array.xml
+++ b/doc/classes/PackedInt32Array.xml
@@ -90,6 +90,13 @@
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the 32-bit integer at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="int" />
diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml
index 3d34165915..cfaf012a55 100644
--- a/doc/classes/PackedInt64Array.xml
+++ b/doc/classes/PackedInt64Array.xml
@@ -91,6 +91,13 @@
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the 64-bit integer at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="int" />
diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml
index 26d8fa8d5f..baff5fed57 100644
--- a/doc/classes/PackedScene.xml
+++ b/doc/classes/PackedScene.xml
@@ -7,7 +7,7 @@
A simplified interface to a scene file. Provides access to operations and checks that can be performed on the scene resource itself.
Can be used to save a node to a file. When saving, the node as well as all the nodes it owns get saved (see [member Node.owner] property).
[b]Note:[/b] The node doesn't need to own itself.
- [b]Example of loading a saved scene:[/b]
+ [b]Example:[/b] Load a saved scene:
[codeblocks]
[gdscript]
# Use load() instead of preload() if the path isn't known at compile-time.
@@ -22,7 +22,7 @@
AddChild(scene);
[/csharp]
[/codeblocks]
- [b]Example of saving a node with different owners:[/b] The following example creates 3 objects: [Node2D] ([code]node[/code]), [RigidBody2D] ([code]body[/code]) and [CollisionObject2D] ([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 [method pack] will therefore only save those two nodes, but not [code]collision[/code].
+ [b]Example:[/b] Save a node with different owners. The following example creates 3 objects: [Node2D] ([code]node[/code]), [RigidBody2D] ([code]body[/code]) and [CollisionObject2D] ([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 [method pack] will therefore only save those two nodes, but not [code]collision[/code].
[codeblocks]
[gdscript]
# Create the objects.
@@ -103,12 +103,6 @@
</description>
</method>
</methods>
- <members>
- <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{ &quot;conn_count&quot;: 0, &quot;conns&quot;: PackedInt32Array(), &quot;editable_instances&quot;: [], &quot;names&quot;: PackedStringArray(), &quot;node_count&quot;: 0, &quot;node_paths&quot;: [], &quot;nodes&quot;: PackedInt32Array(), &quot;variants&quot;: [], &quot;version&quot;: 3 }">
- A dictionary representation of the scene contents.
- Available keys include "names" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for paths to overridden nodes, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene.
- </member>
- </members>
<constants>
<constant name="GEN_EDIT_STATE_DISABLED" value="0" enum="GenEditState">
If passed to [method instantiate], blocks edits to the scene state.
diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml
index 621831c7a3..511850d645 100644
--- a/doc/classes/PackedStringArray.xml
+++ b/doc/classes/PackedStringArray.xml
@@ -97,6 +97,13 @@
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="String" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the [String] at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="String" />
diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml
index 14a3816353..4d487b6dc2 100644
--- a/doc/classes/PackedVector2Array.xml
+++ b/doc/classes/PackedVector2Array.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
An array specifically designed to hold [Vector2]. Packs data tightly, so it saves memory for large array sizes.
- [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedVector3Array] versus [code]Array[Vector2][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays.
+ [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedVector2Array] versus [code]Array[Vector2][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays.
[b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again.
</description>
<tutorials>
@@ -98,6 +98,13 @@
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="Vector2" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the [Vector2] at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="Vector2" />
diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml
index 49220c6fd6..d47f2f3cd1 100644
--- a/doc/classes/PackedVector3Array.xml
+++ b/doc/classes/PackedVector3Array.xml
@@ -97,6 +97,13 @@
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="Vector3" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the [Vector3] at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="Vector3" />
diff --git a/doc/classes/PackedVector4Array.xml b/doc/classes/PackedVector4Array.xml
index fd0cfeb74b..6dbfc7413d 100644
--- a/doc/classes/PackedVector4Array.xml
+++ b/doc/classes/PackedVector4Array.xml
@@ -96,6 +96,13 @@
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
+ <method name="get" qualifiers="const">
+ <return type="Vector4" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the [Vector4] at the given [param index] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]).
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="Vector4" />
diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml
index 12d3178797..05b6e646c0 100644
--- a/doc/classes/PacketPeerUDP.xml
+++ b/doc/classes/PacketPeerUDP.xml
@@ -4,7 +4,32 @@
UDP packet peer.
</brief_description>
<description>
- UDP packet peer. Can be used to send raw UDP packets as well as [Variant]s.
+ UDP packet peer. Can be used to send and receive raw UDP packets as well as [Variant]s.
+ [b]Example:[/b] Send a packet:
+ [codeblock]
+ var peer = PacketPeerUDP.new()
+
+ # Optionally, you can select the local port used to send the packet.
+ peer.bind(4444)
+
+ peer.set_dest_address("1.1.1.1", 4433)
+ peer.put_packet("hello".to_utf8_buffer())
+ [/codeblock]
+ [b]Example:[/b] Listen for packets:
+ [codeblock]
+ var peer
+
+ func _ready():
+ peer = PacketPeerUDP.new()
+ peer.bind(4433)
+
+
+ func _process(_delta):
+ if peer.get_available_packet_count() &gt; 0:
+ var array_bytes = peer.get_packet()
+ var packet_string = array_bytes.get_string_from_ascii()
+ print("Received message: ", packet_string)
+ [/codeblock]
[b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.
</description>
<tutorials>
diff --git a/doc/classes/Parallax2D.xml b/doc/classes/Parallax2D.xml
index 472aeb0bd3..cfd282a723 100644
--- a/doc/classes/Parallax2D.xml
+++ b/doc/classes/Parallax2D.xml
@@ -8,6 +8,7 @@
[b]Note:[/b] Any changes to this node's position made after it enters the scene tree will be overridden if [member ignore_camera_scroll] is [code]false[/code] or [member screen_offset] is modified.
</description>
<tutorials>
+ <link title="2D Parallax">$DOCS_URL/tutorials/2d/2d_parallax.html</link>
</tutorials>
<members>
<member name="autoscroll" type="Vector2" setter="set_autoscroll" getter="get_autoscroll" default="Vector2(0, 0)">
diff --git a/doc/classes/ParticleProcessMaterial.xml b/doc/classes/ParticleProcessMaterial.xml
index 1502690b45..742e0cc44c 100644
--- a/doc/classes/ParticleProcessMaterial.xml
+++ b/doc/classes/ParticleProcessMaterial.xml
@@ -90,6 +90,7 @@
<members>
<member name="alpha_curve" type="Texture2D" setter="set_alpha_curve" getter="get_alpha_curve">
The alpha value of each particle's color will be multiplied by this [CurveTexture] over its lifetime.
+ [b]Note:[/b] [member alpha_curve] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] [i]must[/i] be [code]true[/code]. For a [ShaderMaterial], [code]ALBEDO *= COLOR.rgb;[/code] must be inserted in the shader's [code]fragment()[/code] function. Otherwise, [member alpha_curve] will have no visible effect.
</member>
<member name="angle_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's rotation will be animated along this [CurveTexture].
@@ -193,7 +194,7 @@
</member>
<member name="emission_curve" type="Texture2D" setter="set_emission_curve" getter="get_emission_curve">
Each particle's color will be multiplied by this [CurveTexture] over its lifetime.
- [b]Note:[/b] This property won't have a visible effect unless the render material is marked as unshaded.
+ [b]Note:[/b] [member emission_curve] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] [i]must[/i] be [code]true[/code]. For a [ShaderMaterial], [code]ALBEDO *= COLOR.rgb;[/code] must be inserted in the shader's [code]fragment()[/code] function. Otherwise, [member emission_curve] will have no visible effect.
</member>
<member name="emission_normal_texture" type="Texture2D" setter="set_emission_normal_texture" getter="get_emission_normal_texture">
Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
@@ -207,6 +208,10 @@
<member name="emission_ring_axis" type="Vector3" setter="set_emission_ring_axis" getter="get_emission_ring_axis">
The axis of the ring when using the emitter [constant EMISSION_SHAPE_RING].
</member>
+ <member name="emission_ring_cone_angle" type="float" setter="set_emission_ring_cone_angle" getter="get_emission_ring_cone_angle">
+ The angle of the cone when using the emitter [constant EMISSION_SHAPE_RING]. The default angle of 90 degrees results in a ring, while an angle of 0 degrees results in a cone. Intermediate values will result in a ring where one end is larger than the other.
+ [b]Note:[/b] Depending on [member emission_ring_height], the angle may be clamped if the ring's end is reached to form a perfect cone.
+ </member>
<member name="emission_ring_height" type="float" setter="set_emission_ring_height" getter="get_emission_ring_height">
The height of the ring when using the emitter [constant EMISSION_SHAPE_RING].
</member>
diff --git a/doc/classes/PathFollow2D.xml b/doc/classes/PathFollow2D.xml
index 61db34fb02..7444bfc23a 100644
--- a/doc/classes/PathFollow2D.xml
+++ b/doc/classes/PathFollow2D.xml
@@ -26,6 +26,7 @@
</member>
<member name="progress_ratio" type="float" setter="set_progress_ratio" getter="get_progress_ratio" default="0.0">
The distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). This is just another way of expressing the progress within the path, as the offset supplied is multiplied internally by the path's length.
+ It can be set or get only if the [PathFollow2D] is the child of a [Path2D] which is part of the scene tree, and that this [Path2D] has a [Curve2D] with a non-zero length. Otherwise, trying to set this field will print an error, and getting this field will return [code]0.0[/code].
</member>
<member name="rotates" type="bool" setter="set_rotates" getter="is_rotating" default="true">
If [code]true[/code], this node rotates to follow the path, with the +X direction facing forward on the path.
diff --git a/doc/classes/PathFollow3D.xml b/doc/classes/PathFollow3D.xml
index b505c6ea8b..bcd04d51ca 100644
--- a/doc/classes/PathFollow3D.xml
+++ b/doc/classes/PathFollow3D.xml
@@ -36,6 +36,7 @@
</member>
<member name="progress_ratio" type="float" setter="set_progress_ratio" getter="get_progress_ratio" default="0.0">
The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the progress within the path, as the progress supplied is multiplied internally by the path's length.
+ It can be set or get only if the [PathFollow3D] is the child of a [Path3D] which is part of the scene tree, and that this [Path3D] has a [Curve3D] with a non-zero length. Otherwise, trying to set this field will print an error, and getting this field will return [code]0.0[/code].
</member>
<member name="rotation_mode" type="int" setter="set_rotation_mode" getter="get_rotation_mode" enum="PathFollow3D.RotationMode" default="3">
Allows or forbids rotation on one or more axes, depending on the [enum RotationMode] constants being used.
diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml
index 4d01fe1760..66078d2642 100644
--- a/doc/classes/Performance.xml
+++ b/doc/classes/Performance.xml
@@ -221,7 +221,25 @@
<constant name="NAVIGATION_EDGE_FREE_COUNT" value="32" enum="Monitor">
Number of navigation mesh polygon edges that could not be merged in the [NavigationServer3D]. The edges still may be connected by edge proximity or with links.
</constant>
- <constant name="MONITOR_MAX" value="33" enum="Monitor">
+ <constant name="NAVIGATION_OBSTACLE_COUNT" value="33" enum="Monitor">
+ Number of active navigation obstacles in the [NavigationServer3D].
+ </constant>
+ <constant name="PIPELINE_COMPILATIONS_CANVAS" value="34" enum="Monitor">
+ Number of pipeline compilations that were triggered by the 2D canvas renderer.
+ </constant>
+ <constant name="PIPELINE_COMPILATIONS_MESH" value="35" enum="Monitor">
+ Number of pipeline compilations that were triggered by loading meshes. These compilations will show up as longer loading times the first time a user runs the game and the pipeline is required.
+ </constant>
+ <constant name="PIPELINE_COMPILATIONS_SURFACE" value="36" enum="Monitor">
+ Number of pipeline compilations that were triggered by building the surface cache before rendering the scene. These compilations will show up as a stutter when loading an scene the first time a user runs the game and the pipeline is required.
+ </constant>
+ <constant name="PIPELINE_COMPILATIONS_DRAW" value="37" enum="Monitor">
+ Number of pipeline compilations that were triggered while drawing the scene. These compilations will show up as stutters during gameplay the first time a user runs the game and the pipeline is required.
+ </constant>
+ <constant name="PIPELINE_COMPILATIONS_SPECIALIZATION" value="38" enum="Monitor">
+ Number of pipeline compilations that were triggered to optimize the current scene. These compilations are done in the background and should not cause any stutters whatsoever.
+ </constant>
+ <constant name="MONITOR_MAX" value="39" enum="Monitor">
Represents the size of the [enum Monitor] enum.
</constant>
</constants>
diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml
index bce1a80526..eda9fd6af5 100644
--- a/doc/classes/PhysicalBone3D.xml
+++ b/doc/classes/PhysicalBone3D.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
The [PhysicalBone3D] node is a physics body that can be used to make bones in a [Skeleton3D] react to physics.
+ [b]Note:[/b] In order to detect physical bones with raycasts, the [member SkeletonModifier3D.active] property of the parent [PhysicalBoneSimulator3D] must be [code]true[/code] and the [Skeleton3D]'s bone must be assigned to [PhysicalBone3D] correctly; it means that [method get_bone_id] should return a valid id ([code]&gt;= 0[/code]).
</description>
<tutorials>
</tutorials>
@@ -20,6 +21,9 @@
<return type="void" />
<param index="0" name="impulse" type="Vector3" />
<description>
+ Applies a directional impulse without affecting rotation.
+ An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_integrate_forces" functions otherwise).
+ This is equivalent to using [method apply_impulse] at the body's center of mass.
</description>
</method>
<method name="apply_impulse">
@@ -27,21 +31,27 @@
<param index="0" name="impulse" type="Vector3" />
<param index="1" name="position" type="Vector3" default="Vector3(0, 0, 0)" />
<description>
+ Applies a positioned impulse to the PhysicsBone3D.
+ An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_integrate_forces" functions otherwise).
+ [param position] is the offset from the PhysicsBone3D origin in global coordinates.
</description>
</method>
<method name="get_bone_id" qualifiers="const">
<return type="int" />
<description>
+ Returns the unique identifier of the PhysicsBone3D.
</description>
</method>
<method name="get_simulate_physics">
<return type="bool" />
<description>
+ Returns [code]true[/code] if the PhysicsBone3D is allowed to simulate physics.
</description>
</method>
<method name="is_simulating_physics">
<return type="bool" />
<description>
+ Returns [code]true[/code] if the PhysicsBone3D is currently simulating physics.
</description>
</method>
</methods>
@@ -74,7 +84,7 @@
The body's friction, from [code]0[/code] (frictionless) to [code]1[/code] (max friction).
</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 the body'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 [member ProjectSettings.physics/3d/default_gravity] to produce this body's gravity. For example, a value of [code]1.0[/code] will apply normal gravity, [code]2.0[/code] will apply double the gravity, and [code]0.5[/code] will apply half the gravity to this body.
</member>
<member name="joint_offset" type="Transform3D" setter="set_joint_offset" getter="get_joint_offset" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)">
Sets the joint's transform.
@@ -86,7 +96,7 @@
Sets the joint type. See [enum JointType] for possible values.
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.0">
- Damps the body's movement. By default, the body will use the [b]Default Linear Damp[/b] in [b]Project &gt; Project Settings &gt; Physics &gt; 3d[/b] or any value override set by an [Area3D] the body is in. Depending on [member linear_damp_mode], you can set [member linear_damp] to be added to or to replace the body's damping value.
+ Damps the body's movement. By default, the body will use [member ProjectSettings.physics/3d/default_linear_damp] or any value override set by an [Area3D] the body is in. Depending on [member linear_damp_mode], [member linear_damp] may be added to or replace the body's damping value.
See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping.
</member>
<member name="linear_damp_mode" type="int" setter="set_linear_damp_mode" getter="get_linear_damp_mode" enum="PhysicalBone3D.DampMode" default="0">
@@ -107,16 +117,22 @@
In this mode, the body's damping value replaces any value set in areas or the default value.
</constant>
<constant name="JOINT_TYPE_NONE" value="0" enum="JointType">
+ No joint is applied to the PhysicsBone3D.
</constant>
<constant name="JOINT_TYPE_PIN" value="1" enum="JointType">
+ A pin joint is applied to the PhysicsBone3D.
</constant>
<constant name="JOINT_TYPE_CONE" value="2" enum="JointType">
+ A cone joint is applied to the PhysicsBone3D.
</constant>
<constant name="JOINT_TYPE_HINGE" value="3" enum="JointType">
+ A hinge joint is applied to the PhysicsBone3D.
</constant>
<constant name="JOINT_TYPE_SLIDER" value="4" enum="JointType">
+ A slider joint is applied to the PhysicsBone3D.
</constant>
<constant name="JOINT_TYPE_6DOF" value="5" enum="JointType">
+ A 6 degrees of freedom joint is applied to the PhysicsBone3D.
</constant>
</constants>
</class>
diff --git a/doc/classes/PhysicsPointQueryParameters2D.xml b/doc/classes/PhysicsPointQueryParameters2D.xml
index 521e584173..642e87947a 100644
--- a/doc/classes/PhysicsPointQueryParameters2D.xml
+++ b/doc/classes/PhysicsPointQueryParameters2D.xml
@@ -24,6 +24,7 @@
</member>
<member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]">
The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node.
+ [b]Note:[/b] The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again.
</member>
<member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)">
The position being queried for, in global coordinates.
diff --git a/doc/classes/PhysicsPointQueryParameters3D.xml b/doc/classes/PhysicsPointQueryParameters3D.xml
index 1cbc11bd03..a53300c78d 100644
--- a/doc/classes/PhysicsPointQueryParameters3D.xml
+++ b/doc/classes/PhysicsPointQueryParameters3D.xml
@@ -20,6 +20,7 @@
</member>
<member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]">
The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node.
+ [b]Note:[/b] The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again.
</member>
<member name="position" type="Vector3" setter="set_position" getter="get_position" default="Vector3(0, 0, 0)">
The position being queried for, in global coordinates.
diff --git a/doc/classes/PhysicsRayQueryParameters2D.xml b/doc/classes/PhysicsRayQueryParameters2D.xml
index 3d69e092f6..a9738b4690 100644
--- a/doc/classes/PhysicsRayQueryParameters2D.xml
+++ b/doc/classes/PhysicsRayQueryParameters2D.xml
@@ -36,6 +36,7 @@
</member>
<member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]">
The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node.
+ [b]Note:[/b] The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again.
</member>
<member name="from" type="Vector2" setter="set_from" getter="get_from" default="Vector2(0, 0)">
The starting point of the ray being queried for, in global coordinates.
diff --git a/doc/classes/PhysicsRayQueryParameters3D.xml b/doc/classes/PhysicsRayQueryParameters3D.xml
index b203b8f555..175b594fb0 100644
--- a/doc/classes/PhysicsRayQueryParameters3D.xml
+++ b/doc/classes/PhysicsRayQueryParameters3D.xml
@@ -36,6 +36,7 @@
</member>
<member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]">
The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node.
+ [b]Note:[/b] The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again.
</member>
<member name="from" type="Vector3" setter="set_from" getter="get_from" default="Vector3(0, 0, 0)">
The starting point of the ray being queried for, in global coordinates.
diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml
index c0672cc503..bd960e3da5 100644
--- a/doc/classes/PhysicsServer2D.xml
+++ b/doc/classes/PhysicsServer2D.xml
@@ -694,6 +694,17 @@
[b]Note:[/b] The state change doesn't take effect immediately. The state will change on the next physics frame.
</description>
</method>
+ <method name="body_set_state_sync_callback">
+ <return type="void" />
+ <param index="0" name="body" type="RID" />
+ <param index="1" name="callable" type="Callable" />
+ <description>
+ Sets the body's state synchronization callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the callback.
+ The function [param callable] will be called every physics frame, assuming that the body was active during the previous physics tick, and can be used to fetch the latest state from the physics server.
+ The function [param callable] must take the following parameters:
+ 1. [code]state[/code]: a [PhysicsDirectBodyState2D], used to retrieve the body's state.
+ </description>
+ </method>
<method name="body_test_motion">
<return type="bool" />
<param index="0" name="body" type="RID" />
diff --git a/doc/classes/PhysicsServer2DExtension.xml b/doc/classes/PhysicsServer2DExtension.xml
index 41826ea7c2..07c65915c6 100644
--- a/doc/classes/PhysicsServer2DExtension.xml
+++ b/doc/classes/PhysicsServer2DExtension.xml
@@ -713,7 +713,7 @@
<param index="1" name="callable" type="Callable" />
<description>
Assigns the [param body] to call the given [param callable] during the synchronization phase of the loop, before [method _step] is called. See also [method _sync].
- Overridable version of [PhysicsServer2D]'s internal [code]body_set_state_sync_callback[/code] method.
+ Overridable version of [method PhysicsServer2D.body_set_state_sync_callback].
</description>
</method>
<method name="_body_test_motion" qualifiers="virtual const">
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index a7b55387a4..f87d6342c7 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -678,6 +678,17 @@
Sets a body state (see [enum BodyState] constants).
</description>
</method>
+ <method name="body_set_state_sync_callback">
+ <return type="void" />
+ <param index="0" name="body" type="RID" />
+ <param index="1" name="callable" type="Callable" />
+ <description>
+ Sets the body's state synchronization callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the callback.
+ The function [param callable] will be called every physics frame, assuming that the body was active during the previous physics tick, and can be used to fetch the latest state from the physics server.
+ The function [param callable] must take the following parameters:
+ 1. [code]state[/code]: a [PhysicsDirectBodyState3D], used to retrieve the body's state.
+ </description>
+ </method>
<method name="body_test_motion">
<return type="bool" />
<param index="0" name="body" type="RID" />
diff --git a/doc/classes/PhysicsShapeQueryParameters2D.xml b/doc/classes/PhysicsShapeQueryParameters2D.xml
index 915d94a54c..3687a4dc5a 100644
--- a/doc/classes/PhysicsShapeQueryParameters2D.xml
+++ b/doc/classes/PhysicsShapeQueryParameters2D.xml
@@ -20,6 +20,7 @@
</member>
<member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]">
The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node.
+ [b]Note:[/b] The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again.
</member>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0">
The collision margin for the shape.
diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml
index eba2b8287f..f05322f1ab 100644
--- a/doc/classes/PhysicsShapeQueryParameters3D.xml
+++ b/doc/classes/PhysicsShapeQueryParameters3D.xml
@@ -20,6 +20,7 @@
</member>
<member name="exclude" type="RID[]" setter="set_exclude" getter="get_exclude" default="[]">
The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node.
+ [b]Note:[/b] The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again.
</member>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0">
The collision margin for the shape.
diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml
index 90d3522002..4e9208d9bb 100644
--- a/doc/classes/Polygon2D.xml
+++ b/doc/classes/Polygon2D.xml
@@ -71,9 +71,6 @@
<member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" default="false">
If [code]true[/code], polygon edges will be anti-aliased.
</member>
- <member name="bones" type="Array" setter="_set_bones" getter="_get_bones" default="[]">
- Internal list of [Bone2D] nodes used by the assigned [member skeleton]. Edited using the Polygon2D editor ("UV" button on the top toolbar).
- </member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)" keywords="colour">
The polygon's fill color. If [member texture] is set, it will be multiplied by this color. It will also be the default color for vertices not set in [member vertex_colors].
</member>
diff --git a/doc/classes/PolygonPathFinder.xml b/doc/classes/PolygonPathFinder.xml
index f37a8a05e4..b70633883c 100644
--- a/doc/classes/PolygonPathFinder.xml
+++ b/doc/classes/PolygonPathFinder.xml
@@ -42,6 +42,30 @@
<return type="bool" />
<param index="0" name="point" type="Vector2" />
<description>
+ Returns [code]true[/code] if [param point] falls inside the polygon area.
+ [codeblocks]
+ [gdscript]
+ var polygon_path_finder = PolygonPathFinder.new()
+ var points = [Vector2(0.0, 0.0), Vector2(1.0, 0.0), Vector2(0.0, 1.0)]
+ var connections = [0, 1, 1, 2, 2, 0]
+ polygon_path_finder.setup(points, connections)
+ print(polygon_path_finder.is_point_inside(Vector2(0.2, 0.2))) # Prints true
+ print(polygon_path_finder.is_point_inside(Vector2(1.0, 1.0))) # Prints false
+ [/gdscript]
+ [csharp]
+ var polygonPathFinder = new PolygonPathFinder();
+ var points = new Vector2[]
+ {
+ new Vector2(0.0f, 0.0f),
+ new Vector2(1.0f, 0.0f),
+ new Vector2(0.0f, 1.0f)
+ };
+ var connections = new int[] { 0, 1, 1, 2, 2, 0 };
+ polygonPathFinder.Setup(points, connections);
+ GD.Print(polygonPathFinder.IsPointInside(new Vector2(0.2f, 0.2f))); // Prints true
+ GD.Print(polygonPathFinder.IsPointInside(new Vector2(1.0f, 1.0f))); // Prints false
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_point_penalty">
@@ -56,6 +80,27 @@
<param index="0" name="points" type="PackedVector2Array" />
<param index="1" name="connections" type="PackedInt32Array" />
<description>
+ Sets up [PolygonPathFinder] with an array of points that define the vertices of the polygon, and an array of indices that determine the edges of the polygon.
+ The length of [param connections] must be even, returns an error if odd.
+ [codeblocks]
+ [gdscript]
+ var polygon_path_finder = PolygonPathFinder.new()
+ var points = [Vector2(0.0, 0.0), Vector2(1.0, 0.0), Vector2(0.0, 1.0)]
+ var connections = [0, 1, 1, 2, 2, 0]
+ polygon_path_finder.setup(points, connections)
+ [/gdscript]
+ [csharp]
+ var polygonPathFinder = new PolygonPathFinder();
+ var points = new Vector2[]
+ {
+ new Vector2(0.0f, 0.0f),
+ new Vector2(1.0f, 0.0f),
+ new Vector2(0.0f, 1.0f)
+ };
+ var connections = new int[] { 0, 1, 1, 2, 2, 0 };
+ polygonPathFinder.Setup(points, connections);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml
index 0f5687f091..9fd47cf7f5 100644
--- a/doc/classes/PopupMenu.xml
+++ b/doc/classes/PopupMenu.xml
@@ -135,8 +135,6 @@
Adds a new multistate item with text [param label].
Contrarily to normal binary items, multistate items can have more than two states, as defined by [param max_states]. The default value is defined by [param default_state].
An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators.
- [b]Note:[/b] Multistate items don't update their state automatically and must be done manually. See [method toggle_item_multistate], [method set_item_multistate] and [method get_item_multistate] for more info on how to control it.
- Example usage:
[codeblock]
func _ready():
add_multistate_item("Item", 3, 0)
@@ -152,6 +150,7 @@
print("Third state")
)
[/codeblock]
+ [b]Note:[/b] Multistate items don't update their state automatically and must be done manually. See [method toggle_item_multistate], [method set_item_multistate] and [method get_item_multistate] for more info on how to control it.
</description>
</method>
<method name="add_radio_check_item">
@@ -395,6 +394,12 @@
Returns [code]true[/code] if the specified item's shortcut is disabled.
</description>
</method>
+ <method name="is_native_menu" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the system native menu is supported and currently used by this [PopupMenu].
+ </description>
+ </method>
<method name="is_system_menu" qualifiers="const">
<return type="bool" />
<description>
@@ -636,6 +641,7 @@
</member>
<member name="prefer_native_menu" type="bool" setter="set_prefer_native_menu" getter="is_prefer_native_menu" default="false">
If [code]true[/code], [MenuBar] will use native menu when supported.
+ [b]Note:[/b] If [PopupMenu] is linked to [StatusIndicator], [MenuBar], or another [PopupMenu] item it can use native menu regardless of this property, use [method is_native_menu] to check it.
</member>
<member name="submenu_popup_delay" type="float" setter="set_submenu_popup_delay" getter="get_submenu_popup_delay" default="0.3">
Sets the delay time in seconds for the submenu item to popup on mouse hovering. If the popup menu is added as a child of another (acting as a submenu), it will inherit the delay time of the parent menu item.
@@ -769,7 +775,7 @@
[StyleBox] for the right side of labeled separator. See [method add_separator].
</theme_item>
<theme_item name="panel" data_type="style" type="StyleBox">
- [StyleBox] for the the background panel.
+ [StyleBox] for the background panel.
</theme_item>
<theme_item name="separator" data_type="style" type="StyleBox">
[StyleBox] used for the separators. See [method add_separator].
diff --git a/doc/classes/PopupPanel.xml b/doc/classes/PopupPanel.xml
index 399e285402..b581f32686 100644
--- a/doc/classes/PopupPanel.xml
+++ b/doc/classes/PopupPanel.xml
@@ -10,7 +10,7 @@
</tutorials>
<theme_items>
<theme_item name="panel" data_type="style" type="StyleBox">
- [StyleBox] for the the background panel.
+ [StyleBox] for the background panel.
</theme_item>
</theme_items>
</class>
diff --git a/doc/classes/PortableCompressedTexture2D.xml b/doc/classes/PortableCompressedTexture2D.xml
index 3fc2aa2ab9..b85fe1de5c 100644
--- a/doc/classes/PortableCompressedTexture2D.xml
+++ b/doc/classes/PortableCompressedTexture2D.xml
@@ -52,8 +52,6 @@
</method>
</methods>
<members>
- <member name="_data" type="PackedByteArray" setter="_set_data" getter="_get_data" default="PackedByteArray()">
- </member>
<member name="keep_compressed_buffer" type="bool" setter="set_keep_compressed_buffer" getter="is_keeping_compressed_buffer" default="false">
When running on the editor, this class will keep the source compressed data in memory. Otherwise, the source compressed data is lost after loading and the resource can't be re saved.
This flag allows to keep the compressed data in memory if you intend it to persist after loading.
diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml
index 58a8da12da..ba48d2dcf5 100644
--- a/doc/classes/PrimitiveMesh.xml
+++ b/doc/classes/PrimitiveMesh.xml
@@ -18,7 +18,8 @@
<method name="get_mesh_arrays" qualifiers="const">
<return type="Array" />
<description>
- Returns mesh arrays used to constitute surface of [Mesh]. The result can be passed to [method ArrayMesh.add_surface_from_arrays] to create a new surface. For example:
+ Returns the mesh arrays used to make up the surface of this primitive mesh.
+ [b]Example:[/b] Pass the result to [method ArrayMesh.add_surface_from_arrays] to create a new surface:
[codeblocks]
[gdscript]
var c = CylinderMesh.new()
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 2e219652ec..91961fcf02 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -10,6 +10,7 @@
[b]Overriding:[/b] Any project setting can be overridden by creating a file named [code]override.cfg[/code] in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. Overriding will still take the base project settings' [url=$DOCS_URL/tutorials/export/feature_tags.html]feature tags[/url] in account. Therefore, make sure to [i]also[/i] override the setting with the desired feature tags if you want them to override base project settings on all platforms and configurations.
</description>
<tutorials>
+ <link title="Project Settings">$DOCS_URL/tutorials/editor/project_settings.html</link>
<link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link>
<link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link>
<link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link>
@@ -23,7 +24,6 @@
- [code]"name"[/code]: [String] (the property's name)
- [code]"type"[/code]: [int] (see [enum Variant.Type])
- optionally [code]"hint"[/code]: [int] (see [enum PropertyHint]) and [code]"hint_string"[/code]: [String]
- [b]Example:[/b]
[codeblocks]
[gdscript]
ProjectSettings.set("category/property_name", 0)
@@ -85,7 +85,6 @@
<param index="1" name="default_value" type="Variant" default="null" />
<description>
Returns the value of the setting identified by [param name]. If the setting doesn't exist and [param default_value] is specified, the value of [param default_value] is returned. Otherwise, [code]null[/code] is returned.
- [b]Example:[/b]
[codeblocks]
[gdscript]
print(ProjectSettings.get_setting("application/config/name"))
@@ -104,8 +103,7 @@
<param index="0" name="name" type="StringName" />
<description>
Similar to [method get_setting], but applies feature tag overrides if any exists and is valid.
- [b]Example:[/b]
- If the following setting override exists "application/config/name.windows", and the following code is executed:
+ [b]Example:[/b] If the setting override [code]"application/config/name.windows"[/code] exists, and the following code is executed on a [i]Windows[/i] operating system, the overridden setting is printed instead:
[codeblocks]
[gdscript]
print(ProjectSettings.get_setting_with_override("application/config/name"))
@@ -114,7 +112,6 @@
GD.Print(ProjectSettings.GetSettingWithOverride("application/config/name"));
[/csharp]
[/codeblocks]
- Then the overridden setting will be returned instead if the project is running on the [i]Windows[/i] operating system.
</description>
</method>
<method name="globalize_path" qualifiers="const">
@@ -224,7 +221,6 @@
<param index="1" name="value" type="Variant" />
<description>
Sets the value of a setting.
- [b]Example:[/b]
[codeblocks]
[gdscript]
ProjectSettings.set_setting("application/config/name", "Example")
@@ -271,6 +267,7 @@
<member name="application/config/custom_user_dir_name" type="String" setter="" getter="" default="&quot;&quot;">
This user directory is used for storing persistent data ([code]user://[/code] filesystem). If a custom directory name is defined, this name will be appended to the system-specific user data directory (same parent folder as the Godot configuration folder documented in [method OS.get_user_data_dir]).
The [member application/config/use_custom_user_dir] setting must be enabled for this to take effect.
+ [b]Note:[/b] If [member application/config/custom_user_dir_name] contains trailing periods, they will be stripped as folder names ending with a period are not allowed on Windows.
</member>
<member name="application/config/description" type="String" setter="" getter="" default="&quot;&quot;">
The project's description, displayed as a tooltip in the Project Manager when hovering the project.
@@ -318,11 +315,11 @@
</member>
<member name="application/run/disable_stderr" type="bool" setter="" getter="" default="false">
If [code]true[/code], disables printing to standard error. If [code]true[/code], this also hides error and warning messages printed by [method @GlobalScope.push_error] and [method @GlobalScope.push_warning]. See also [member application/run/disable_stdout].
- Changes to this setting will only be applied upon restarting the application.
+ Changes to this setting will only be applied upon restarting the application. To control this at runtime, use [member Engine.print_error_messages].
</member>
<member name="application/run/disable_stdout" type="bool" setter="" getter="" default="false">
If [code]true[/code], disables printing to standard output. This is equivalent to starting the editor or project with the [code]--quiet[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. See also [member application/run/disable_stderr].
- Changes to this setting will only be applied upon restarting the application.
+ Changes to this setting will only be applied upon restarting the application. To control this at runtime, use [member Engine.print_to_stdout].
</member>
<member name="application/run/enable_alt_space_menu" type="bool" setter="" getter="" default="false">
If [code]true[/code], allows the [kbd]Alt + Space[/kbd] keys to display the window menu. This menu allows the user to perform various window management operations such as moving, resizing, or minimizing the window.
@@ -344,7 +341,7 @@
This setting can be overridden using the [code]--frame-delay &lt;ms;&gt;[/code] command line argument.
</member>
<member name="application/run/low_processor_mode" type="bool" setter="" getter="" default="false">
- If [code]true[/code], enables low-processor usage mode. The screen is not redrawn if nothing changes visually. This is meant for writing applications and editors, but is pretty useless (and can hurt performance) in most games.
+ If [code]true[/code], enables low-processor usage mode. When enabled, the engine takes longer to redraw, but only redraws the screen if necessary. This may lower power consumption, and is intended for editors or mobile applications. For most games, because the screen needs to be redrawn every frame, it is recommended to keep this setting disabled.
</member>
<member name="application/run/low_processor_mode_sleep_usec" type="int" setter="" getter="" default="6900">
Amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage.
@@ -380,6 +377,7 @@
<member name="audio/driver/driver" type="String" setter="" getter="">
Specifies the audio driver to use. This setting is platform-dependent as each platform supports different audio drivers. If left empty, the default audio driver will be used.
The [code]Dummy[/code] audio driver disables all audio playback and recording, which is useful for non-game applications as it reduces CPU usage. It also prevents the engine from appearing as an application playing audio in the OS' audio mixer.
+ To query the value that is being used at run-time (which may be overridden by command-line arguments or headless mode), use [method AudioServer.get_driver_name].
[b]Note:[/b] The driver in use can be overridden at runtime via the [code]--audio-driver[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url].
</member>
<member name="audio/driver/enable_input" type="bool" setter="" getter="" default="false">
@@ -471,10 +469,13 @@
If the [code]--log-file &lt;file&gt;[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url] is used, log rotation is always disabled.
</member>
<member name="debug/gdscript/warnings/assert_always_false" type="int" setter="" getter="" default="1">
- When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an [code]assert[/code] call always evaluates to false.
+ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an [code]assert[/code] call always evaluates to [code]false[/code].
</member>
<member name="debug/gdscript/warnings/assert_always_true" type="int" setter="" getter="" default="1">
- When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an [code]assert[/code] call always evaluates to true.
+ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an [code]assert[/code] call always evaluates to [code]true[/code].
+ </member>
+ <member name="debug/gdscript/warnings/confusable_capture_reassignment" type="int" setter="" getter="" default="1">
+ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a local variable captured by a lambda is reassigned, since this does not modify the outer local variable.
</member>
<member name="debug/gdscript/warnings/confusable_identifier" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an identifier contains characters that can be confused with something else, like when mixing different alphabets.
@@ -529,6 +530,9 @@
<member name="debug/gdscript/warnings/integer_division" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when dividing an integer by another integer (the decimal part will be discarded).
</member>
+ <member name="debug/gdscript/warnings/missing_tool" type="int" setter="" getter="" default="1">
+ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when the base class script has the [code]@tool[/code] annotation, but the current class script does not have it.
+ </member>
<member name="debug/gdscript/warnings/narrowing_conversion" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when passing a floating-point value to a function that expects an integer (it will be converted and lose precision).
</member>
@@ -557,10 +561,10 @@
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when defining a local or member variable, signal, or enum that would have the same name as a built-in function or global class name, thus shadowing it.
</member>
<member name="debug/gdscript/warnings/shadowed_variable" type="int" setter="" getter="" default="1">
- When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when defining a local or member variable that would shadow a member variable that the class defines.
+ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a local variable or local constant shadows a member declared in the current class.
</member>
<member name="debug/gdscript/warnings/shadowed_variable_base_class" type="int" setter="" getter="" default="1">
- When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when defining a local or subclass member variable that would shadow a variable that is inherited from a parent class.
+ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a local variable or local constant shadows a member declared in a base class.
</member>
<member name="debug/gdscript/warnings/standalone_expression" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling an expression that may have no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement.
@@ -626,9 +630,16 @@
<member name="debug/settings/gdscript/max_call_stack" type="int" setter="" getter="" default="1024">
Maximum call stack allowed for debugging GDScript.
</member>
+ <member name="debug/settings/physics_interpolation/enable_warnings" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], enables warnings which can help pinpoint where nodes are being incorrectly updated, which will result in incorrect interpolation and visual glitches.
+ When a node is being interpolated, it is essential that the transform is set during [method Node._physics_process] (during a physics tick) rather than [method Node._process] (during a frame).
+ </member>
<member name="debug/settings/profiler/max_functions" type="int" setter="" getter="" default="16384">
Maximum number of functions per frame allowed when profiling.
</member>
+ <member name="debug/settings/profiler/max_timestamp_query_elements" type="int" setter="" getter="" default="256">
+ Maximum number of timestamp query elements allowed per frame for visual profiling.
+ </member>
<member name="debug/settings/stdout/print_fps" type="bool" setter="" getter="" default="false">
Print frames per second to standard output every second.
</member>
@@ -807,8 +818,16 @@
<member name="display/window/energy_saving/keep_screen_on" type="bool" setter="" getter="" default="true">
If [code]true[/code], keeps the screen on (even in case of inactivity), so the screensaver does not take over. Works on desktop and mobile platforms.
</member>
- <member name="display/window/energy_saving/keep_screen_on.editor_hint" type="bool" setter="" getter="" default="false">
- Editor-only override for [member display/window/energy_saving/keep_screen_on]. Does not affect running project.
+ <member name="display/window/frame_pacing/android/enable_frame_pacing" type="bool" setter="" getter="" default="true">
+ Enable Swappy for stable frame pacing on Android. Highly recommended.
+ [b]Note:[/b] This option will be forced off when using OpenXR.
+ </member>
+ <member name="display/window/frame_pacing/android/swappy_mode" type="int" setter="" getter="" default="2">
+ Swappy mode to use. The options are:
+ - pipeline_forced_on: Try to honor [member Engine.max_fps]. Pipelining is always on. This is the same behavior as Desktop PC.
+ - auto_fps_pipeline_forced_on: Autocalculate max fps. Actual max_fps will be between 0 and [member Engine.max_fps]. While this sounds convenient, beware that Swappy will often downgrade max fps until it finds something that can be met and sustained. That means if your game runs between 40fps and 60fps on a 60hz screen, after some time Swappy will downgrade max fps so that the game renders at perfect 30fps.
+ - auto_fps_auto_pipeline: Same as auto_fps_pipeline_forced_on, but if Swappy detects that rendering is very fast (e.g. it takes &lt; 8ms to render on a 60hz screen) Swappy will disable pipelining to minimize input latency. This is the default.
+ [b]Note:[/b] If [member Engine.max_fps] is 0, actual max_fps will considered as to be the screen's refresh rate (often 60hz, 90hz or 120hz depending on device model and OS settings).
</member>
<member name="display/window/handheld/orientation" type="int" setter="" getter="" default="0">
The default screen orientation to use on mobile devices. See [enum DisplayServer.ScreenOrientation] for possible values.
@@ -869,6 +888,10 @@
[b]Note:[/b] Certain window managers can be configured to ignore the non-resizable status of a window. Do not rely on this setting as a guarantee that the window will [i]never[/i] be resizable.
[b]Note:[/b] This setting is ignored on iOS.
</member>
+ <member name="display/window/size/sharp_corners" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], the main window uses sharp corners by default.
+ [b]Note:[/b] This property is implemented only on Windows (11).
+ </member>
<member name="display/window/size/transparent" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables a window manager hint that the main window background [i]can[/i] be transparent. This does not make the background actually transparent. For the background to be transparent, the root viewport must also be made transparent by enabling [member rendering/viewport/transparent_background].
[b]Note:[/b] To use a transparent splash screen, set [member application/boot_splash/bg_color] to [code]Color(0, 0, 0, 0)[/code].
@@ -893,8 +916,8 @@
<member name="display/window/stretch/mode" type="String" setter="" getter="" default="&quot;disabled&quot;">
Defines how the base size is stretched to fit the resolution of the window or screen.
[b]"disabled"[/b]: No stretching happens. One unit in the scene corresponds to one pixel on the screen. In this mode, [member display/window/stretch/aspect] has no effect. Recommended for non-game applications.
- [b]"canvas_items"[/b]: The base size specified in width and height in the project settings is stretched to cover the whole screen (taking [member display/window/stretch/aspect] into account). This means that everything is rendered directly at the target resolution. 3D is unaffected, while in 2D, there is no longer a 1:1 correspondence between sprite pixels and screen pixels, which may result in scaling artifacts. Recommended for most games that don't use a pixel art esthetic, although it is possible to use this stretch mode for pixel art games too (especially in 3D).
- [b]"viewport"[/b]: The size of the root [Viewport] is set precisely to the base size specified in the Project Settings' Display section. The scene is rendered to this viewport first. Finally, this viewport is scaled to fit the screen (taking [member display/window/stretch/aspect] into account). Recommended for games that use a pixel art esthetic.
+ [b]"canvas_items"[/b]: The base size specified in width and height in the project settings is stretched to cover the whole screen (taking [member display/window/stretch/aspect] into account). This means that everything is rendered directly at the target resolution. 3D is unaffected, while in 2D, there is no longer a 1:1 correspondence between sprite pixels and screen pixels, which may result in scaling artifacts. Recommended for most games that don't use a pixel art aesthetic, although it is possible to use this stretch mode for pixel art games too (especially in 3D).
+ [b]"viewport"[/b]: The size of the root [Viewport] is set precisely to the base size specified in the Project Settings' Display section. The scene is rendered to this viewport first. Finally, this viewport is scaled to fit the screen (taking [member display/window/stretch/aspect] into account). Recommended for games that use a pixel art aesthetic.
</member>
<member name="display/window/stretch/scale" type="float" setter="" getter="" default="1.0">
The scale factor multiplier to use for 2D elements. This multiplies the final scale factor determined by [member display/window/stretch/mode]. If using the [b]Disabled[/b] stretch mode, this scale factor is applied as-is. This can be adjusted to make the UI easier to read on certain displays.
@@ -906,7 +929,9 @@
[b]Note:[/b] When using integer scaling with a stretch mode, resizing the window to be smaller than the base viewport size will clip the contents. Consider preventing that by setting [member Window.min_size] to the same value as the base viewport size defined in [member display/window/size/viewport_width] and [member display/window/size/viewport_height].
</member>
<member name="display/window/subwindows/embed_subwindows" type="bool" setter="" getter="" default="true">
- If [code]true[/code] subwindows are embedded in the main window.
+ If [code]true[/code], subwindows are embedded in the main window (this is also called single-window mode). Single-window mode can be faster as it does not need to create a separate window for every popup and tooltip, which can be a slow operation depending on the operating system and rendering method in use.
+ If [code]false[/code], subwindows are created as separate windows (this is also called multi-window mode). This allows them to be moved outside the main window and use native operating system window decorations.
+ This is equivalent to [member EditorSettings.interface/editor/single_window_mode] in the editor, except the setting's value is inverted.
</member>
<member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1">
Sets the V-Sync mode for the main game window. The editor's own V-Sync mode can be set using [member EditorSettings.interface/editor/vsync_mode].
@@ -927,8 +952,9 @@
Changing this value allows setting up a multi-project scenario where there are multiple [code].csproj[/code]. Keep in mind that the Godot project is considered one of the C# projects in the workspace and it's root directory should contain the [code]project.godot[/code] and [code].csproj[/code] next to each other.
</member>
<member name="editor/export/convert_text_resources_to_binary" type="bool" setter="" getter="" default="true">
- If [code]true[/code], text resources are converted to a binary format on export. This decreases file sizes and speeds up loading slightly.
- [b]Note:[/b] If [member editor/export/convert_text_resources_to_binary] is [code]true[/code], [method @GDScript.load] will not be able to return the converted files in an exported project. Some file paths within the exported PCK will also change, such as [code]project.godot[/code] becoming [code]project.binary[/code]. If you rely on run-time loading of files present within the PCK, set [member editor/export/convert_text_resources_to_binary] to [code]false[/code].
+ If [code]true[/code], text resource ([code]tres[/code]) and text scene ([code]tscn[/code]) files are converted to their corresponding binary format on export. This decreases file sizes and speeds up loading slightly.
+ [b]Note:[/b] Because a resource's file extension may change in an exported project, it is heavily recommended to use [method @GDScript.load] or [ResourceLoader] instead of [FileAccess] to load resources dynamically.
+ [b]Note:[/b] The project settings file ([code]project.godot[/code]) will always be converted to binary on export, regardless of this setting.
</member>
<member name="editor/import/atlas_max_width" type="int" setter="" getter="" default="2048">
The maximum width to use when importing textures as an atlas. The value will be rounded to the nearest power of two when used. Use this to prevent imported textures from growing too large in the other direction.
@@ -990,7 +1016,7 @@
prime-run %command%
[/codeblock]
</member>
- <member name="editor/script/search_in_file_extensions" type="PackedStringArray" setter="" getter="" default="PackedStringArray(&quot;gd&quot;, &quot;gdshader&quot;)">
+ <member name="editor/script/search_in_file_extensions" type="PackedStringArray" setter="" getter="">
Text-based file extensions to include in the script editor's "Find in Files" feature. You can add e.g. [code]tscn[/code] if you wish to also parse your scene files, especially if you use built-in scripts which are serialized in the scene files.
</member>
<member name="editor/script/templates_search_path" type="String" setter="" getter="" default="&quot;res://script_templates&quot;">
@@ -1360,7 +1386,7 @@
macOS specific override for the shortcut to select the word currently under the caret.
</member>
<member name="input/ui_text_skip_selection_for_next_occurrence" type="Dictionary" setter="" getter="">
- If no selection is currently active with the last caret in text fields, searches for the next occurrence of the the word currently under the caret and moves the caret to the next occurrence. The action can be performed sequentially for other occurrences of the word under the last caret.
+ If no selection is currently active with the last caret in text fields, searches for the next occurrence of the word currently under the caret and moves the caret to the next occurrence. The action can be performed sequentially for other occurrences of the word under the last caret.
If a selection is currently active with the last caret in text fields, searches for the next occurrence of the selection, adds a caret, selects the next occurrence then deselects the previous selection and its associated caret. The action can be performed sequentially for other occurrences of the selection of the last caret.
The viewport is adjusted to the latest newly added caret.
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
@@ -1377,6 +1403,10 @@
Default [InputEventAction] to undo the most recent action.
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
</member>
+ <member name="input/ui_unicode_start" type="Dictionary" setter="" getter="">
+ Default [InputEventAction] to start Unicode character hexadecimal code input in a text field.
+ [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
+ </member>
<member name="input/ui_up" type="Dictionary" setter="" getter="">
Default [InputEventAction] to move up in the UI.
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
@@ -1414,6 +1444,18 @@
<member name="input_devices/pointing/emulate_touch_from_mouse" type="bool" setter="" getter="" default="false">
If [code]true[/code], sends touch input events when clicking or dragging the mouse.
</member>
+ <member name="input_devices/sensors/enable_accelerometer" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], the accelerometer sensor is enabled and [method Input.get_accelerometer] returns valid data.
+ </member>
+ <member name="input_devices/sensors/enable_gravity" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], the gravity sensor is enabled and [method Input.get_gravity] returns valid data.
+ </member>
+ <member name="input_devices/sensors/enable_gyroscope" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], the gyroscope sensor is enabled and [method Input.get_gyroscope] returns valid data.
+ </member>
+ <member name="input_devices/sensors/enable_magnetometer" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], the magnetometer sensor is enabled and [method Input.get_magnetometer] returns valid data.
+ </member>
<member name="internationalization/locale/fallback" type="String" setter="" getter="" default="&quot;en&quot;">
The locale to fall back to if a translation isn't available in a given language. If left empty, [code]en[/code] (English) will be used.
</member>
@@ -2190,6 +2232,7 @@
<member name="physics/2d/physics_engine" type="String" setter="" getter="" default="&quot;DEFAULT&quot;">
Sets which physics engine to use for 2D physics.
"DEFAULT" and "GodotPhysics2D" are the same, as there is currently no alternative 2D physics server implemented.
+ "Dummy" is a 2D physics server that does nothing and returns only dummy values, effectively disabling all 2D physics functionality.
</member>
<member name="physics/2d/run_on_separate_thread" type="bool" setter="" getter="" default="false">
If [code]true[/code], the 2D physics server runs on a separate thread, making better use of multi-core CPUs. If [code]false[/code], the 2D physics server runs on the main thread. Running the physics server on a separate thread can increase performance, but restricts API access to only physics process.
@@ -2268,6 +2311,7 @@
<member name="physics/3d/physics_engine" type="String" setter="" getter="" default="&quot;DEFAULT&quot;">
Sets which physics engine to use for 3D physics.
"DEFAULT" and "GodotPhysics3D" are the same, as there is currently no alternative 3D physics server implemented.
+ "Dummy" is a 3D physics server that does nothing and returns only dummy values, effectively disabling all 3D physics functionality.
</member>
<member name="physics/3d/run_on_separate_thread" type="bool" setter="" getter="" default="false">
If [code]true[/code], the 3D physics server runs on a separate thread, making better use of multi-core CPUs. If [code]false[/code], the 3D physics server runs on the main thread. Running the physics server on a separate thread can increase performance, but restricts API access to only physics process.
@@ -2308,11 +2352,11 @@
If [code]true[/code], the renderer will interpolate the transforms of physics objects between the last two transforms, so that smooth motion is seen even when physics ticks do not coincide with rendered frames. See also [member Node.physics_interpolation_mode] and [method Node.reset_physics_interpolation].
[b]Note:[/b] If [code]true[/code], the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0.0[/code].
[b]Note:[/b] This property is only read when the project starts. To toggle physics interpolation at runtime, set [member SceneTree.physics_interpolation] instead.
- [b]Note:[/b] This feature is currently only implemented in the 2D renderer.
</member>
<member name="physics/common/physics_jitter_fix" type="float" setter="" getter="" default="0.5">
Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be good enough for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended.
- [b]Note:[/b] When using a physics interpolation solution (such as enabling [member physics/common/physics_interpolation] or using a custom solution), the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0.0[/code].
+ [b]Note:[/b] Jitter fix is automatically disabled at runtime when [member physics/common/physics_interpolation] is enabled.
+ [b]Note:[/b] When using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0.0[/code].
[b]Note:[/b] This property is only read when the project starts. To change the physics jitter fix at runtime, set [member Engine.physics_jitter_fix] instead.
</member>
<member name="physics/common/physics_ticks_per_second" type="int" setter="" getter="" default="60">
@@ -2320,6 +2364,13 @@
[b]Note:[/b] This property is only read when the project starts. To change the physics FPS at runtime, set [member Engine.physics_ticks_per_second] instead.
[b]Note:[/b] Only [member physics/common/max_physics_steps_per_frame] physics ticks may be simulated per rendered frame at most. If more physics ticks have to be simulated per rendered frame to keep up with rendering, the project will appear to slow down (even if [code]delta[/code] is used consistently in physics calculations). Therefore, it is recommended to also increase [member physics/common/max_physics_steps_per_frame] if increasing [member physics/common/physics_ticks_per_second] significantly above its default value.
</member>
+ <member name="rendering/2d/batching/item_buffer_size" type="int" setter="" getter="" default="16384">
+ Maximum number of canvas item commands that can be batched into a single draw call.
+ </member>
+ <member name="rendering/2d/batching/uniform_set_cache_size" type="int" setter="" getter="" default="256">
+ Maximum number of uniform sets that will be cached by the 2D renderer when batching draw calls.
+ [b]Note:[/b] A project that uses a large number of unique sprite textures per frame may benefit from increasing this value.
+ </member>
<member name="rendering/2d/sdf/oversize" type="int" setter="" getter="" default="1">
Controls how much of the original viewport size should be covered by the 2D signed distance field. This SDF can be sampled in [CanvasItem] shaders and is used for [GPUParticles2D] collision. Higher values allow portions of occluders located outside the viewport to still be taken into account in the generated signed distance field, at the cost of performance. If you notice particles falling through [LightOccluder2D]s as the occluders leave the viewport, increase this setting.
The percentage specified is added on each axis and on both sides. For example, with the default setting of 120%, the signed distance field will cover 20% of the viewport's size outside the viewport on each side (top, right, bottom, left).
@@ -2346,27 +2397,30 @@
[b]Note:[/b] It is not recommended to use this setting together with [member rendering/2d/snap/snap_2d_transforms_to_pixel], as movement may appear even less smooth. Prefer only enabling that setting instead.
</member>
<member name="rendering/anti_aliasing/quality/msaa_2d" type="int" setter="" getter="" default="0">
- Sets the number of MSAA samples to use for 2D/Canvas rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware, especially integrated graphics due to their limited memory bandwidth. This has no effect on shader-induced aliasing or texture aliasing.
+ Sets the number of multisample antialiasing (MSAA) samples to use for 2D/Canvas rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware, especially integrated graphics due to their limited memory bandwidth. This has no effect on shader-induced aliasing or texture aliasing.
[b]Note:[/b] MSAA is only supported in the Forward+ and Mobile rendering methods, not Compatibility.
+ [b]Note:[/b] This property is only read when the project starts. To set the number of 2D MSAA samples at runtime, set [member Viewport.msaa_2d] or use [method RenderingServer.viewport_set_msaa_2d].
</member>
<member name="rendering/anti_aliasing/quality/msaa_3d" type="int" setter="" getter="" default="0">
- Sets the number of MSAA samples to use for 3D rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware, especially integrated graphics due to their limited memory bandwidth. See also [member rendering/scaling_3d/mode] for supersampling, which provides higher quality but is much more expensive. This has no effect on shader-induced aliasing or texture aliasing.
- [b]Note:[/b] MSAA is only supported in the Forward+ and Mobile rendering methods, not Compatibility.
+ Sets the number of multisample antialiasing (MSAA) samples to use for 3D rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware, especially integrated graphics due to their limited memory bandwidth. See also [member rendering/scaling_3d/mode] for supersampling, which provides higher quality but is much more expensive. This has no effect on shader-induced aliasing or texture aliasing.
+ [b]Note:[/b] This property is only read when the project starts. To set the number of 3D MSAA samples at runtime, set [member Viewport.msaa_3d] or use [method RenderingServer.viewport_set_msaa_3d].
</member>
<member name="rendering/anti_aliasing/quality/screen_space_aa" type="int" setter="" getter="" default="0">
Sets the screen-space antialiasing mode for the default screen [Viewport]. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry. The blurriness is partially counteracted by automatically using a negative mipmap LOD bias (see [member rendering/textures/default_filters/texture_mipmap_bias]).
Another way to combat specular aliasing is to enable [member rendering/anti_aliasing/screen_space_roughness_limiter/enabled].
[b]Note:[/b] Screen-space antialiasing is only supported in the Forward+ and Mobile rendering methods, not Compatibility.
+ [b]Note:[/b] This property is only read when the project starts. To set the screen-space antialiasing mode at runtime, set [member Viewport.screen_space_aa] on the root [Viewport] instead, or use [method RenderingServer.viewport_set_screen_space_aa].
</member>
<member name="rendering/anti_aliasing/quality/use_debanding" type="bool" setter="" getter="" default="false">
If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible in 3D. 2D rendering is [i]not[/i] affected by debanding unless the [member Environment.background_mode] is [constant Environment.BG_CANVAS].
In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
- [b]Note:[/b] This property is only read when the project starts. To set debanding at run-time, set [member Viewport.use_debanding] on the root [Viewport] instead.
+ [b]Note:[/b] This property is only read when the project starts. To set debanding at runtime, set [member Viewport.use_debanding] on the root [Viewport] instead, or use [method RenderingServer.viewport_set_use_debanding].
</member>
<member name="rendering/anti_aliasing/quality/use_taa" type="bool" setter="" getter="" default="false">
- Enables Temporal Anti-Aliasing for the default screen [Viewport]. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion. Enabling TAA can make the image blurrier, which is partially counteracted by automatically using a negative mipmap LOD bias (see [member rendering/textures/default_filters/texture_mipmap_bias]).
+ Enables temporal antialiasing for the default screen [Viewport]. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion. Enabling TAA can make the image blurrier, which is partially counteracted by automatically using a negative mipmap LOD bias (see [member rendering/textures/default_filters/texture_mipmap_bias]).
[b]Note:[/b] The implementation is not complete yet. Some visual instances such as particles and skinned meshes may show ghosting artifacts in motion.
[b]Note:[/b] TAA is only supported in the Forward+ rendering method, not Mobile or Compatibility.
+ [b]Note:[/b] This property is only read when the project starts. To set TAA at runtime, set [member Viewport.use_taa] on the root [Viewport] instead, or use [method RenderingServer.viewport_set_use_taa].
</member>
<member name="rendering/anti_aliasing/screen_space_roughness_limiter/amount" type="float" setter="" getter="" default="0.25">
[b]Note:[/b] This property is only read when the project starts. To control the screen-space roughness limiter at runtime, call [method RenderingServer.screen_space_roughness_limiter_set_active] instead.
@@ -2420,10 +2474,10 @@
Number of blur passes to use when computing screen-space ambient occlusion. A higher number will result in a smoother look, but will be slower to compute and will have less high-frequency detail.
</member>
<member name="rendering/environment/ssao/fadeout_from" type="float" setter="" getter="" default="50.0">
- Distance at which the screen-space ambient occlusion effect starts to fade out. Use this hide ambient occlusion at great distances.
+ Distance at which the screen-space ambient occlusion effect starts to fade out. Use this hide ambient occlusion from far away.
</member>
<member name="rendering/environment/ssao/fadeout_to" type="float" setter="" getter="" default="300.0">
- Distance at which the screen-space ambient occlusion is fully faded out. Use this hide ambient occlusion at great distances.
+ Distance at which the screen-space ambient occlusion is fully faded out. Use this hide ambient occlusion from far away.
</member>
<member name="rendering/environment/ssao/half_size" type="bool" setter="" getter="" default="true">
If [code]true[/code], screen-space ambient occlusion will be rendered at half size and then upscaled before being added to the scene. This is significantly faster but may miss small details. If [code]false[/code], screen-space ambient occlusion will be rendered at full size.
@@ -2438,10 +2492,10 @@
Number of blur passes to use when computing screen-space indirect lighting. A higher number will result in a smoother look, but will be slower to compute and will have less high-frequency detail.
</member>
<member name="rendering/environment/ssil/fadeout_from" type="float" setter="" getter="" default="50.0">
- Distance at which the screen-space indirect lighting effect starts to fade out. Use this hide screen-space indirect lighting at great distances.
+ Distance at which the screen-space indirect lighting effect starts to fade out. Use this to hide screen-space indirect lighting from far away.
</member>
<member name="rendering/environment/ssil/fadeout_to" type="float" setter="" getter="" default="300.0">
- Distance at which the screen-space indirect lighting is fully faded out. Use this hide screen-space indirect lighting at great distances.
+ Distance at which the screen-space indirect lighting is fully faded out. Use this to hide screen-space indirect lighting from far away.
</member>
<member name="rendering/environment/ssil/half_size" type="bool" setter="" getter="" default="true">
If [code]true[/code], screen-space indirect lighting will be rendered at half size and then upscaled before being added to the scene. This is significantly faster but may miss small details and may result in some objects appearing to glow at their edges.
@@ -2500,8 +2554,8 @@
[b]Note:[/b] This setting is implemented only on Linux/X11.
</member>
<member name="rendering/gl_compatibility/fallback_to_native" type="bool" setter="" getter="" default="true">
- If [code]true[/code], the compatibility renderer will fall back to native OpenGL if ANGLE over Metal is not supported.
- [b]Note:[/b] This setting is implemented only on macOS.
+ If [code]true[/code], the compatibility renderer will fall back to native OpenGL if ANGLE is not supported, or ANGLE dynamic libraries aren't found.
+ [b]Note:[/b] This setting is implemented on macOS and Windows.
</member>
<member name="rendering/gl_compatibility/force_angle_on_devices" type="Array" setter="" getter="">
An [Array] of devices which should always use the ANGLE renderer.
@@ -2578,6 +2632,10 @@
- Intel GPUs: SYCL libraries
If no GPU acceleration is configured on the system, multi-threaded CPU-based denoising will be performed instead. This CPU-based denoising is significantly slower than the JNLM denoiser in most cases.
</member>
+ <member name="rendering/lightmapping/lightmap_gi/use_bicubic_filter" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], applies a bicubic filter during lightmap sampling. This makes lightmaps look much smoother, at a moderate performance cost.
+ [b]Note:[/b] The bicubic filter exaggerates the 'bleeding' effect that occurs when a lightmap's resolution is low enough.
+ </member>
<member name="rendering/lightmapping/primitive_meshes/texel_size" type="float" setter="" getter="" default="0.2">
The texel_size that is used to calculate the [member Mesh.lightmap_size_hint] on [PrimitiveMesh] resources if [member PrimitiveMesh.add_uv2] is enabled.
</member>
@@ -2664,6 +2722,8 @@
<member name="rendering/limits/spatial_indexer/update_iterations_per_frame" type="int" setter="" getter="" default="10">
</member>
<member name="rendering/limits/time/time_rollover_secs" type="float" setter="" getter="" default="3600">
+ Maximum time (in seconds) before the [code]TIME[/code] shader built-in variable rolls over. The [code]TIME[/code] variable increments by [code]delta[/code] each frame, and when it exceeds this value, it rolls over to [code]0.0[/code]. Since large floating-point values are less precise than small floating-point values, this should be set as low as possible to maximize the precision of the [code]TIME[/code] built-in variable in shaders. This is especially important on mobile platforms where precision in shaders is significantly reduced. However, if this is set too low, shader animations may appear to restart from the beginning while the project is running.
+ On desktop platforms, values below [code]4096[/code] are recommended, ideally below [code]2048[/code]. On mobile platforms, values below [code]64[/code] are recommended, ideally below [code]32[/code].
</member>
<member name="rendering/mesh_lod/lod_change/threshold_pixels" type="float" setter="" getter="" default="1.0">
The automatic LOD bias to use for meshes rendered within the [ReflectionProbe]. Higher values will use less detailed versions of meshes that have LOD variations generated. If set to [code]0.0[/code], automatic LOD is disabled. Increase [member rendering/mesh_lod/lod_change/threshold_pixels] to improve performance at the cost of geometry detail.
@@ -2718,6 +2778,8 @@
[b]Forward Plus[/b]: High-end renderer designed for Desktop devices. Has a higher base overhead, but scales well with complex scenes. Not suitable for older devices or mobile.
[b]Mobile[/b]: Modern renderer designed for mobile devices. Has a lower base overhead than Forward Plus, but does not scale as well to large scenes with many elements.
[b]GL Compatibility[/b]: Low-end renderer designed for older devices. Based on the limitations of the OpenGL 3.3/ OpenGL ES 3.0 / WebGL 2 APIs.
+ This can be overridden using the [code]--rendering-method &lt;method&gt;[/code] command line argument.
+ [b]Note:[/b] The actual rendering method may be automatically changed by the engine as a result of a fallback, or a user-specified command line argument. To get the actual rendering method that is used at runtime, use [method RenderingServer.get_current_rendering_method] instead of reading this project setting's value.
</member>
<member name="rendering/renderer/rendering_method.mobile" type="String" setter="" getter="" default="&quot;mobile&quot;">
Override for [member rendering/renderer/rendering_method] on mobile devices.
@@ -2741,7 +2803,8 @@
Depending on the complexity of scenes, this value may be lowered or may need to be raised.
</member>
<member name="rendering/rendering_device/driver" type="String" setter="" getter="">
- Sets the driver to be used by the renderer when using a RenderingDevice-based renderer like the clustered renderer or the mobile renderer. This property can not be edited directly, instead, set the driver using the platform-specific overrides.
+ Sets the driver to be used by the renderer when using a RenderingDevice-based renderer like the clustered renderer or the mobile renderer. This property can't be edited directly. Instead, set the driver using the platform-specific overrides. This can be overridden using the [code]--rendering-driver &lt;driver&gt;[/code] command line argument.
+ [b]Note:[/b] The actual rendering driver may be automatically changed by the engine as a result of a fallback, or a user-specified command line argument. To get the actual rendering driver that is used at runtime, use [method RenderingServer.get_current_rendering_driver_name] instead of reading this project setting's value.
</member>
<member name="rendering/rendering_device/driver.android" type="String" setter="" getter="">
Android override for [member rendering/rendering_device/driver].
@@ -2758,6 +2821,18 @@
<member name="rendering/rendering_device/driver.windows" type="String" setter="" getter="">
Windows override for [member rendering/rendering_device/driver].
</member>
+ <member name="rendering/rendering_device/fallback_to_d3d12" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], the forward renderer will fall back to Direct3D 12 if Vulkan is not supported.
+ [b]Note:[/b] This setting is implemented only on Windows.
+ </member>
+ <member name="rendering/rendering_device/fallback_to_opengl3" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], the forward renderer will fall back to OpenGL 3 if both Direct3D 12, Metal and Vulkan are not supported.
+ [b]Note:[/b] This setting is implemented only on Windows, Android, macOS, iOS, and Linux/X11.
+ </member>
+ <member name="rendering/rendering_device/fallback_to_vulkan" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], the forward renderer will fall back to Vulkan if Direct3D 12 is not supported.
+ [b]Note:[/b] This setting is implemented only on Windows.
+ </member>
<member name="rendering/rendering_device/pipeline_cache/enable" type="bool" setter="" getter="" default="true">
Enable the pipeline cache that is saved to disk if the graphics API supports it.
[b]Note:[/b] This property is unable to control the pipeline caching the GPU driver itself does. Only turn this off along with deleting the contents of the driver's cache if you wish to simulate the experience a user will get when starting the game for the first time.
@@ -2816,18 +2891,13 @@
</member>
<member name="rendering/shading/overrides/force_vertex_shading" type="bool" setter="" getter="" default="false">
If [code]true[/code], forces vertex shading for all rendering. This can increase performance a lot, but also reduces quality immensely. Can be used to optimize performance on low-end mobile devices.
- [b]Note:[/b] This setting currently has no effect, as vertex shading is not implemented yet.
- </member>
- <member name="rendering/shading/overrides/force_vertex_shading.mobile" type="bool" setter="" getter="" default="true">
- Lower-end override for [member rendering/shading/overrides/force_vertex_shading] on mobile devices, due to performance concerns or driver support.
- [b]Note:[/b] This setting currently has no effect, as vertex shading is not implemented yet.
</member>
<member name="rendering/textures/canvas_textures/default_texture_filter" type="int" setter="" getter="" default="1">
- The default texture filtering mode to use on [CanvasItem]s.
+ The default texture filtering mode to use for [CanvasItem]s built-in texture. In shaders, this texture is accessed as [code]TEXTURE[/code].
[b]Note:[/b] For pixel art aesthetics, see also [member rendering/2d/snap/snap_2d_vertices_to_pixel] and [member rendering/2d/snap/snap_2d_transforms_to_pixel].
</member>
<member name="rendering/textures/canvas_textures/default_texture_repeat" type="int" setter="" getter="" default="0">
- The default texture repeating mode to use on [CanvasItem]s.
+ The default texture repeating mode to use for [CanvasItem]s built-in texture. In shaders, this texture is accessed as [code]TEXTURE[/code].
</member>
<member name="rendering/textures/decals/filter" type="int" setter="" getter="" default="3">
The filtering quality to use for [Decal] nodes. When using one of the anisotropic filtering modes, the anisotropic filtering level is controlled by [member rendering/textures/default_filters/anisotropic_filtering_level].
@@ -2853,6 +2923,14 @@
<member name="rendering/textures/lossless_compression/force_png" type="bool" setter="" getter="" default="false">
If [code]true[/code], the texture importer will import lossless textures using the PNG format. Otherwise, it will default to using WebP.
</member>
+ <member name="rendering/textures/vram_compression/cache_gpu_compressor" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], the GPU texture compressor will cache the local RenderingDevice and its resources (shaders and pipelines), allowing for faster subsequent imports at a memory cost.
+ </member>
+ <member name="rendering/textures/vram_compression/compress_with_gpu" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], the texture importer will utilize the GPU for compressing textures, improving the import time of large images.
+ [b]Note:[/b] This only functions on a device which supports either Vulkan, D3D12, or Metal available as a rendering backend.
+ [b]Note:[/b] Currently this only affects certain compressed formats (BC1, BC4, and BC6), all of which are exclusive to desktop platforms and consoles.
+ </member>
<member name="rendering/textures/vram_compression/import_etc2_astc" type="bool" setter="" getter="" default="false">
If [code]true[/code], the texture importer will import VRAM-compressed textures using the Ericsson Texture Compression 2 algorithm for lower quality textures and normal maps and Adaptable Scalable Texture Compression algorithm for high quality textures (in 4×4 block size).
[b]Note:[/b] This setting is an override. The texture importer will always import the format the host platform needs, even if this is set to [code]false[/code].
@@ -2870,7 +2948,9 @@
The default compression factor for lossless WebP. Decompression speed is mostly unaffected by the compression factor. Supported values are 0 to 100.
</member>
<member name="rendering/viewport/hdr_2d" type="bool" setter="" getter="" default="false">
- If [code]true[/code], enables [member Viewport.use_hdr_2d] on the root viewport. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow).
+ If [code]true[/code], enables [member Viewport.use_hdr_2d] on the root viewport. 2D rendering will use an high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ renderer this will be an [code]RGBA16[/code] framebuffer, while when using the Mobile renderer it will be an [code]RGB10_A2[/code] framebuffer. Additionally, 2D rendering will take place in linear color space and will be converted to sRGB space immediately before blitting to the screen. Practically speaking, this means that the end result of the Viewport will not be clamped into the [code]0-1[/code] range and can be used in 3D rendering without color space adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients.
+ [b]Note:[/b] This setting will have no effect when using the GL Compatibility renderer as the GL Compatibility renderer always renders in low dynamic range for performance reasons.
+ [b]Note:[/b] This property is only read when the project starts. To toggle HDR 2D at runtime, set [member Viewport.use_hdr_2d] on the root [Viewport].
</member>
<member name="rendering/viewport/transparent_background" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables [member Viewport.transparent_bg] on the root viewport. This allows per-pixel transparency to be effective after also enabling [member display/window/size/transparent] and [member display/window/per_pixel_transparency/allowed].
@@ -2909,25 +2989,40 @@
<member name="xr/openxr/environment_blend_mode" type="int" setter="" getter="" default="&quot;0&quot;">
Specify how OpenXR should blend in the environment. This is specific to certain AR and passthrough devices where camera images are blended in by the XR compositor.
</member>
+ <member name="xr/openxr/extensions/debug_message_types" type="int" setter="" getter="" default="&quot;15&quot;">
+ Specifies the message types for which we request debug messages. Requires [member xr/openxr/extensions/debug_utils] to be set and the extension to be supported by the XR runtime.
+ </member>
+ <member name="xr/openxr/extensions/debug_utils" type="int" setter="" getter="" default="&quot;0&quot;">
+ Enables debug utilities on XR runtimes that supports the debug utils extension. Sets the maximum severity being reported (0 = disabled, 1 = error, 2 = warning, 3 = info, 4 = verbose).
+ </member>
<member name="xr/openxr/extensions/eye_gaze_interaction" type="bool" setter="" getter="" default="false">
Specify whether to enable eye tracking for this project. Depending on the platform, additional export configuration may be needed.
</member>
<member name="xr/openxr/extensions/hand_interaction_profile" type="bool" setter="" getter="" default="false">
- If true the hand interaction profile extension will be activated if supported by the platform.
+ If [code]true[/code] the hand interaction profile extension will be activated if supported by the platform.
+ </member>
+ <member name="xr/openxr/extensions/hand_tracking" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], the hand tracking extension is enabled if available.
+ [b]Note:[/b] By default hand tracking will only work for data sources chosen by the XR runtime. For SteamVR this is the controller inferred data source, for most other runtimes this is the unobstructed data source. There is no way to query this. If a runtime supports the OpenXR data source extension you can use the [member xr/openxr/extensions/hand_tracking_controller_data_source] and/or [member xr/openxr/extensions/hand_tracking_unobstructed_data_source] to indicate you wish to enable these data sources. If neither is selected the data source extension is not enabled and the XR runtimes default behavior persists.
+ </member>
+ <member name="xr/openxr/extensions/hand_tracking_controller_data_source" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], support for the controller inferred data source is requested. If supported, you will receive hand tracking data even if the user has a controller in hand, with finger positions automatically inferred from controller input and/or sensors.
+ [b]Node:[/b] This requires the OpenXR data source extension and controller inferred handtracking to be supported by the XR runtime. If not supported this setting will be ignored. [member xr/openxr/extensions/hand_tracking] must be enabled for this setting to be used.
</member>
- <member name="xr/openxr/extensions/hand_tracking" type="bool" setter="" getter="" default="true">
- If true we enable the hand tracking extension if available.
+ <member name="xr/openxr/extensions/hand_tracking_unobstructed_data_source" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], support for the unobstructed data source is requested. If supported, you will receive hand tracking data based on the actual finger positions of the user often determined by optical tracking.
+ [b]Node:[/b] This requires the OpenXR data source extension and unobstructed handtracking to be supported by the XR runtime. If not supported this setting will be ignored. [member xr/openxr/extensions/hand_tracking] must be enabled for this setting to be used.
</member>
<member name="xr/openxr/form_factor" type="int" setter="" getter="" default="&quot;0&quot;">
Specify whether OpenXR should be configured for an HMD or a hand held device.
</member>
<member name="xr/openxr/foveation_dynamic" type="bool" setter="" getter="" default="false">
- If true and foveation is supported, will automatically adjust foveation level based on framerate up to the level set on [member xr/openxr/foveation_level].
- [b]Note:[/b] Only works on compatibility renderer.
+ If [code]true[/code] and foveation is supported, will automatically adjust foveation level based on framerate up to the level set on [member xr/openxr/foveation_level].
+ [b]Note:[/b] Only works on the Compatibility rendering method.
</member>
<member name="xr/openxr/foveation_level" type="int" setter="" getter="" default="&quot;0&quot;">
Applied foveation level if supported: 0 = off, 1 = low, 2 = medium, 3 = high.
- [b]Note:[/b] Only works on compatibility renderer.
+ [b]Note:[/b] Only works on the Compatibility rendering method. On platforms other than Android, if [member rendering/anti_aliasing/quality/msaa_3d] is enabled, this feature will be disabled.
</member>
<member name="xr/openxr/reference_space" type="int" setter="" getter="" default="&quot;1&quot;">
Specify the default reference space.
diff --git a/doc/classes/Projection.xml b/doc/classes/Projection.xml
index 1665660da3..f781083abf 100644
--- a/doc/classes/Projection.xml
+++ b/doc/classes/Projection.xml
@@ -14,7 +14,8 @@
<constructor name="Projection">
<return type="Projection" />
<description>
- Constructs a default-initialized [Projection] set to [constant IDENTITY].
+ Constructs a default-initialized [Projection] identical to [constant IDENTITY].
+ [b]Note:[/b] In C#, this constructs a [Projection] identical to [constant ZERO].
</description>
</constructor>
<constructor name="Projection">
diff --git a/doc/classes/PropertyTweener.xml b/doc/classes/PropertyTweener.xml
index d3875ddfc2..76cf4cbfeb 100644
--- a/doc/classes/PropertyTweener.xml
+++ b/doc/classes/PropertyTweener.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
[PropertyTweener] is used to interpolate a property in an object. See [method Tween.tween_property] for more usage information.
+ The tweener will finish automatically if the target object is freed.
[b]Note:[/b] [method Tween.tween_property] is the only correct way to create [PropertyTweener]. Any [PropertyTweener] created manually will not function correctly.
</description>
<tutorials>
@@ -14,10 +15,10 @@
<return type="PropertyTweener" />
<description>
When called, the final value will be used as a relative value instead.
- [b]Example:[/b]
+ [b]Example:[/b] Move the node by [code]100[/code] pixels to the right.
[codeblock]
var tween = get_tree().create_tween()
- tween.tween_property(self, "position", Vector2.RIGHT * 100, 1).as_relative() #the node will move by 100 pixels to the right
+ tween.tween_property(self, "position", Vector2.RIGHT * 100, 1).as_relative()
[/codeblock]
</description>
</method>
@@ -26,10 +27,10 @@
<param index="0" name="value" type="Variant" />
<description>
Sets a custom initial value to the [PropertyTweener].
- [b]Example:[/b]
+ [b]Example:[/b] Move the node from position [code](100, 100)[/code] to [code](200, 100)[/code].
[codeblock]
var tween = get_tree().create_tween()
- tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100)) #this will move the node from position (100, 100) to (200, 100)
+ tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100))
[/codeblock]
</description>
</method>
@@ -48,7 +49,6 @@
<param index="0" name="interpolator_method" type="Callable" />
<description>
Allows interpolating the value with a custom easing function. The provided [param interpolator_method] will be called with a value ranging from [code]0.0[/code] to [code]1.0[/code] and is expected to return a value within the same range (values outside the range can be used for overshoot). The return value of the method is then used for interpolation between initial and final value. Note that the parameter passed to the method is still subject to the tweener's own easing.
- [b]Example:[/b]
[codeblock]
@export var curve: Curve
diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml
index 665c6335f2..c74a6453e0 100644
--- a/doc/classes/Quaternion.xml
+++ b/doc/classes/Quaternion.xml
@@ -22,6 +22,7 @@
<return type="Quaternion" />
<description>
Constructs a [Quaternion] identical to the [constant IDENTITY].
+ [b]Note:[/b] In C#, this constructs a [Quaternion] with all of its components set to [code]0.0[/code].
</description>
</constructor>
<constructor name="Quaternion">
diff --git a/doc/classes/RDPipelineDepthStencilState.xml b/doc/classes/RDPipelineDepthStencilState.xml
index b8245f97af..425890bb8d 100644
--- a/doc/classes/RDPipelineDepthStencilState.xml
+++ b/doc/classes/RDPipelineDepthStencilState.xml
@@ -19,7 +19,7 @@
The operation to perform on the stencil buffer for back pixels that pass the stencil test but fail the depth test.
</member>
<member name="back_op_fail" type="int" setter="set_back_op_fail" getter="get_back_op_fail" enum="RenderingDevice.StencilOperation" default="1">
- The operation to perform on the stencil buffer for back pixels that fail the stencil test
+ The operation to perform on the stencil buffer for back pixels that fail the stencil test.
</member>
<member name="back_op_pass" type="int" setter="set_back_op_pass" getter="get_back_op_pass" enum="RenderingDevice.StencilOperation" default="1">
The operation to perform on the stencil buffer for back pixels that pass the stencil test.
@@ -34,10 +34,10 @@
The method used for comparing the previous and current depth values.
</member>
<member name="depth_range_max" type="float" setter="set_depth_range_max" getter="get_depth_range_max" default="0.0">
- The maximum depth that returns true for [member enable_depth_range].
+ The maximum depth that returns [code]true[/code] for [member enable_depth_range].
</member>
<member name="depth_range_min" type="float" setter="set_depth_range_min" getter="get_depth_range_min" default="0.0">
- The minimum depth that returns true for [member enable_depth_range].
+ The minimum depth that returns [code]true[/code] for [member enable_depth_range].
</member>
<member name="enable_depth_range" type="bool" setter="set_enable_depth_range" getter="get_enable_depth_range" default="false">
If [code]true[/code], each depth value will be tested to see if it is between [member depth_range_min] and [member depth_range_max]. If it is outside of these values, it is discarded.
@@ -46,7 +46,7 @@
If [code]true[/code], enables depth testing which allows objects to be automatically occluded by other objects based on their depth. This also allows objects to be partially occluded by other objects. If [code]false[/code], objects will appear in the order they were drawn (like in Godot's 2D renderer).
</member>
<member name="enable_depth_write" type="bool" setter="set_enable_depth_write" getter="get_enable_depth_write" default="false">
- If [code]true[/code], writes to the depth buffer whenever the depth test returns true. Only works when enable_depth_test is also true.
+ If [code]true[/code], writes to the depth buffer whenever the depth test returns [code]true[/code]. Only works when enable_depth_test is also [code]true[/code].
</member>
<member name="enable_stencil" type="bool" setter="set_enable_stencil" getter="get_enable_stencil" default="false">
If [code]true[/code], enables stencil testing. There are separate stencil buffers for front-facing triangles and back-facing triangles. See properties that begin with "front_op" and properties with "back_op" for each.
diff --git a/doc/classes/RDShaderSource.xml b/doc/classes/RDShaderSource.xml
index 062c22f11f..a7b897d56e 100644
--- a/doc/classes/RDShaderSource.xml
+++ b/doc/classes/RDShaderSource.xml
@@ -23,6 +23,7 @@
<param index="1" name="source" type="String" />
<description>
Sets [param source] code for the specified shader [param stage]. Equivalent to setting one of [member source_compute], [member source_fragment], [member source_tesselation_control], [member source_tesselation_evaluation] or [member source_vertex].
+ [b]Note:[/b] If you set the compute shader source code using this method directly, remember to remove the Godot-specific hint [code]#[compute][/code].
</description>
</method>
</methods>
diff --git a/doc/classes/RDTextureFormat.xml b/doc/classes/RDTextureFormat.xml
index f8de7feda0..ac875ab7c1 100644
--- a/doc/classes/RDTextureFormat.xml
+++ b/doc/classes/RDTextureFormat.xml
@@ -13,12 +13,14 @@
<return type="void" />
<param index="0" name="format" type="int" enum="RenderingDevice.DataFormat" />
<description>
+ Adds [param format] as a valid format for the corresponding [RDTextureView]'s [member RDTextureView.format_override] property. If any format is added as shareable, then the main [member format] must also be added.
</description>
</method>
<method name="remove_shareable_format">
<return type="void" />
<param index="0" name="format" type="int" enum="RenderingDevice.DataFormat" />
<description>
+ Removes [param format] from the list of valid formats that the corresponding [RDTextureView]'s [member RDTextureView.format_override] property can be set to.
</description>
</method>
</methods>
diff --git a/doc/classes/RDTextureView.xml b/doc/classes/RDTextureView.xml
index 30b6bfedf5..bd8102d553 100644
--- a/doc/classes/RDTextureView.xml
+++ b/doc/classes/RDTextureView.xml
@@ -10,7 +10,7 @@
</tutorials>
<members>
<member name="format_override" type="int" setter="set_format_override" getter="get_format_override" enum="RenderingDevice.DataFormat" default="218">
- Optional override for the data format to return sampled values in. The default value of [constant RenderingDevice.DATA_FORMAT_MAX] does not override the format.
+ Optional override for the data format to return sampled values in. The corresponding [RDTextureFormat] must have had this added as a shareable format. The default value of [constant RenderingDevice.DATA_FORMAT_MAX] does not override the format.
</member>
<member name="swizzle_a" type="int" setter="set_swizzle_a" getter="get_swizzle_a" enum="RenderingDevice.TextureSwizzle" default="6">
The channel to sample when sampling the alpha channel.
diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml
index ba7dcab2d7..f2c0b017bc 100644
--- a/doc/classes/Rect2.xml
+++ b/doc/classes/Rect2.xml
@@ -112,6 +112,13 @@
Returns the center point of the rectangle. This is the same as [code]position + (size / 2.0)[/code].
</description>
</method>
+ <method name="get_support" qualifiers="const">
+ <return type="Vector2" />
+ <param index="0" name="direction" type="Vector2" />
+ <description>
+ Returns the vertex's position of this rect that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms.
+ </description>
+ </method>
<method name="grow" qualifiers="const">
<return type="Rect2" />
<param index="0" name="amount" type="float" />
diff --git a/doc/classes/RenderData.xml b/doc/classes/RenderData.xml
index 065505e6c6..c2a598c43f 100644
--- a/doc/classes/RenderData.xml
+++ b/doc/classes/RenderData.xml
@@ -19,7 +19,7 @@
<method name="get_environment" qualifiers="const">
<return type="RID" />
<description>
- Returns the [RID] of the environments object in the [RenderingServer] being used to render this viewport.
+ Returns the [RID] of the environment object in the [RenderingServer] being used to render this viewport.
</description>
</method>
<method name="get_render_scene_buffers" qualifiers="const">
diff --git a/doc/classes/RenderDataExtension.xml b/doc/classes/RenderDataExtension.xml
index 9bdab8e101..5c2b75ed1b 100644
--- a/doc/classes/RenderDataExtension.xml
+++ b/doc/classes/RenderDataExtension.xml
@@ -12,24 +12,25 @@
<method name="_get_camera_attributes" qualifiers="virtual const">
<return type="RID" />
<description>
- Implement this in GDExtension to return the [RID] for the implementations camera attributes object.
+ Implement this in GDExtension to return the [RID] for the implementation's camera attributes object.
</description>
</method>
<method name="_get_environment" qualifiers="virtual const">
<return type="RID" />
<description>
+ Implement this in GDExtension to return the [RID] of the implementation's environment object.
</description>
</method>
<method name="_get_render_scene_buffers" qualifiers="virtual const">
<return type="RenderSceneBuffers" />
<description>
- Implement this in GDExtension to return the [RID] of the implementations environment object.
+ Implement this in GDExtension to return the implementation's [RenderSceneBuffers] object.
</description>
</method>
<method name="_get_render_scene_data" qualifiers="virtual const">
<return type="RenderSceneData" />
<description>
- Implement this in GDExtension to return the implementations [RenderSceneDataExtension] object.
+ Implement this in GDExtension to return the implementation's [RenderSceneDataExtension] object.
</description>
</method>
</methods>
diff --git a/doc/classes/RenderSceneBuffersRD.xml b/doc/classes/RenderSceneBuffersRD.xml
index 359f0b33a8..6a5aba1dbc 100644
--- a/doc/classes/RenderSceneBuffersRD.xml
+++ b/doc/classes/RenderSceneBuffersRD.xml
@@ -52,7 +52,7 @@
<param index="2" name="view_name" type="StringName" />
<param index="3" name="view" type="RDTextureView" />
<description>
- Create a new texture view for an existing texture and cache this under the given view_name. Will return the existing teture view if it already exists. Will error if the source texture doesn't exist.
+ Create a new texture view for an existing texture and cache this under the given [param view_name]. Will return the existing texture view if it already exists. Will error if the source texture doesn't exist.
</description>
</method>
<method name="get_color_layer">
@@ -61,7 +61,7 @@
<param index="1" name="msaa" type="bool" default="false" />
<description>
Returns the specified layer from the color texture we are rendering 3D content to.
- If [param msaa] is [b]true[/b] and MSAA is enabled, this returns the MSAA variant of the buffer.
+ If [param msaa] is [code]true[/code] and MSAA is enabled, this returns the MSAA variant of the buffer.
</description>
</method>
<method name="get_color_texture">
@@ -69,7 +69,7 @@
<param index="0" name="msaa" type="bool" default="false" />
<description>
Returns the color texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.
- If [param msaa] is [b]true[/b] and MSAA is enabled, this returns the MSAA variant of the buffer.
+ If [param msaa] is [code]true[/code] and MSAA is enabled, this returns the MSAA variant of the buffer.
</description>
</method>
<method name="get_depth_layer">
@@ -78,7 +78,7 @@
<param index="1" name="msaa" type="bool" default="false" />
<description>
Returns the specified layer from the depth texture we are rendering 3D content to.
- If [param msaa] is [b]true[/b] and MSAA is enabled, this returns the MSAA variant of the buffer.
+ If [param msaa] is [code]true[/code] and MSAA is enabled, this returns the MSAA variant of the buffer.
</description>
</method>
<method name="get_depth_texture">
@@ -86,7 +86,13 @@
<param index="0" name="msaa" type="bool" default="false" />
<description>
Returns the depth texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.
- If [param msaa] is [b]true[/b] and MSAA is enabled, this returns the MSAA variant of the buffer.
+ If [param msaa] is [code]true[/code] and MSAA is enabled, this returns the MSAA variant of the buffer.
+ </description>
+ </method>
+ <method name="get_fsr_sharpness" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns the FSR sharpness value used while rendering the 3D content (if [method get_scaling_3d_mode] is an FSR mode).
</description>
</method>
<method name="get_internal_size" qualifiers="const">
@@ -107,6 +113,24 @@
Returns the render target associated with this buffers object.
</description>
</method>
+ <method name="get_scaling_3d_mode" qualifiers="const">
+ <return type="int" enum="RenderingServer.ViewportScaling3DMode" />
+ <description>
+ Returns the scaling mode used for upscaling.
+ </description>
+ </method>
+ <method name="get_screen_space_aa" qualifiers="const">
+ <return type="int" enum="RenderingServer.ViewportScreenSpaceAA" />
+ <description>
+ Returns the screen-space antialiasing method applied.
+ </description>
+ </method>
+ <method name="get_target_size" qualifiers="const">
+ <return type="Vector2i" />
+ <description>
+ Returns the target size of the render buffer (size after upscaling).
+ </description>
+ </method>
<method name="get_texture" qualifiers="const">
<return type="RID" />
<param index="0" name="context" type="StringName" />
@@ -123,6 +147,12 @@
Returns the texture format information with which a cached texture was created.
</description>
</method>
+ <method name="get_texture_samples" qualifiers="const">
+ <return type="int" enum="RenderingDevice.TextureSamples" />
+ <description>
+ Returns the number of MSAA samples used.
+ </description>
+ </method>
<method name="get_texture_slice">
<return type="RID" />
<param index="0" name="context" type="StringName" />
@@ -157,6 +187,12 @@
Returns a specific view of a slice (layer or mipmap) for a cached texture.
</description>
</method>
+ <method name="get_use_debanding" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if debanding is enabled.
+ </description>
+ </method>
<method name="get_use_taa" qualifiers="const">
<return type="bool" />
<description>
diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml
index 3c1061dee9..fe23f79119 100644
--- a/doc/classes/RenderingDevice.xml
+++ b/doc/classes/RenderingDevice.xml
@@ -218,6 +218,7 @@
<param index="6" name="clear_depth" type="float" default="1.0" />
<param index="7" name="clear_stencil" type="int" default="0" />
<param index="8" name="region" type="Rect2" default="Rect2(0, 0, 0, 0)" />
+ <param index="9" name="breadcrumb" type="int" default="0" />
<description>
Starts a list of raster drawing commands created with the [code]draw_*[/code] methods. The returned value should be passed to other [code]draw_list_*[/code] functions.
Multiple draw lists cannot be created at the same time; you must finish the previous draw list first using [method draw_list_end].
@@ -225,7 +226,7 @@
[codeblock]
var rd = RenderingDevice.new()
var clear_colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0)])
- var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors)
+ var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors, RenderingDevice.OPAQUE_PASS)
# Draw opaque.
rd.draw_list_bind_render_pipeline(draw_list, raster_pipeline)
@@ -240,6 +241,11 @@
rd.draw_list_end()
[/codeblock]
+ The [param breadcrumb] parameter can be an arbitrary 32-bit integer that is useful to diagnose GPU crashes. If Godot is built in dev or debug mode; when the GPU crashes Godot will dump all shaders that were being executed at the time of the crash and the breadcrumb is useful to diagnose what passes did those shaders belong to.
+ It does not affect rendering behavior and can be set to 0. It is recommended to use [enum BreadcrumbMarker] enumerations for consistency but it's not required. It is also possible to use bitwise operations to add extra data. e.g.
+ [codeblock]
+ rd.draw_list_begin(fb[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors, RenderingDevice.OPAQUE_PASS | 5)
+ [/codeblock]
</description>
</method>
<method name="draw_list_begin_for_screen">
@@ -318,6 +324,18 @@
Submits [param draw_list] for rendering on the GPU. This is the raster equivalent to [method compute_list_dispatch].
</description>
</method>
+ <method name="draw_list_draw_indirect">
+ <return type="void" />
+ <param index="0" name="draw_list" type="int" />
+ <param index="1" name="use_indices" type="bool" />
+ <param index="2" name="buffer" type="RID" />
+ <param index="3" name="offset" type="int" default="0" />
+ <param index="4" name="draw_count" type="int" default="1" />
+ <param index="5" name="stride" type="int" default="0" />
+ <description>
+ Submits [param draw_list] for rendering on the GPU with the given parameters stored in the [param buffer] at [param offset]. Parameters being integers: vertex count, instance count, first vertex, first instance. And when using indices: index count, instance count, first index, vertex offset, first instance. Buffer must have been created with [constant STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT] flag.
+ </description>
+ </method>
<method name="draw_list_enable_scissor">
<return type="void" />
<param index="0" name="draw_list" type="int" />
@@ -487,6 +505,31 @@
Returns the index of the last frame rendered that has rendering timestamps available for querying.
</description>
</method>
+ <method name="get_device_allocation_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns how many allocations the GPU has performed for internal driver structures.
+ This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown.
+ </description>
+ </method>
+ <method name="get_device_allocs_by_object_type" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="type" type="int" />
+ <description>
+ Same as [method get_device_allocation_count] but filtered for a given object type.
+ The type argument must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0.
+ This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown.
+ </description>
+ </method>
+ <method name="get_device_memory_by_object_type" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="type" type="int" />
+ <description>
+ Same as [method get_device_total_memory] but filtered for a given object type.
+ The type argument must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0.
+ This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown.
+ </description>
+ </method>
<method name="get_device_name" qualifiers="const">
<return type="String" />
<description>
@@ -499,12 +542,61 @@
Returns the universally unique identifier for the pipeline cache. This is used to cache shader files on disk, which avoids shader recompilations on subsequent engine runs. This UUID varies depending on the graphics card model, but also the driver version. Therefore, updating graphics drivers will invalidate the shader cache.
</description>
</method>
+ <method name="get_device_total_memory" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns how much bytes the GPU is using.
+ This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown.
+ </description>
+ </method>
<method name="get_device_vendor_name" qualifiers="const">
<return type="String" />
<description>
Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). Equivalent to [method RenderingServer.get_video_adapter_vendor]. See also [method get_device_name].
</description>
</method>
+ <method name="get_driver_allocation_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns how many allocations the GPU driver has performed for internal driver structures.
+ This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown.
+ </description>
+ </method>
+ <method name="get_driver_allocs_by_object_type" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="type" type="int" />
+ <description>
+ Same as [method get_driver_allocation_count] but filtered for a given object type.
+ The type argument must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0.
+ This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown.
+ </description>
+ </method>
+ <method name="get_driver_and_device_memory_report" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns string report in CSV format using the following methods:
+ - [method get_tracked_object_name]
+ - [method get_tracked_object_type_count]
+ - [method get_driver_total_memory]
+ - [method get_driver_allocation_count]
+ - [method get_driver_memory_by_object_type]
+ - [method get_driver_allocs_by_object_type]
+ - [method get_device_total_memory]
+ - [method get_device_allocation_count]
+ - [method get_device_memory_by_object_type]
+ - [method get_device_allocs_by_object_type]
+ This is only used by Vulkan in debug builds. Godot must also be started with the [code]--extra-gpu-memory-tracking[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url].
+ </description>
+ </method>
+ <method name="get_driver_memory_by_object_type" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="type" type="int" />
+ <description>
+ Same as [method get_driver_total_memory] but filtered for a given object type.
+ The type argument must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0.
+ This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown.
+ </description>
+ </method>
<method name="get_driver_resource">
<return type="int" />
<param index="0" name="resource" type="int" enum="RenderingDevice.DriverResource" />
@@ -514,6 +606,13 @@
Returns the unique identifier of the driver [param resource] for the specified [param rid]. Some driver resource types ignore the specified [param rid] (see [enum DriverResource] descriptions). [param index] is always ignored but must be specified anyway.
</description>
</method>
+ <method name="get_driver_total_memory" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns how much bytes the GPU driver is using for internal driver structures.
+ This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown.
+ </description>
+ </method>
<method name="get_frame_delay" qualifiers="const">
<return type="int" />
<description>
@@ -527,6 +626,33 @@
Returns the memory usage in bytes corresponding to the given [param type]. When using Vulkan, these statistics are calculated by [url=https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator]Vulkan Memory Allocator[/url].
</description>
</method>
+ <method name="get_perf_report" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns a string with a performance report from the past frame. Updates every frame.
+ </description>
+ </method>
+ <method name="get_tracked_object_name" qualifiers="const">
+ <return type="String" />
+ <param index="0" name="type_index" type="int" />
+ <description>
+ Returns the name of the type of object for the given [param type_index]. This value must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns the same string.
+ The return value is important because it gives meaning to the types passed to [method get_driver_memory_by_object_type], [method get_driver_allocs_by_object_type], [method get_device_memory_by_object_type], and [method get_device_allocs_by_object_type]. Examples of strings it can return (not exhaustive):
+ - DEVICE_MEMORY
+ - PIPELINE_CACHE
+ - SWAPCHAIN_KHR
+ - COMMAND_POOL
+ Thus if e.g. [code]get_tracked_object_name(5)[/code] returns "COMMAND_POOL", then [code]get_device_memory_by_object_type(5)[/code] returns the bytes used by the GPU for command pools.
+ This is only used by Vulkan in debug builds. Godot must also be started with the [code]--extra-gpu-memory-tracking[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url].
+ </description>
+ </method>
+ <method name="get_tracked_object_type_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns how many types of trackable objects are.
+ This is only used by Vulkan in debug builds. Godot must also be started with the [code]--extra-gpu-memory-tracking[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url].
+ </description>
+ </method>
<method name="index_array_create">
<return type="RID" />
<param index="0" name="index_buffer" type="RID" />
@@ -791,7 +917,7 @@
<param index="4" name="mipmaps" type="int" default="1" />
<param index="5" name="slice_type" type="int" enum="RenderingDevice.TextureSliceType" default="0" />
<description>
- Creates a shared texture using the specified [param view] and the texture information from [param with_texture]'s [param layer] and [param mipmap]. The number of included mipmaps from the original texture can be controlled using the [param mipmaps] parameter. Only relevant for textures with multiple layers, such as 3D textures, texture arrays and cubemaps. For single-layer textures, use [method texture_create_shared]
+ Creates a shared texture using the specified [param view] and the texture information from [param with_texture]'s [param layer] and [param mipmap]. The number of included mipmaps from the original texture can be controlled using the [param mipmaps] parameter. Only relevant for textures with multiple layers, such as 3D textures, texture arrays and cubemaps. For single-layer textures, use [method texture_create_shared].
For 2D textures (which only have one layer), [param layer] must be [code]0[/code].
[b]Note:[/b] Layer slicing is only supported for 2D texture arrays, not 3D textures or cubemaps.
</description>
@@ -1444,10 +1570,10 @@
VRAM-compressed signed red/green channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. The format's precision is 8 bits of red channel and 8 bits of green channel. Using BC5 texture compression (also known as S3TC RGTC).
</constant>
<constant name="DATA_FORMAT_BC6H_UFLOAT_BLOCK" value="142" enum="DataFormat">
- VRAM-compressed unsigned red/green/blue channel data format with the floating-point value stored as-is. The format's precision is 8 bits of red channel and 8 bits of green channel. Using BC6H texture compression (also known as BPTC HDR).
+ VRAM-compressed unsigned red/green/blue channel data format with the floating-point value stored as-is. The format's precision is between 10 and 13 bits for the red/green/blue channels. Using BC6H texture compression (also known as BPTC HDR).
</constant>
<constant name="DATA_FORMAT_BC6H_SFLOAT_BLOCK" value="143" enum="DataFormat">
- VRAM-compressed signed red/green/blue channel data format with the floating-point value stored as-is. The format's precision is between 4 and 7 bits for the red/green/blue channels and between 0 and 8 bits for the alpha channel. Using BC7 texture compression (also known as BPTC HDR).
+ VRAM-compressed signed red/green/blue channel data format with the floating-point value stored as-is. The format's precision is between 10 and 13 bits for the red/green/blue channels. Using BC6H texture compression (also known as BPTC HDR).
</constant>
<constant name="DATA_FORMAT_BC7_UNORM_BLOCK" value="144" enum="DataFormat">
VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. The format's precision is between 4 and 7 bits for the red/green/blue channels and between 0 and 8 bits for the alpha channel. Also known as BPTC LDR.
@@ -1477,13 +1603,13 @@
11-bit VRAM-compressed unsigned red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression.
</constant>
<constant name="DATA_FORMAT_EAC_R11_SNORM_BLOCK" value="153" enum="DataFormat">
- 11-bit VRAM-compressed signed red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression.
+ 11-bit VRAM-compressed signed red channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. Using ETC2 texture compression.
</constant>
<constant name="DATA_FORMAT_EAC_R11G11_UNORM_BLOCK" value="154" enum="DataFormat">
11-bit VRAM-compressed unsigned red/green channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression.
</constant>
<constant name="DATA_FORMAT_EAC_R11G11_SNORM_BLOCK" value="155" enum="DataFormat">
- 11-bit VRAM-compressed signed red/green channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression.
+ 11-bit VRAM-compressed signed red/green channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. Using ETC2 texture compression.
</constant>
<constant name="DATA_FORMAT_ASTC_4x4_UNORM_BLOCK" value="156" enum="DataFormat">
VRAM-compressed unsigned floating-point data format with normalized value, packed in 4×4 blocks (highest quality). Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression.
@@ -2362,5 +2488,31 @@
<constant name="INVALID_FORMAT_ID" value="-1">
Returned by functions that return a format ID if a value is invalid.
</constant>
+ <constant name="NONE" value="0" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="REFLECTION_PROBES" value="65536" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="SKY_PASS" value="131072" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="LIGHTMAPPER_PASS" value="196608" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="SHADOW_PASS_DIRECTIONAL" value="262144" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="SHADOW_PASS_CUBE" value="327680" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="OPAQUE_PASS" value="393216" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="ALPHA_PASS" value="458752" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="TRANSPARENT_PASS" value="524288" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="POST_PROCESSING_PASS" value="589824" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="BLIT_PASS" value="655360" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="UI_PASS" value="720896" enum="BreadcrumbMarker">
+ </constant>
+ <constant name="DEBUG_PASS" value="786432" enum="BreadcrumbMarker">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 3c9f0fc7af..26f80630bb 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -224,7 +224,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="ignore" type="bool" />
<description>
- If [param ignore] is [code]true[/code], ignore clipping on items drawn with this canvas item until this is called again with [param ignore] set to false.
+ If [param ignore] is [code]true[/code], ignore clipping on items drawn with this canvas item until this is called again with [param ignore] set to [code]false[/code].
</description>
</method>
<method name="canvas_item_add_lcd_texture_rect_region">
@@ -329,6 +329,7 @@
<param index="4" name="texture" type="RID" default="RID()" />
<description>
Draws a 2D polygon on the [CanvasItem] pointed to by the [param item] [RID]. If you need more flexibility (such as being able to use bones), use [method canvas_item_add_triangle_array] instead. See also [method CanvasItem.draw_polygon].
+ [b]Note:[/b] If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with [method Geometry2D.triangulate_polygon] and using [method CanvasItem.draw_mesh], [method CanvasItem.draw_multimesh], or [method canvas_item_add_triangle_array].
</description>
</method>
<method name="canvas_item_add_polyline">
@@ -412,6 +413,14 @@
[b]Note:[/b] [param count] is unused and can be left unspecified.
</description>
</method>
+ <method name="canvas_item_attach_skeleton">
+ <return type="void" />
+ <param index="0" name="item" type="RID" />
+ <param index="1" name="skeleton" type="RID" />
+ <description>
+ Attaches a skeleton to the [CanvasItem]. Removes the previous skeleton.
+ </description>
+ </method>
<method name="canvas_item_clear">
<return type="void" />
<param index="0" name="item" type="RID" />
@@ -904,7 +913,7 @@
<param index="1" name="transform" type="Transform2D" />
<description>
Transforms both the current and previous stored transform for a canvas light.
- This allows transforming a light without creating a "glitch" in the interpolation, which is is particularly useful for large worlds utilizing a shifting origin.
+ This allows transforming a light without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.
</description>
</method>
<method name="canvas_occluder_polygon_create">
@@ -944,7 +953,8 @@
<param index="1" name="item" type="RID" />
<param index="2" name="mirroring" type="Vector2" />
<description>
- A copy of the canvas item will be drawn with a local offset of the mirroring [Vector2].
+ A copy of the canvas item will be drawn with a local offset of the [param mirroring].
+ [b]Note:[/b] This is equivalent to calling [method canvas_set_item_repeat] like [code]canvas_set_item_repeat(item, mirroring, 1)[/code], with an additional check ensuring [param canvas] is a parent of [param item].
</description>
</method>
<method name="canvas_set_item_repeat">
@@ -1268,6 +1278,14 @@
Sets the intensity of the background color.
</description>
</method>
+ <method name="environment_set_camera_id">
+ <return type="void" />
+ <param index="0" name="env" type="RID" />
+ <param index="1" name="id" type="int" />
+ <description>
+ Sets the camera ID to be used as environment background.
+ </description>
+ </method>
<method name="environment_set_canvas_max_layer">
<return type="void" />
<param index="0" name="env" type="RID" />
@@ -1530,6 +1548,20 @@
Tries to free an object in the RenderingServer. To avoid memory leaks, this should be called after using an object as memory management does not occur automatically when using RenderingServer directly.
</description>
</method>
+ <method name="get_current_rendering_driver_name" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the name of the current rendering driver. This can be [code]vulkan[/code], [code]d3d12[/code], [code]metal[/code], [code]opengl3[/code], [code]opengl3_es[/code], or [code]opengl3_angle[/code]. See also [method get_current_rendering_method].
+ The rendering driver is determined by [member ProjectSettings.rendering/rendering_device/driver], the [code]--rendering-driver[/code] command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware.
+ </description>
+ </method>
+ <method name="get_current_rendering_method" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the name of the current rendering method. This can be [code]forward_plus[/code], [code]mobile[/code], or [code]gl_compatibility[/code]. See also [method get_current_rendering_driver_name].
+ The rendering method is determined by [member ProjectSettings.rendering/renderer/rendering_method], the [code]--rendering-method[/code] command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware.
+ </description>
+ </method>
<method name="get_default_clear_color">
<return type="Color" />
<description>
@@ -1582,7 +1614,7 @@
<return type="RID" />
<description>
Returns the RID of a 256×256 texture with a testing pattern on it (in [constant Image.FORMAT_RGB8] format). This texture will be created and returned on the first call to [method get_test_texture], then it will be cached for subsequent calls. See also [method get_white_texture].
- Example of getting the test texture and applying it to a [Sprite2D] node:
+ [b]Example:[/b] Get the test texture and apply it to a [Sprite2D] node:
[codeblock]
var texture_rid = RenderingServer.get_test_texture()
var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid))
@@ -1623,7 +1655,7 @@
<return type="RID" />
<description>
Returns the ID of a 4×4 white texture (in [constant Image.FORMAT_RGB8] format). This texture will be created and returned on the first call to [method get_white_texture], then it will be cached for subsequent calls. See also [method get_test_texture].
- Example of getting the white texture and applying it to a [Sprite2D] node:
+ [b]Example:[/b] Get the white texture and apply it to a [Sprite2D] node:
[codeblock]
var texture_rid = RenderingServer.get_white_texture()
var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid))
@@ -1855,6 +1887,14 @@
Sets the visibility range values for the given geometry instance. Equivalent to [member GeometryInstance3D.visibility_range_begin] and related properties.
</description>
</method>
+ <method name="instance_reset_physics_interpolation">
+ <return type="void" />
+ <param index="0" name="instance" type="RID" />
+ <description>
+ Prevents physics interpolation for the current physics tick.
+ This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location.
+ </description>
+ </method>
<method name="instance_set_base">
<return type="void" />
<param index="0" name="instance" type="RID" />
@@ -1896,6 +1936,14 @@
If [code]true[/code], ignores both frustum and occlusion culling on the specified 3D geometry instance. This is not the same as [member GeometryInstance3D.ignore_occlusion_culling], which only ignores occlusion culling and leaves frustum culling intact.
</description>
</method>
+ <method name="instance_set_interpolated">
+ <return type="void" />
+ <param index="0" name="instance" type="RID" />
+ <param index="1" name="interpolated" type="bool" />
+ <description>
+ Turns on and off physics interpolation for the instance.
+ </description>
+ </method>
<method name="instance_set_layer_mask">
<return type="void" />
<param index="0" name="instance" type="RID" />
@@ -2111,6 +2159,14 @@
If [code]true[/code], light will cast shadows. Equivalent to [member Light3D.shadow_enabled].
</description>
</method>
+ <method name="light_set_shadow_caster_mask">
+ <return type="void" />
+ <param index="0" name="light" type="RID" />
+ <param index="1" name="mask" type="int" />
+ <description>
+ Sets the shadow caster mask for this 3D light. Shadows will only be cast using objects in the selected layers. Equivalent to [member Light3D.shadow_caster_mask].
+ </description>
+ </method>
<method name="lightmap_create">
<return type="RID" />
<description>
@@ -2190,6 +2246,13 @@
Set the textures on the given [param lightmap] GI instance to the texture array pointed to by the [param light] RID. If the lightmap texture was baked with [member LightmapGI.directional] set to [code]true[/code], then [param uses_sh] must also be [code]true[/code].
</description>
</method>
+ <method name="lightmaps_set_bicubic_filter">
+ <return type="void" />
+ <param index="0" name="enable" type="bool" />
+ <description>
+ Toggles whether a bicubic filter should be used when lightmaps are sampled. This smoothens their appearance at a performance cost.
+ </description>
+ </method>
<method name="make_sphere_mesh">
<return type="RID" />
<param index="0" name="latitudes" type="int" />
@@ -2542,6 +2605,15 @@
Returns the [Transform2D] of the specified instance. For use when the multimesh is set to use 2D transforms.
</description>
</method>
+ <method name="multimesh_instance_reset_physics_interpolation">
+ <return type="void" />
+ <param index="0" name="multimesh" type="RID" />
+ <param index="1" name="index" type="int" />
+ <description>
+ Prevents physics interpolation for the specified instance during the current physics tick.
+ This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location.
+ </description>
+ </method>
<method name="multimesh_instance_set_color">
<return type="void" />
<param index="0" name="multimesh" type="RID" />
@@ -2597,6 +2669,19 @@
- Position + Custom data: 16 floats (12 floats for Transform3D, 4 floats of custom data)
- Position + Vertex color + Custom data: 20 floats (12 floats for Transform3D, 4 floats for Color, 4 floats of custom data)
[/codeblock]
+ Instance transforms are in row-major order. Specifically:
+ - For [Transform2D] the float-order is: [code](x.x, y.x, padding_float, origin.x, x.y, y.y, padding_float, origin.y)[/code].
+ - For [Transform3D] the float-order is: [code](basis.x.x, basis.y.x, basis.z.x, origin.x, basis.x.y, basis.y.y, basis.z.y, origin.y, basis.x.z, basis.y.z, basis.z.z, origin.z)[/code].
+ </description>
+ </method>
+ <method name="multimesh_set_buffer_interpolated">
+ <return type="void" />
+ <param index="0" name="multimesh" type="RID" />
+ <param index="1" name="buffer" type="PackedFloat32Array" />
+ <param index="2" name="buffer_previous" type="PackedFloat32Array" />
+ <description>
+ Alternative version of [method multimesh_set_buffer] for use with physics interpolation.
+ Takes both an array of current data and an array of data for the previous physics tick.
</description>
</method>
<method name="multimesh_set_custom_aabb">
@@ -2615,6 +2700,23 @@
Sets the mesh to be drawn by the multimesh. Equivalent to [member MultiMesh.mesh].
</description>
</method>
+ <method name="multimesh_set_physics_interpolated">
+ <return type="void" />
+ <param index="0" name="multimesh" type="RID" />
+ <param index="1" name="interpolated" type="bool" />
+ <description>
+ Turns on and off physics interpolation for this MultiMesh resource.
+ </description>
+ </method>
+ <method name="multimesh_set_physics_interpolation_quality">
+ <return type="void" />
+ <param index="0" name="multimesh" type="RID" />
+ <param index="1" name="quality" type="int" enum="RenderingServer.MultimeshPhysicsInterpolationQuality" />
+ <description>
+ Sets the physics interpolation quality for the [MultiMesh].
+ A value of [constant MULTIMESH_INTERP_QUALITY_FAST] gives fast but low quality interpolation, a value of [constant MULTIMESH_INTERP_QUALITY_HIGH] gives slower but higher quality interpolation.
+ </description>
+ </method>
<method name="multimesh_set_visible_instances">
<return type="void" />
<param index="0" name="multimesh" type="RID" />
@@ -2869,7 +2971,7 @@
<param index="0" name="particles" type="RID" />
<param index="1" name="emitting" type="bool" />
<description>
- If [code]true[/code], particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to [member GPUParticles3D.emitting].
+ If [code]true[/code], particles will emit over time. Setting to [code]false[/code] does not reset the particles, but only stops their emission. Equivalent to [member GPUParticles3D.emitting].
</description>
</method>
<method name="particles_set_explosiveness_ratio">
@@ -3426,7 +3528,7 @@
<param index="0" name="texture" type="RID" />
<description>
Returns an [Image] instance from the given [param texture] [RID].
- Example of getting the test texture from [method get_test_texture] and applying it to a [Sprite2D] node:
+ [b]Example:[/b] Get the test texture from [method get_test_texture] and apply it to a [Sprite2D] node:
[codeblock]
var texture_rid = RenderingServer.get_test_texture()
var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid))
@@ -3463,7 +3565,7 @@
<method name="texture_2d_placeholder_create">
<return type="RID" />
<description>
- Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]texture_2d_layered_*[/code] RenderingServer functions, although it does nothing when used. See also [method texture_2d_layered_placeholder_create]
+ Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]texture_2d_layered_*[/code] RenderingServer functions, although it does nothing when used. See also [method texture_2d_layered_placeholder_create].
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method.
[b]Note:[/b] The equivalent resource is [PlaceholderTexture2D].
</description>
@@ -3514,6 +3616,21 @@
[b]Note:[/b] The [param texture] must have the same width, height, depth and format as the current texture data. Otherwise, an error will be printed and the original texture won't be modified. If you need to use different width, height, depth or format, use [method texture_replace] instead.
</description>
</method>
+ <method name="texture_create_from_native_handle">
+ <return type="RID" />
+ <param index="0" name="type" type="int" enum="RenderingServer.TextureType" />
+ <param index="1" name="format" type="int" enum="Image.Format" />
+ <param index="2" name="native_handle" type="int" />
+ <param index="3" name="width" type="int" />
+ <param index="4" name="height" type="int" />
+ <param index="5" name="depth" type="int" />
+ <param index="6" name="layers" type="int" default="1" />
+ <param index="7" name="layered_type" type="int" enum="RenderingServer.TextureLayeredType" default="0" />
+ <description>
+ Creates a texture based on a native handle that was created outside of Godot's renderer.
+ [b]Note:[/b] If using the rendering device renderer, using [method RenderingDevice.texture_create_from_extension] rather than this method is recommended. It will give you much more control over the texture's format and usage.
+ </description>
+ </method>
<method name="texture_get_format" qualifiers="const">
<return type="int" enum="Image.Format" />
<param index="0" name="texture" type="RID" />
@@ -3652,7 +3769,7 @@
<return type="float" />
<param index="0" name="viewport" type="RID" />
<description>
- Returns the GPU time taken to render the last frame in milliseconds. To get a complete readout of GPU time spent to render the scene, sum the render times of all viewports that are drawn every frame. Unlike [method Engine.get_frames_per_second], this method accurately reflects GPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also [method viewport_get_measured_render_time_gpu].
+ Returns the GPU time taken to render the last frame in milliseconds. To get a complete readout of GPU time spent to render the scene, sum the render times of all viewports that are drawn every frame. Unlike [method Engine.get_frames_per_second], this method accurately reflects GPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also [method viewport_get_measured_render_time_cpu].
[b]Note:[/b] Requires measurements to be enabled on the specified [param viewport] using [method viewport_set_measure_render_time]. Otherwise, this method returns [code]0.0[/code].
[b]Note:[/b] When GPU utilization is low enough during a certain period of time, GPUs will decrease their power state (which in turn decreases core and memory clock speeds). This can cause the reported GPU time to increase if GPU utilization is kept low enough by a framerate cap (compared to what it would be at the GPU's highest power state). Keep this in mind when benchmarking using [method viewport_get_measured_render_time_gpu]. This behavior can be overridden in the graphics driver settings at the cost of higher power usage.
</description>
@@ -3830,7 +3947,7 @@
<param index="0" name="viewport" type="RID" />
<param index="1" name="msaa" type="int" enum="RenderingServer.ViewportMSAA" />
<description>
- Sets the multisample anti-aliasing mode for 2D/Canvas on the specified [param viewport] RID. See [enum ViewportMSAA] for options.
+ Sets the multisample antialiasing mode for 2D/Canvas on the specified [param viewport] RID. See [enum ViewportMSAA] for options. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/msaa_2d] or [member Viewport.msaa_2d].
</description>
</method>
<method name="viewport_set_msaa_3d">
@@ -3838,7 +3955,7 @@
<param index="0" name="viewport" type="RID" />
<param index="1" name="msaa" type="int" enum="RenderingServer.ViewportMSAA" />
<description>
- Sets the multisample anti-aliasing mode for 3D on the specified [param viewport] RID. See [enum ViewportMSAA] for options.
+ Sets the multisample antialiasing mode for 3D on the specified [param viewport] RID. See [enum ViewportMSAA] for options. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/msaa_3d] or [member Viewport.msaa_3d].
</description>
</method>
<method name="viewport_set_occlusion_culling_build_quality">
@@ -3920,7 +4037,7 @@
<param index="0" name="viewport" type="RID" />
<param index="1" name="mode" type="int" enum="RenderingServer.ViewportScreenSpaceAA" />
<description>
- Sets the viewport's screen-space antialiasing mode.
+ Sets the viewport's screen-space antialiasing mode. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa] or [member Viewport.screen_space_aa].
</description>
</method>
<method name="viewport_set_sdf_oversize_and_scale">
@@ -3987,7 +4104,7 @@
<param index="0" name="viewport" type="RID" />
<param index="1" name="enable" type="bool" />
<description>
- If [code]true[/code], enables debanding on the specified viewport. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding].
+ If [code]true[/code], enables debanding on the specified viewport. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding] or [member Viewport.use_debanding].
</description>
</method>
<method name="viewport_set_use_hdr_2d">
@@ -4012,7 +4129,7 @@
<param index="0" name="viewport" type="RID" />
<param index="1" name="enable" type="bool" />
<description>
- If [code]true[/code], use Temporal Anti-Aliasing. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_taa].
+ If [code]true[/code], use temporal antialiasing. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_taa] or [member Viewport.use_taa].
</description>
</method>
<method name="viewport_set_use_xr">
@@ -4242,6 +4359,15 @@
<constant name="MAX_MESH_SURFACES" value="256">
The maximum number of surfaces a mesh can have.
</constant>
+ <constant name="TEXTURE_TYPE_2D" value="0" enum="TextureType">
+ 2D texture.
+ </constant>
+ <constant name="TEXTURE_TYPE_LAYERED" value="1" enum="TextureType">
+ Layered texture.
+ </constant>
+ <constant name="TEXTURE_TYPE_3D" value="2" enum="TextureType">
+ 3D texture.
+ </constant>
<constant name="TEXTURE_LAYERED_2D_ARRAY" value="0" enum="TextureLayeredType">
Array of 2-dimensional textures (see [Texture2DArray]).
</constant>
@@ -4484,6 +4610,12 @@
<constant name="MULTIMESH_TRANSFORM_3D" value="1" enum="MultimeshTransformFormat">
Use [Transform3D] to store MultiMesh transform.
</constant>
+ <constant name="MULTIMESH_INTERP_QUALITY_FAST" value="0" enum="MultimeshPhysicsInterpolationQuality">
+ MultiMesh physics interpolation favors speed over quality.
+ </constant>
+ <constant name="MULTIMESH_INTERP_QUALITY_HIGH" value="1" enum="MultimeshPhysicsInterpolationQuality">
+ MultiMesh physics interpolation favors quality over speed.
+ </constant>
<constant name="LIGHT_PROJECTOR_FILTER_NEAREST" value="0" enum="LightProjectorFilter">
Nearest-neighbor filter for light projectors (use for pixel art light projectors). No mipmaps are used for rendering, which means light projectors at a distance will look sharp but grainy. This has roughly the same performance cost as using mipmaps.
</constant>
@@ -5049,7 +5181,7 @@
The callback is called before our transparent rendering pass, but after our sky is rendered and we've created our back buffers.
</constant>
<constant name="COMPOSITOR_EFFECT_CALLBACK_TYPE_POST_TRANSPARENT" value="4" enum="CompositorEffectCallbackType">
- The callback is called after our transparent rendering pass, but before any build in post effects and output to our render target.
+ The callback is called after our transparent rendering pass, but before any built-in post-processing effects and output to our render target.
</constant>
<constant name="COMPOSITOR_EFFECT_CALLBACK_TYPE_ANY" value="-1" enum="CompositorEffectCallbackType">
</constant>
@@ -5120,7 +5252,7 @@
Output color as they came in. This can cause bright lighting to look blown out, with noticeable clipping in the output colors.
</constant>
<constant name="ENV_TONE_MAPPER_REINHARD" value="1" enum="EnvironmentToneMapper">
- Use the Reinhard tonemapper. Performs a variation on rendered pixels' colors by this formula: [code]color = color / (1 + color)[/code]. This avoids clipping bright highlights, but the resulting image can look a bit dull.
+ Use the Reinhard tonemapper. Performs a variation on rendered pixels' colors by this formula: [code]color = color * (1 + color / (white * white)) / (1 + color)[/code]. This avoids clipping bright highlights, but the resulting image can look a bit dull. When [member Environment.tonemap_white] is left at the default value of [code]1.0[/code] this is identical to [constant ENV_TONE_MAPPER_LINEAR] while also being slightly less performant.
</constant>
<constant name="ENV_TONE_MAPPER_FILMIC" value="2" enum="EnvironmentToneMapper">
Use the filmic tonemapper. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than [constant ENV_TONE_MAPPER_REINHARD].
@@ -5561,7 +5693,10 @@
<constant name="GLOBAL_VAR_TYPE_SAMPLERCUBE" value="27" enum="GlobalShaderParameterType">
Cubemap sampler global shader parameter ([code]global uniform samplerCube ...[/code]). Exposed as a [Cubemap] in the editor UI.
</constant>
- <constant name="GLOBAL_VAR_TYPE_MAX" value="28" enum="GlobalShaderParameterType">
+ <constant name="GLOBAL_VAR_TYPE_SAMPLEREXT" value="28" enum="GlobalShaderParameterType">
+ External sampler global shader parameter ([code]global uniform samplerExternalOES ...[/code]). Exposed as a [ExternalTexture] in the editor UI.
+ </constant>
+ <constant name="GLOBAL_VAR_TYPE_MAX" value="29" enum="GlobalShaderParameterType">
Represents the size of the [enum GlobalShaderParameterType] enum.
</constant>
<constant name="RENDERING_INFO_TOTAL_OBJECTS_IN_FRAME" value="0" enum="RenderingInfo">
@@ -5582,6 +5717,39 @@
<constant name="RENDERING_INFO_VIDEO_MEM_USED" value="5" enum="RenderingInfo">
Video memory used (in bytes). When using the Forward+ or mobile rendering backends, this is always greater than the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED], since there is miscellaneous data not accounted for by those two metrics. When using the GL Compatibility backend, this is equal to the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED].
</constant>
+ <constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_CANVAS" value="6" enum="RenderingInfo">
+ Number of pipeline compilations that were triggered by the 2D canvas renderer.
+ </constant>
+ <constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_MESH" value="7" enum="RenderingInfo">
+ Number of pipeline compilations that were triggered by loading meshes. These compilations will show up as longer loading times the first time a user runs the game and the pipeline is required.
+ </constant>
+ <constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_SURFACE" value="8" enum="RenderingInfo">
+ Number of pipeline compilations that were triggered by building the surface cache before rendering the scene. These compilations will show up as a stutter when loading an scene the first time a user runs the game and the pipeline is required.
+ </constant>
+ <constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_DRAW" value="9" enum="RenderingInfo">
+ Number of pipeline compilations that were triggered while drawing the scene. These compilations will show up as stutters during gameplay the first time a user runs the game and the pipeline is required.
+ </constant>
+ <constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_SPECIALIZATION" value="10" enum="RenderingInfo">
+ Number of pipeline compilations that were triggered to optimize the current scene. These compilations are done in the background and should not cause any stutters whatsoever.
+ </constant>
+ <constant name="PIPELINE_SOURCE_CANVAS" value="0" enum="PipelineSource">
+ Pipeline compilation that was triggered by the 2D canvas renderer.
+ </constant>
+ <constant name="PIPELINE_SOURCE_MESH" value="1" enum="PipelineSource">
+ Pipeline compilation that was triggered by loading a mesh.
+ </constant>
+ <constant name="PIPELINE_SOURCE_SURFACE" value="2" enum="PipelineSource">
+ Pipeline compilation that was triggered by building the surface cache before rendering the scene.
+ </constant>
+ <constant name="PIPELINE_SOURCE_DRAW" value="3" enum="PipelineSource">
+ Pipeline compilation that was triggered while drawing the scene.
+ </constant>
+ <constant name="PIPELINE_SOURCE_SPECIALIZATION" value="4" enum="PipelineSource">
+ Pipeline compilation that was triggered to optimize the current scene.
+ </constant>
+ <constant name="PIPELINE_SOURCE_MAX" value="5" enum="PipelineSource">
+ Represents the size of the [enum PipelineSource] enum.
+ </constant>
<constant name="FEATURE_SHADERS" value="0" enum="Features" deprecated="This constant has not been used since Godot 3.0.">
</constant>
<constant name="FEATURE_MULTITHREADED" value="1" enum="Features" deprecated="This constant has not been used since Godot 3.0.">
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index cec936ac3e..0f3a231cb7 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -14,17 +14,30 @@
<link title="When and how to avoid using nodes for everything">$DOCS_URL/tutorials/best_practices/node_alternatives.html</link>
</tutorials>
<methods>
- <method name="_get_rid" qualifiers="virtual">
+ <method name="_get_rid" qualifiers="virtual const">
<return type="RID" />
<description>
Override this method to return a custom [RID] when [method get_rid] is called.
</description>
</method>
+ <method name="_reset_state" qualifiers="virtual">
+ <return type="void" />
+ <description>
+ For resources that use a variable number of properties, either via [method Object._validate_property] or [method Object._get_property_list], this method should be implemented to correctly clear the resource's state.
+ </description>
+ </method>
+ <method name="_set_path_cache" qualifiers="virtual const">
+ <return type="void" />
+ <param index="0" name="path" type="String" />
+ <description>
+ Sets the resource's path to [param path] without involving the resource cache.
+ </description>
+ </method>
<method name="_setup_local_to_scene" qualifiers="virtual">
<return type="void" />
<description>
Override this method to customize the newly duplicated resource created from [method PackedScene.instantiate], if the original's [member resource_local_to_scene] is set to [code]true[/code].
- [b]Example:[/b] Set a random [code]damage[/code] value to every local resource from an instantiated scene.
+ [b]Example:[/b] Set a random [code]damage[/code] value to every local resource from an instantiated scene:
[codeblock]
extends Resource
@@ -40,8 +53,11 @@
<param index="0" name="subresources" type="bool" default="false" />
<description>
Duplicates this resource, returning a new resource with its [code]export[/code]ed or [constant PROPERTY_USAGE_STORAGE] properties copied from the original.
- If [param subresources] is [code]false[/code], a shallow copy is returned; nested resources within subresources are not duplicated and are shared from the original resource. If [param subresources] is [code]true[/code], a deep copy is returned; nested subresources will be duplicated and are not shared.
- Subresource properties with the [constant PROPERTY_USAGE_ALWAYS_DUPLICATE] flag are always duplicated even with [param subresources] set to [code]false[/code], and properties with the [constant PROPERTY_USAGE_NEVER_DUPLICATE] flag are never duplicated even with [param subresources] set to [code]true[/code].
+ If [param subresources] is [code]false[/code], a shallow copy is returned; nested resources within subresources are not duplicated and are shared with the original resource (with one exception; see below). If [param subresources] is [code]true[/code], a deep copy is returned; nested subresources will be duplicated and are not shared (with two exceptions; see below).
+ [param subresources] is usually respected, with the following exceptions:
+ - Subresource properties with the [constant PROPERTY_USAGE_ALWAYS_DUPLICATE] flag are always duplicated.
+ - Subresource properties with the [constant PROPERTY_USAGE_NEVER_DUPLICATE] flag are never duplicated.
+ - Subresources inside [Array] and [Dictionary] properties are never duplicated.
[b]Note:[/b] For custom resources, this method will fail if [method Object._init] has been defined with required parameters.
</description>
</method>
@@ -65,6 +81,14 @@
Generates a unique identifier for a resource to be contained inside a [PackedScene], based on the current date, time, and a random value. The returned string is only composed of letters ([code]a[/code] to [code]y[/code]) and numbers ([code]0[/code] to [code]8[/code]). See also [member resource_scene_unique_id].
</description>
</method>
+ <method name="get_id_for_path" qualifiers="const">
+ <return type="String" />
+ <param index="0" name="path" type="String" />
+ <description>
+ Returns the unique identifier for the resource with the given [param path] from the resource cache. If the resource is not loaded and cached, an empty string is returned.
+ [b]Note:[/b] This method is only implemented when running in an editor context. At runtime, it returns an empty string.
+ </description>
+ </method>
<method name="get_local_scene" qualifiers="const">
<return type="Node" />
<description>
@@ -77,6 +101,34 @@
Returns the [RID] of this resource (or an empty RID). Many resources (such as [Texture2D], [Mesh], and so on) are high-level abstractions of resources stored in a specialized server ([DisplayServer], [RenderingServer], etc.), so this function will return the original [RID].
</description>
</method>
+ <method name="is_built_in" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the resource is built-in (from the engine) or [code]false[/code] if it is user-defined.
+ </description>
+ </method>
+ <method name="reset_state">
+ <return type="void" />
+ <description>
+ For resources that use a variable number of properties, either via [method Object._validate_property] or [method Object._get_property_list], override [method _reset_state] to correctly clear the resource's state.
+ </description>
+ </method>
+ <method name="set_id_for_path">
+ <return type="void" />
+ <param index="0" name="path" type="String" />
+ <param index="1" name="id" type="String" />
+ <description>
+ Sets the unique identifier to [param id] for the resource with the given [param path] in the resource cache. If the unique identifier is empty, the cache entry using [param path] is removed if it exists.
+ [b]Note:[/b] This method is only implemented when running in an editor context.
+ </description>
+ </method>
+ <method name="set_path_cache">
+ <return type="void" />
+ <param index="0" name="path" type="String" />
+ <description>
+ Sets the resource's path to [param path] without involving the resource cache.
+ </description>
+ </method>
<method name="setup_local_to_scene" deprecated="This method should only be called internally.">
<return type="void" />
<description>
diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml
index 4e4adc86c4..cdbf8b3f9a 100644
--- a/doc/classes/ResourceFormatLoader.xml
+++ b/doc/classes/ResourceFormatLoader.xml
@@ -57,6 +57,7 @@
<return type="int" />
<param index="0" name="path" type="String" />
<description>
+ Should return the unique ID for the resource associated with the given path. If this method is not overridden, a [code].uid[/code] file is generated along with the resource file, containing the unique ID.
</description>
</method>
<method name="_handles_type" qualifiers="virtual const">
diff --git a/doc/classes/ResourceImporterDynamicFont.xml b/doc/classes/ResourceImporterDynamicFont.xml
index f100670e08..3727bed8e5 100644
--- a/doc/classes/ResourceImporterDynamicFont.xml
+++ b/doc/classes/ResourceImporterDynamicFont.xml
@@ -54,7 +54,7 @@
Source font size used to generate MSDF textures. Higher values allow for more precision, but are slower to render and require more memory. Only increase this value if you notice a visible lack of precision in glyph rendering. Only effective if [member multichannel_signed_distance_field] is [code]true[/code].
</member>
<member name="multichannel_signed_distance_field" type="bool" setter="" getter="" default="false">
- If set to [code]true[/code], the default font will use multichannel signed distance field (MSDF) for crisp rendering at any size. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for [Control]s that are scaled down (or for [Label3D]s viewed from a long distance).
+ If set to [code]true[/code], the font will use multichannel signed distance field (MSDF) for crisp rendering at any size. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for [Control]s that are scaled down (or for [Label3D]s viewed from a long distance).
MSDF font rendering can be combined with [member generate_mipmaps] to further improve font rendering quality when scaled down.
</member>
<member name="opentype_features" type="Dictionary" setter="" getter="" default="{}">
@@ -69,12 +69,13 @@
<member name="script_support" type="Dictionary" setter="" getter="" default="{}">
Override the list of language scripts supported by this font. If left empty, this is supplied by the font metadata. There is usually no need to change this. See also [member language_support].
</member>
- <member name="subpixel_positioning" type="int" setter="" getter="" default="1">
+ <member name="subpixel_positioning" type="int" setter="" getter="" default="4">
Subpixel positioning improves font rendering appearance, especially at smaller font sizes. The downside is that it takes more time to initially render the font, which can cause stuttering during gameplay, especially if used with large font sizes. This should be set to [b]Disabled[/b] for fonts with a pixel art appearance.
[b]Disabled:[/b] No subpixel positioning. Lowest quality, fastest rendering.
[b]Auto:[/b] Use subpixel positioning at small font sizes (the chosen quality varies depending on font size). Large fonts will not use subpixel positioning. This is a good tradeoff between performance and quality.
[b]One Half of a Pixel:[/b] Always perform intermediate subpixel positioning regardless of font size. High quality, slow rendering.
[b]One Quarter of a Pixel:[/b] Always perform precise subpixel positioning regardless of font size. Highest quality, slowest rendering.
+ [b]Auto (Except Pixel Fonts):[/b] [b]Disabled[/b] for the pixel style fonts (each glyph contours contain only straight horizontal and vertical lines), [b]Auto[/b] for the other fonts.
</member>
</members>
</class>
diff --git a/doc/classes/ResourceImporterImageFont.xml b/doc/classes/ResourceImporterImageFont.xml
index 6dbfa1d651..663c906001 100644
--- a/doc/classes/ResourceImporterImageFont.xml
+++ b/doc/classes/ResourceImporterImageFont.xml
@@ -40,7 +40,7 @@
</member>
<member name="kerning_pairs" type="PackedStringArray" setter="" getter="" default="PackedStringArray()">
Kerning pairs for the font. Kerning pair adjust the spacing between two characters.
- Each string consist of three space separated values: "from" string, "to" string and integer offset. Each combination form the two string for a kerning pair, e.g, [code]ab cd -3[/code] will create kerning pairs [code]ac[/code], [code]ad[/code], [code]bc[/code], and [code]bd[/code] with offset [code]-3[/code].
+ Each string consist of three space separated values: "from" string, "to" string and integer offset. Each combination form the two string for a kerning pair, e.g, [code]ab cd -3[/code] will create kerning pairs [code]ac[/code], [code]ad[/code], [code]bc[/code], and [code]bd[/code] with offset [code]-3[/code]. [code]\uXXXX[/code] escape sequences can be used to add Unicode characters.
</member>
<member name="rows" type="int" setter="" getter="" default="1">
Number of rows in the font image. See also [member columns].
diff --git a/doc/classes/ResourceImporterOBJ.xml b/doc/classes/ResourceImporterOBJ.xml
index 55043a311c..084638f62b 100644
--- a/doc/classes/ResourceImporterOBJ.xml
+++ b/doc/classes/ResourceImporterOBJ.xml
@@ -14,6 +14,19 @@
<member name="force_disable_mesh_compression" type="bool" setter="" getter="" default="false">
If [code]true[/code], mesh compression will not be used. Consider enabling if you notice blocky artifacts in your mesh normals or UVs, or if you have meshes that are larger than a few thousand meters in each direction.
</member>
+ <member name="generate_lightmap_uv2" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], generates UV2 on import for [LightmapGI] baking.
+ </member>
+ <member name="generate_lightmap_uv2_texel_size" type="float" setter="" getter="" default="0.2">
+ Controls the size of each texel on the baked lightmap. A smaller value results in more precise lightmaps, at the cost of larger lightmap sizes and longer bake times.
+ [b]Note:[/b] Only effective if [member generate_lightmap_uv2] is [code]true[/code].
+ </member>
+ <member name="generate_lods" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], generates lower detail variants of the mesh which will be displayed in the distance to improve rendering performance. Not all meshes benefit from LOD, especially if they are never rendered from far away. Disabling this can reduce output file size and speed up importing. See [url=$DOCS_URL/tutorials/3d/mesh_lod.html#doc-mesh-lod]Mesh level of detail (LOD)[/url] for more information.
+ </member>
+ <member name="generate_shadow_mesh" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], enables the generation of shadow meshes on import. This optimizes shadow rendering without reducing quality by welding vertices together when possible. This in turn reduces the memory bandwidth required to render shadows. Shadow mesh generation currently doesn't support using a lower detail level than the source mesh (but shadow rendering will make use of LODs when relevant).
+ </member>
<member name="generate_tangents" type="bool" setter="" getter="" default="true">
If [code]true[/code], generate vertex tangents using [url=http://www.mikktspace.com/]Mikktspace[/url] if the source mesh doesn't have tangent data. When possible, it's recommended to let the 3D modeling software generate tangents on export instead on relying on this option. Tangents are required for correct display of normal and height maps, along with any material/shader features that require tangents.
If you don't need material features that require tangents, disabling this can reduce output file size and speed up importing if the source 3D file doesn't contain tangents.
@@ -21,9 +34,6 @@
<member name="offset_mesh" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)">
Offsets the mesh's data by the specified value. This can be used to work around misaligned meshes without having to modify the source file.
</member>
- <member name="optimize_mesh" type="bool" setter="" getter="" default="true">
- Unused parameter. This currently has no effect.
- </member>
<member name="scale_mesh" type="Vector3" setter="" getter="" default="Vector3(1, 1, 1)">
Scales the mesh's data by the specified value. This can be used to work around misscaled meshes without having to modify the source file.
</member>
diff --git a/doc/classes/ResourceImporterScene.xml b/doc/classes/ResourceImporterScene.xml
index 900e028b25..1565a244fe 100644
--- a/doc/classes/ResourceImporterScene.xml
+++ b/doc/classes/ResourceImporterScene.xml
@@ -68,6 +68,9 @@
<member name="nodes/root_type" type="String" setter="" getter="" default="&quot;&quot;">
Override for the root node type. If empty, the root node will use what the scene specifies, or [Node3D] if the scene does not specify a root type. Using a node type that inherits from [Node3D] is recommended. Otherwise, you'll lose the ability to position the node directly in the 3D editor.
</member>
+ <member name="nodes/use_node_type_suffixes" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], use suffixes in the node names to determine the node type, such as [code]-col[/code] for collision shapes. Disabling this makes editor-imported files more similar to the original files, and more similar to importing files at runtime. See [url=$DOCS_URL/tutorials/assets_pipeline/importing_3d_scenes/node_type_customization.html]Node type customization using name suffixes[/url] for more information.
+ </member>
<member name="skins/use_named_skins" type="bool" setter="" getter="" default="true">
If checked, use named [Skin]s for animation. The [MeshInstance3D] node contains 3 properties of relevance here: a skeleton [NodePath] pointing to the [Skeleton3D] node (usually [code]..[/code]), a mesh, and a skin:
- The [Skeleton3D] node contains a list of bones with names, their pose and rest, a name and a parent bone.
diff --git a/doc/classes/ResourceImporterTexture.xml b/doc/classes/ResourceImporterTexture.xml
index fd6642bb32..a39e48c7bf 100644
--- a/doc/classes/ResourceImporterTexture.xml
+++ b/doc/classes/ResourceImporterTexture.xml
@@ -84,8 +84,8 @@
</member>
<member name="process/premult_alpha" type="bool" setter="" getter="" default="false">
An alternative to fixing darkened borders with [member process/fix_alpha_border] is to use premultiplied alpha. By enabling this option, the texture will be converted to this format. A premultiplied alpha texture requires specific materials to be displayed correctly:
- - In 2D, a [CanvasItemMaterial] will need to be created and configured to use the [constant CanvasItemMaterial.BLEND_MODE_PREMULT_ALPHA] blend mode on [CanvasItem]s that use this texture.
- - In 3D, there is no support for premultiplied alpha blend mode yet, so this option is only suited for 2D.
+ - In 2D, a [CanvasItemMaterial] will need to be created and configured to use the [constant CanvasItemMaterial.BLEND_MODE_PREMULT_ALPHA] blend mode on [CanvasItem]s that use this texture. In custom [code]@canvas_item[/code] shaders, [code]render_mode blend_premul_alpha;[/code] should be used.
+ - In 3D, a [BaseMaterial3D] will need to be created and configured to use the [constant BaseMaterial3D.BLEND_MODE_PREMULT_ALPHA] blend mode on materials that use this texture. In custom [code]spatial[/code] shaders, [code]render_mode blend_premul_alpha;[/code] should be used.
</member>
<member name="process/size_limit" type="int" setter="" getter="" default="0">
If set to a value greater than [code]0[/code], the size of the texture is limited on import to a value smaller than or equal to the value specified here. For non-square textures, the size limit affects the longer dimension, with the shorter dimension scaled to preserve aspect ratio. Resizing is performed using cubic interpolation.
diff --git a/doc/classes/ResourceImporterWAV.xml b/doc/classes/ResourceImporterWAV.xml
index d3dafb03b6..3caa66d262 100644
--- a/doc/classes/ResourceImporterWAV.xml
+++ b/doc/classes/ResourceImporterWAV.xml
@@ -4,30 +4,32 @@
Imports a WAV audio file for playback.
</brief_description>
<description>
- WAV is an uncompressed format, which can provide higher quality compared to Ogg Vorbis and MP3. It also has the lowest CPU cost to decode. This means high numbers of WAV sounds can be played at the same time, even on low-end deviceS.
+ WAV is an uncompressed format, which can provide higher quality compared to Ogg Vorbis and MP3. It also has the lowest CPU cost to decode. This means high numbers of WAV sounds can be played at the same time, even on low-end devices.
+ By default, Godot imports WAV files using the lossy Quite OK Audio compression. You may change this by setting the [member compress/mode] property.
</description>
<tutorials>
<link title="Importing audio samples">$DOCS_URL/tutorials/assets_pipeline/importing_audio_samples.html</link>
</tutorials>
<members>
- <member name="compress/mode" type="int" setter="" getter="" default="0">
+ <member name="compress/mode" type="int" setter="" getter="" default="2">
The compression mode to use on import.
- [b]Disabled:[/b] Imports audio data without any compression. This results in the highest possible quality.
- [b]RAM (Ima-ADPCM):[/b] Performs fast lossy compression on import. Low CPU cost, but quality is noticeably decreased compared to Ogg Vorbis or even MP3.
- [b]QOA ([url=https://qoaformat.org/]Quite OK Audio[/url]):[/b] Performs lossy compression on import. CPU cost is slightly higher than IMA-ADPCM, but quality is much higher.
+ - [b]PCM (Uncompressed):[/b] Imports audio data without any form of compression, preserving the highest possible quality. It has the lowest CPU cost, but the highest memory usage.
+ - [b]IMA ADPCM:[/b] Applies fast, lossy compression during import, noticeably decreasing the quality, but with low CPU cost and memory usage. Does not support seeking and only Forward loop mode is supported.
+ - [b][url=https://qoaformat.org/]Quite OK Audio[/url]:[/b] Also applies lossy compression on import, having a slightly higher CPU cost compared to IMA ADPCM, but much higher quality and the lowest memory usage.
</member>
<member name="edit/loop_begin" type="int" setter="" getter="" default="0">
- The begin loop point to use when [member edit/loop_mode] is [b]Forward[/b], [b]Ping-Pong[/b] or [b]Backward[/b]. This is set in seconds after the beginning of the audio file.
+ The begin loop point to use when [member edit/loop_mode] is [b]Forward[/b], [b]Ping-Pong[/b], or [b]Backward[/b]. This is set in samples after the beginning of the audio file.
</member>
<member name="edit/loop_end" type="int" setter="" getter="" default="-1">
- The end loop point to use when [member edit/loop_mode] is [b]Forward[/b], [b]Ping-Pong[/b] or [b]Backward[/b]. This is set in seconds after the beginning of the audio file. A value of [code]-1[/code] uses the end of the audio file as the end loop point.
+ The end loop point to use when [member edit/loop_mode] is [b]Forward[/b], [b]Ping-Pong[/b], or [b]Backward[/b]. This is set in samples after the beginning of the audio file. A value of [code]-1[/code] uses the end of the audio file as the end loop point.
</member>
<member name="edit/loop_mode" type="int" setter="" getter="" default="0">
- Controls how audio should loop. This is automatically read from the WAV metadata on import.
- [b]Disabled:[/b] Don't loop audio, even if metadata indicates the file should be played back looping.
- [b]Forward:[/b] Standard audio looping.
- [b]Ping-Pong:[/b] Play audio forward until it's done playing, then play it backward and repeat. This is similar to mirrored texture repeat, but for audio.
- [b]Backward:[/b] Play audio in reverse and loop back to the end when done playing.
+ Controls how audio should loop.
+ - [b]Detect From WAV:[/b] Uses loop information from the WAV metadata.
+ - [b]Disabled:[/b] Don't loop audio, even if the metadata indicates the file playback should loop.
+ - [b]Forward:[/b] Standard audio looping. Plays the audio forward from the beginning to [member edit/loop_end], then returns to [member edit/loop_begin] and repeats.
+ - [b]Ping-Pong:[/b] Plays the audio forward until [member edit/loop_end], then backwards to [member edit/loop_begin], repeating this cycle.
+ - [b]Backward:[/b] Plays the audio backwards from [member edit/loop_end] to [member edit/loop_begin], then repeats.
[b]Note:[/b] In [AudioStreamPlayer], the [signal AudioStreamPlayer.finished] signal won't be emitted for looping audio when it reaches the end of the audio file, as the audio will keep playing indefinitely.
</member>
<member name="edit/normalize" type="bool" setter="" getter="" default="false">
diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml
index 1961ca2b0e..ae862dd52f 100644
--- a/doc/classes/ResourceLoader.xml
+++ b/doc/classes/ResourceLoader.xml
@@ -7,6 +7,7 @@
A singleton used to load resource files from the filesystem.
It uses the many [ResourceFormatLoader] classes registered in the engine (either built-in or from a plugin) to load files into memory and convert them to a format that can be used by the engine.
[b]Note:[/b] You have to import the files into the engine first to load them using [method load]. If you want to load [Image]s at run-time, you may use [method Image.load]. If you want to import audio files, you can use the snippet described in [member AudioStreamMP3.data].
+ [b]Note:[/b] Non-resource files such as plain text files cannot be read using [ResourceLoader]. Use [FileAccess] for those files instead, and be aware that non-resource files are not exported by default (see notes in the [FileAccess] class description for instructions on exporting them).
</description>
<tutorials>
<link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link>
@@ -31,6 +32,14 @@
[b]Note:[/b] If you use [method Resource.take_over_path], this method will return [code]true[/code] for the taken path even if the resource wasn't saved (i.e. exists only in resource cache).
</description>
</method>
+ <method name="get_cached_ref">
+ <return type="Resource" />
+ <param index="0" name="path" type="String" />
+ <description>
+ Returns the cached resource reference for the given [param path].
+ [b]Note:[/b] If the resource is not cached, the returned [Resource] will be invalid.
+ </description>
+ </method>
<method name="get_dependencies">
<return type="PackedStringArray" />
<param index="0" name="path" type="String" />
@@ -66,6 +75,13 @@
Once a resource has been loaded by the engine, it is cached in memory for faster access, and future calls to the [method load] method will use the cached version. The cached resource can be overridden by using [method Resource.take_over_path] on a new resource for that same path.
</description>
</method>
+ <method name="list_directory">
+ <return type="PackedStringArray" />
+ <param index="0" name="directory_path" type="String" />
+ <description>
+ Lists a directory (as example: "res://assets/enemies"), returning all resources contained within. The resource files are the original file names as visible in the editor before exporting.
+ </description>
+ </method>
<method name="load">
<return type="Resource" />
<param index="0" name="path" type="String" />
@@ -87,7 +103,7 @@
<param index="0" name="path" type="String" />
<description>
Returns the resource loaded by [method load_threaded_request].
- If this is called before the loading thread is done (i.e. [method load_threaded_get_status] is not [constant THREAD_LOAD_LOADED]), the calling thread will be blocked until the resource has finished loading.
+ If this is called before the loading thread is done (i.e. [method load_threaded_get_status] is not [constant THREAD_LOAD_LOADED]), the calling thread will be blocked until the resource has finished loading. However, it's recommended to use [method load_threaded_get_status] to known when the load has actually completed.
</description>
</method>
<method name="load_threaded_get_status">
@@ -96,7 +112,8 @@
<param index="1" name="progress" type="Array" default="[]" />
<description>
Returns the status of a threaded loading operation started with [method load_threaded_request] for the resource at [param path]. See [enum ThreadLoadStatus] for possible return values.
- An array variable can optionally be passed via [param progress], and will return a one-element array containing the percentage of completion of the threaded loading.
+ An array variable can optionally be passed via [param progress], and will return a one-element array containing the ratio of completion of the threaded loading (between [code]0.0[/code] and [code]1.0[/code]).
+ [b]Note:[/b] The recommended way of using this method is to call it during different frames (e.g., in [method Node._process], instead of a loop).
</description>
</method>
<method name="load_threaded_request">
diff --git a/doc/classes/ResourceSaver.xml b/doc/classes/ResourceSaver.xml
index 42c9bd7a3c..05c749bc24 100644
--- a/doc/classes/ResourceSaver.xml
+++ b/doc/classes/ResourceSaver.xml
@@ -26,6 +26,14 @@
Returns the list of extensions available for saving a resource of a given type.
</description>
</method>
+ <method name="get_resource_id_for_path">
+ <return type="int" />
+ <param index="0" name="path" type="String" />
+ <param index="1" name="generate" type="bool" default="false" />
+ <description>
+ Returns the resource ID for the given path. If [param generate] is [code]true[/code], a new resource ID will be generated if one for the path is not found. If [param generate] is [code]false[/code] and the path is not found, [constant ResourceUID.INVALID_ID] is returned.
+ </description>
+ </method>
<method name="remove_resource_format_saver">
<return type="void" />
<param index="0" name="format_saver" type="ResourceFormatSaver" />
diff --git a/doc/classes/ResourceUID.xml b/doc/classes/ResourceUID.xml
index 8b990b132a..24853d462d 100644
--- a/doc/classes/ResourceUID.xml
+++ b/doc/classes/ResourceUID.xml
@@ -4,7 +4,7 @@
A singleton that manages the unique identifiers of all resources within a project.
</brief_description>
<description>
- Resource UIDs (Unique IDentifiers) allow the engine to keep references between resources intact, even if files can renamed or moved. They can be accessed with [code]uid://[/code].
+ Resource UIDs (Unique IDentifiers) allow the engine to keep references between resources intact, even if files are renamed or moved. They can be accessed with [code]uid://[/code].
[ResourceUID] keeps track of all registered resource UIDs in a project, generates new UIDs, and converts between their string and integer representations.
</description>
<tutorials>
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index 24d2d26beb..8472e57840 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -70,7 +70,7 @@
<param index="0" name="character" type="int" />
<description>
Returns the line number of the character position provided. Line and character numbers are both zero-indexed.
- [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
+ [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
</description>
</method>
<method name="get_character_paragraph">
@@ -78,28 +78,28 @@
<param index="0" name="character" type="int" />
<description>
Returns the paragraph number of the character position provided. Paragraph and character numbers are both zero-indexed.
- [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
+ [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
</description>
</method>
<method name="get_content_height" qualifiers="const">
<return type="int" />
<description>
Returns the height of the content.
- [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
+ [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
</description>
</method>
<method name="get_content_width" qualifiers="const">
<return type="int" />
<description>
Returns the width of the content.
- [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
+ [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
</description>
</method>
<method name="get_line_count" qualifiers="const">
<return type="int" />
<description>
Returns the total number of lines in the text. Wrapped text is counted as multiple lines.
- [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
+ [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
</description>
</method>
<method name="get_line_offset">
@@ -107,7 +107,7 @@
<param index="0" name="line" type="int" />
<description>
Returns the vertical offset of the line found at the provided index.
- [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
+ [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
</description>
</method>
<method name="get_menu" qualifiers="const">
@@ -167,7 +167,7 @@
<param index="0" name="paragraph" type="int" />
<description>
Returns the vertical offset of the paragraph found at the provided index.
- [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
+ [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
</description>
</method>
<method name="get_parsed_text" qualifiers="const">
@@ -211,22 +211,22 @@
<return type="int" />
<description>
Returns the number of visible lines.
- [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
+ [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
</description>
</method>
<method name="get_visible_paragraph_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of visible paragraphs. A paragraph is considered visible if at least one of its lines is visible.
- [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
+ [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded.
</description>
</method>
<method name="install_effect">
<return type="void" />
<param index="0" name="effect" type="Variant" />
<description>
- Installs a custom effect. This can also be done in the RichTextLabel inspector using the [member custom_effects] property. [param effect] should be a valid [RichTextEffect].
- Example RichTextEffect:
+ Installs a custom effect. This can also be done in the Inspector through the [member custom_effects] property. [param effect] should be a valid [RichTextEffect].
+ [b]Example:[/b] With the following script extending from [RichTextEffect]:
[codeblock]
# effect.gd
class_name MyCustomEffect
@@ -236,7 +236,7 @@
# ...
[/codeblock]
- Registering the above effect in RichTextLabel from script:
+ The above effect can be installed in [RichTextLabel] from a script:
[codeblock]
# rich_text_label.gd
extends RichTextLabel
@@ -256,13 +256,19 @@
Invalidates [param paragraph] and all subsequent paragraphs cache.
</description>
</method>
+ <method name="is_finished" qualifiers="const">
+ <return type="bool" />
+ <description>
+ If [member threaded] is enabled, returns [code]true[/code] if the background thread has finished text processing, otherwise always return [code]true[/code].
+ </description>
+ </method>
<method name="is_menu_visible" qualifiers="const">
<return type="bool" />
<description>
Returns whether the menu is visible. Use this instead of [code]get_menu().visible[/code] to improve performance (so the creation of the menu is avoided).
</description>
</method>
- <method name="is_ready" qualifiers="const">
+ <method name="is_ready" qualifiers="const" deprecated="Use [method is_finished] instead.">
<return type="bool" />
<description>
If [member threaded] is enabled, returns [code]true[/code] if the background thread has finished text processing, otherwise always return [code]true[/code].
@@ -432,7 +438,7 @@
Adds [code skip-lint][ol][/code] or [code skip-lint][ul][/code] tag to the tag stack. Multiplies [param level] by current [member tab_size] to determine new margin length.
</description>
</method>
- <method name="push_meta">
+ <method name="push_meta" keywords="push_url">
<return type="void" />
<param index="0" name="data" type="Variant" />
<param index="1" name="underline_mode" type="int" enum="RichTextLabel.MetaUnderline" default="1" />
@@ -625,10 +631,16 @@
<member name="hint_underlined" type="bool" setter="set_hint_underline" getter="is_hint_underlined" default="true">
If [code]true[/code], the label underlines hint tags such as [code skip-lint][hint=description]{text}[/hint][/code].
</member>
+ <member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0">
+ Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
+ </member>
+ <member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
+ Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
+ </member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</member>
- <member name="meta_underlined" type="bool" setter="set_meta_underline" getter="is_meta_underlined" default="true">
+ <member name="meta_underlined" type="bool" setter="set_meta_underline" getter="is_meta_underlined" default="true" keywords="url_underlined">
If [code]true[/code], the label underlines meta tags such as [code skip-lint][url]{text}[/url][/code]. These tags can call a function when clicked if [signal meta_clicked] is connected to a function.
</member>
<member name="progress_bar_delay" type="int" setter="set_progress_bar_delay" getter="get_progress_bar_delay" default="1000">
@@ -656,6 +668,9 @@
<member name="tab_size" type="int" setter="set_tab_size" getter="get_tab_size" default="4">
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="tab_stops" type="PackedFloat32Array" setter="set_tab_stops" getter="get_tab_stops" default="PackedFloat32Array()">
+ Aligns text to the given tab-stops.
+ </member>
<member name="text" type="String" setter="set_text" getter="get_text" 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] If [member bbcode_enabled] is [code]true[/code], it is unadvised to use the [code]+=[/code] operator with [member text] (e.g. [code]text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. It will also erase all BBCode that was added to stack using [code]push_*[/code] methods. Use [method append_text] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
@@ -795,7 +810,7 @@
The default background color for odd rows.
</theme_item>
<theme_item name="line_separation" data_type="constant" type="int" default="0">
- The vertical space between lines.
+ Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml
index dae904e2a3..9a299ade57 100644
--- a/doc/classes/RigidBody3D.xml
+++ b/doc/classes/RigidBody3D.xml
@@ -179,7 +179,7 @@
For a body that is always frozen, use [StaticBody3D] or [AnimatableBody3D] instead.
</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 [member ProjectSettings.physics/3d/default_gravity] to produce this body's gravity. For example, a value of [code]1.0[/code] will apply normal gravity, [code]2.0[/code] will apply double the gravity, and [code]0.5[/code] will apply half the gravity to this body.
</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.
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index bae5fe1205..77baef9d08 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -156,7 +156,7 @@
<param index="0" name="group" type="StringName" />
<param index="1" name="notification" type="int" />
<description>
- Calls [method Object.notification] with the given [param notification] to all nodes inside this tree added to the [param group]. See also [method call_group] and [method set_group].
+ Calls [method Object.notification] with the given [param notification] to all nodes inside this tree added to the [param group]. See also [url=$DOCS_URL/tutorials/best_practices/godot_notifications.html]Godot notifications[/url] and [method call_group] and [method set_group].
[b]Note:[/b] This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations.
</description>
</method>
diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml
index fa8e4ef5f2..80aad9d30d 100644
--- a/doc/classes/Script.xml
+++ b/doc/classes/Script.xml
@@ -58,6 +58,12 @@
Returns the default value of the specified property.
</description>
</method>
+ <method name="get_rpc_config" qualifiers="const">
+ <return type="Variant" />
+ <description>
+ Returns a [Dictionary] mapping method names to their RPC configuration defined by this script.
+ </description>
+ </method>
<method name="get_script_constant_map">
<return type="Dictionary" />
<description>
@@ -93,6 +99,7 @@
<return type="bool" />
<description>
Returns [code]true[/code] if the script contains non-empty source code.
+ [b]Note:[/b] If a script does not have source code, this does not mean that it is invalid or unusable. For example, a [GDScript] that was exported with binary tokenization has no source code, but still behaves as expected and could be instantiated. This can be checked with [method can_instantiate].
</description>
</method>
<method name="instance_has" qualifiers="const">
diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml
index 43ee4dda60..67a2af2932 100644
--- a/doc/classes/ScriptEditor.xml
+++ b/doc/classes/ScriptEditor.xml
@@ -10,6 +10,12 @@
<tutorials>
</tutorials>
<methods>
+ <method name="get_breakpoints">
+ <return type="PackedStringArray" />
+ <description>
+ Returns array of breakpoints.
+ </description>
+ </method>
<method name="get_current_editor" qualifiers="const">
<return type="ScriptEditorBase" />
<description>
@@ -40,7 +46,6 @@
<description>
Opens help for the given topic. The [param topic] is an encoded string that controls which class, method, constant, signal, annotation, property, or theme item should be focused.
The supported [param topic] formats include [code]class_name:class[/code], [code]class_method:class:method[/code], [code]class_constant:class:constant[/code], [code]class_signal:class:signal[/code], [code]class_annotation:class:@annotation[/code], [code]class_property:class:property[/code], and [code]class_theme_item:class:item[/code], where [code]class[/code] is the class name, [code]method[/code] is the method name, [code]constant[/code] is the constant name, [code]signal[/code] is the signal name, [code]annotation[/code] is the annotation name, [code]property[/code] is the property name, and [code]item[/code] is the theme item.
- [b]Examples:[/b]
[codeblock]
# Shows help for the Node class.
class_name:Node
@@ -94,6 +99,14 @@
[b]Note:[/b] The [EditorSyntaxHighlighter] will still be applied to scripts that are already opened.
</description>
</method>
+ <method name="update_docs_from_script">
+ <return type="void" />
+ <param index="0" name="script" type="Script" />
+ <description>
+ Updates the documentation for the given [param script] if the script's documentation is currently open.
+ [b]Note:[/b] This should be called whenever the script is changed to keep the open documentation state up to date.
+ </description>
+ </method>
</methods>
<signals>
<signal name="editor_script_changed">
diff --git a/doc/classes/ScriptEditorBase.xml b/doc/classes/ScriptEditorBase.xml
index 403608355a..638bc921d6 100644
--- a/doc/classes/ScriptEditorBase.xml
+++ b/doc/classes/ScriptEditorBase.xml
@@ -72,7 +72,7 @@
</description>
</signal>
<signal name="request_save_previous_state">
- <param index="0" name="line" type="int" />
+ <param index="0" name="state" type="Dictionary" />
<description>
Emitted when the user changes current script or moves caret by 10 or more columns within the same script.
</description>
diff --git a/doc/classes/ScriptLanguageExtension.xml b/doc/classes/ScriptLanguageExtension.xml
index cc47ca274d..f9d9e4f513 100644
--- a/doc/classes/ScriptLanguageExtension.xml
+++ b/doc/classes/ScriptLanguageExtension.xml
@@ -314,6 +314,13 @@
<description>
</description>
</method>
+ <method name="_reload_scripts" qualifiers="virtual">
+ <return type="void" />
+ <param index="0" name="scripts" type="Array" />
+ <param index="1" name="soft_reload" type="bool" />
+ <description>
+ </description>
+ </method>
<method name="_reload_tool_script" qualifiers="virtual">
<return type="void" />
<param index="0" name="script" type="Script" />
diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml
index 2181194fd4..405bba3564 100644
--- a/doc/classes/ScrollContainer.xml
+++ b/doc/classes/ScrollContainer.xml
@@ -102,6 +102,9 @@
<constant name="SCROLL_MODE_SHOW_NEVER" value="3" enum="ScrollMode">
Scrolling enabled, scrollbar will be hidden.
</constant>
+ <constant name="SCROLL_MODE_RESERVE" value="4" enum="ScrollMode">
+ Combines [constant SCROLL_MODE_AUTO] and [constant SCROLL_MODE_SHOW_ALWAYS]. The scrollbar is only visible if necessary, but the content size is adjusted as if it was always visible. It's useful for ensuring that content size stays the same regardless if the scrollbar is visible.
+ </constant>
</constants>
<theme_items>
<theme_item name="panel" data_type="style" type="StyleBox">
diff --git a/doc/classes/Semaphore.xml b/doc/classes/Semaphore.xml
index d0db24dfb7..3ecb5c23af 100644
--- a/doc/classes/Semaphore.xml
+++ b/doc/classes/Semaphore.xml
@@ -17,8 +17,9 @@
<methods>
<method name="post">
<return type="void" />
+ <param index="0" name="count" type="int" default="1" />
<description>
- Lowers the [Semaphore], allowing one more thread in.
+ Lowers the [Semaphore], allowing one thread in, or more if [param count] is specified.
</description>
</method>
<method name="try_wait">
diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml
index b71f9ca1b0..3fbe1da687 100644
--- a/doc/classes/Shader.xml
+++ b/doc/classes/Shader.xml
@@ -12,7 +12,7 @@
</tutorials>
<methods>
<method name="get_default_texture_parameter" qualifiers="const">
- <return type="Texture2D" />
+ <return type="Texture" />
<param index="0" name="name" type="StringName" />
<param index="1" name="index" type="int" default="0" />
<description>
@@ -31,14 +31,20 @@
<return type="Array" />
<param index="0" name="get_groups" type="bool" default="false" />
<description>
- Get the list of shader uniforms that can be assigned to a [ShaderMaterial], for use with [method ShaderMaterial.set_shader_parameter] and [method ShaderMaterial.get_shader_parameter]. The parameters returned are contained in dictionaries in a similar format to the ones returned by [method Object.get_property_list].
- If argument [param get_groups] is true, parameter grouping hints will be provided.
+ Returns the list of shader uniforms that can be assigned to a [ShaderMaterial], for use with [method ShaderMaterial.set_shader_parameter] and [method ShaderMaterial.get_shader_parameter]. The parameters returned are contained in dictionaries in a similar format to the ones returned by [method Object.get_property_list].
+ If argument [param get_groups] is [code]true[/code], parameter grouping hints are also included in the list.
+ </description>
+ </method>
+ <method name="inspect_native_shader_code">
+ <return type="void" />
+ <description>
+ Only available when running in the editor. Opens a popup that visualizes the generated shader code, including all variants and internal shader code. See also [method Material.inspect_native_shader_code].
</description>
</method>
<method name="set_default_texture_parameter">
<return type="void" />
<param index="0" name="name" type="StringName" />
- <param index="1" name="texture" type="Texture2D" />
+ <param index="1" name="texture" type="Texture" />
<param index="2" name="index" type="int" default="0" />
<description>
Sets the default texture to be used with a texture uniform. The default is used if a texture is not set in the [ShaderMaterial].
diff --git a/doc/classes/ShapeCast2D.xml b/doc/classes/ShapeCast2D.xml
index 576bd62cc3..6f5da28825 100644
--- a/doc/classes/ShapeCast2D.xml
+++ b/doc/classes/ShapeCast2D.xml
@@ -15,7 +15,7 @@
<return type="void" />
<param index="0" name="node" type="CollisionObject2D" />
<description>
- Adds a collision exception so the shape does not report collisions with the specified [CollisionObject2D] node.
+ Adds a collision exception so the shape does not report collisions with the specified node.
</description>
</method>
<method name="add_exception_rid">
@@ -35,19 +35,19 @@
<return type="void" />
<description>
Updates the collision information for the shape immediately, without waiting for the next [code]_physics_process[/code] call. Use this method, for example, when the shape or its parent has changed state.
- [b]Note:[/b] [code]enabled == true[/code] is not required for this to work.
+ [b]Note:[/b] Setting [member enabled] to [code]true[/code] is not required for this to work.
</description>
</method>
<method name="get_closest_collision_safe_fraction" qualifiers="const">
<return type="float" />
<description>
- The fraction from the [ShapeCast2D]'s origin to its [member target_position] (between 0 and 1) of how far the shape can move without triggering a collision.
+ Returns the fraction from this cast's origin to its [member target_position] of how far the shape can move without triggering a collision, as a value between [code]0.0[/code] and [code]1.0[/code].
</description>
</method>
<method name="get_closest_collision_unsafe_fraction" qualifiers="const">
<return type="float" />
<description>
- The fraction from the [ShapeCast2D]'s origin to its [member target_position] (between 0 and 1) of how far the shape must move to trigger a collision.
+ Returns the fraction from this cast's origin to its [member target_position] of how far the shape must move to trigger a collision, as a value between [code]0.0[/code] and [code]1.0[/code].
In ideal conditions this would be the same as [method get_closest_collision_safe_fraction], however shape casting is calculated in discrete steps, so the precise point of collision can occur between two calculated positions.
</description>
</method>
@@ -97,7 +97,7 @@
<param index="0" name="index" type="int" />
<description>
Returns the collision point of one of the multiple collisions at [param index] where the shape intersects the colliding object.
- [b]Note:[/b] this point is in the [b]global[/b] coordinate system.
+ [b]Note:[/b] This point is in the [b]global[/b] coordinate system.
</description>
</method>
<method name="is_colliding" qualifiers="const">
@@ -110,7 +110,7 @@
<return type="void" />
<param index="0" name="node" type="CollisionObject2D" />
<description>
- Removes a collision exception so the shape does report collisions with the specified [CollisionObject2D] node.
+ Removes a collision exception so the shape does report collisions with the specified node.
</description>
</method>
<method name="remove_exception_rid">
@@ -137,9 +137,9 @@
If [code]true[/code], collisions with [PhysicsBody2D]s will be reported.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
- The shape's collision mask. Only objects in at least one collision layer enabled in the mask will be detected.
+ The shape's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
- <member name="collision_result" type="Array" setter="" getter="_get_collision_result" default="[]">
+ <member name="collision_result" type="Array" setter="" getter="get_collision_result" default="[]">
Returns the complete collision information from the collision sweep. The data returned is the same as in the [method PhysicsDirectSpaceState2D.get_rest_info] method.
</member>
<member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true">
@@ -155,10 +155,10 @@
The number of intersections can be limited with this parameter, to reduce the processing time.
</member>
<member name="shape" type="Shape2D" setter="set_shape" getter="get_shape">
- The [Shape2D]-derived shape to be used for collision queries.
+ The shape to be used for collision queries.
</member>
<member name="target_position" type="Vector2" setter="set_target_position" getter="get_target_position" default="Vector2(0, 50)">
- The shape's destination point, relative to this node's [code]position[/code].
+ The shape's destination point, relative to this node's [member Node2D.position].
</member>
</members>
</class>
diff --git a/doc/classes/ShapeCast3D.xml b/doc/classes/ShapeCast3D.xml
index 2c6efe2ebe..ba0b021b4d 100644
--- a/doc/classes/ShapeCast3D.xml
+++ b/doc/classes/ShapeCast3D.xml
@@ -15,7 +15,7 @@
<return type="void" />
<param index="0" name="node" type="CollisionObject3D" />
<description>
- Adds a collision exception so the shape does not report collisions with the specified [CollisionObject3D] node.
+ Adds a collision exception so the shape does not report collisions with the specified node.
</description>
</method>
<method name="add_exception_rid">
@@ -28,26 +28,26 @@
<method name="clear_exceptions">
<return type="void" />
<description>
- Removes all collision exceptions for this [ShapeCast3D].
+ Removes all collision exceptions for this shape.
</description>
</method>
<method name="force_shapecast_update">
<return type="void" />
<description>
Updates the collision information for the shape immediately, without waiting for the next [code]_physics_process[/code] call. Use this method, for example, when the shape or its parent has changed state.
- [b]Note:[/b] [code]enabled == true[/code] is not required for this to work.
+ [b]Note:[/b] Setting [member enabled] to [code]true[/code] is not required for this to work.
</description>
</method>
<method name="get_closest_collision_safe_fraction" qualifiers="const">
<return type="float" />
<description>
- The fraction from the [ShapeCast3D]'s origin to its [member target_position] (between 0 and 1) of how far the shape can move without triggering a collision.
+ Returns the fraction from this cast's origin to its [member target_position] of how far the shape can move without triggering a collision, as a value between [code]0.0[/code] and [code]1.0[/code].
</description>
</method>
<method name="get_closest_collision_unsafe_fraction" qualifiers="const">
<return type="float" />
<description>
- The fraction from the [ShapeCast3D]'s origin to its [member target_position] (between 0 and 1) of how far the shape must move to trigger a collision.
+ Returns the fraction from this cast's origin to its [member target_position] of how far the shape must move to trigger a collision, as a value between [code]0.0[/code] and [code]1.0[/code].
In ideal conditions this would be the same as [method get_closest_collision_safe_fraction], however shape casting is calculated in discrete steps, so the precise point of collision can occur between two calculated positions.
</description>
</method>
@@ -97,7 +97,7 @@
<param index="0" name="index" type="int" />
<description>
Returns the collision point of one of the multiple collisions at [param index] where the shape intersects the colliding object.
- [b]Note:[/b] this point is in the [b]global[/b] coordinate system.
+ [b]Note:[/b] This point is in the [b]global[/b] coordinate system.
</description>
</method>
<method name="is_colliding" qualifiers="const">
@@ -110,7 +110,7 @@
<return type="void" />
<param index="0" name="node" type="CollisionObject3D" />
<description>
- Removes a collision exception so the shape does report collisions with the specified [CollisionObject3D] node.
+ Removes a collision exception so the shape does report collisions with the specified node.
</description>
</method>
<method name="remove_exception_rid">
@@ -146,7 +146,7 @@
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
The shape's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
- <member name="collision_result" type="Array" setter="" getter="_get_collision_result" default="[]">
+ <member name="collision_result" type="Array" setter="" getter="get_collision_result" default="[]">
Returns the complete collision information from the collision sweep. The data returned is the same as in the [method PhysicsDirectSpaceState3D.get_rest_info] method.
</member>
<member name="debug_shape_custom_color" type="Color" setter="set_debug_shape_custom_color" getter="get_debug_shape_custom_color" default="Color(0, 0, 0, 1)">
@@ -166,10 +166,10 @@
The number of intersections can be limited with this parameter, to reduce the processing time.
</member>
<member name="shape" type="Shape3D" setter="set_shape" getter="get_shape">
- The [Shape3D]-derived shape to be used for collision queries.
+ The shape to be used for collision queries.
</member>
<member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3(0, -1, 0)">
- The shape's destination point, relative to this node's [code]position[/code].
+ The shape's destination point, relative to this node's [member Node3D.position].
</member>
</members>
</class>
diff --git a/doc/classes/Shortcut.xml b/doc/classes/Shortcut.xml
index 4343a789fd..c0ff3ebdb5 100644
--- a/doc/classes/Shortcut.xml
+++ b/doc/classes/Shortcut.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
Shortcuts are commonly used for interacting with a [Control] element from an [InputEvent] (also known as hotkeys).
- One shortcut can contain multiple [InputEvent]'s, allowing the possibility of triggering one action with multiple different inputs.
+ One shortcut can contain multiple [InputEvent]s, allowing the possibility of triggering one action with multiple different inputs.
</description>
<tutorials>
</tutorials>
@@ -26,7 +26,7 @@
<return type="bool" />
<param index="0" name="event" type="InputEvent" />
<description>
- Returns whether any [InputEvent] in [member events] equals [param event].
+ Returns whether any [InputEvent] in [member events] equals [param event]. This uses [method InputEvent.is_match] to compare events.
</description>
</method>
</methods>
diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml
index 07e15d0b23..b9ec34956f 100644
--- a/doc/classes/Signal.xml
+++ b/doc/classes/Signal.xml
@@ -4,7 +4,7 @@
A built-in type representing a signal of an [Object].
</brief_description>
<description>
- [Signal] is a built-in [Variant] type that represents a signal of an [Object] instance. Like all [Variant] types, it can be stored in variables and passed to functions. Signals allow all connected [Callable]s (and by extension their respective objects) to listen and react to events, without directly referencing one another. This keeps the code flexible and easier to manage.
+ [Signal] is a built-in [Variant] type that represents a signal of an [Object] instance. Like all [Variant] types, it can be stored in variables and passed to functions. Signals allow all connected [Callable]s (and by extension their respective objects) to listen and react to events, without directly referencing one another. This keeps the code flexible and easier to manage. You can check whether an [Object] has a given signal name using [method Object.has_signal].
In GDScript, signals can be declared with the [code]signal[/code] keyword. In C#, you may use the [code][Signal][/code] attribute on a delegate.
[codeblocks]
[gdscript]
@@ -48,7 +48,7 @@
<param index="0" name="object" type="Object" />
<param index="1" name="signal" type="StringName" />
<description>
- Creates a new [Signal] named [param signal] in the specified [param object].
+ Creates a [Signal] object referencing a signal named [param signal] in the specified [param object].
</description>
</constructor>
</constructors>
@@ -109,6 +109,12 @@
Returns the ID of the object emitting this signal (see [method Object.get_instance_id]).
</description>
</method>
+ <method name="has_connections" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if any [Callable] is connected to this signal.
+ </description>
+ </method>
<method name="is_connected" qualifiers="const">
<return type="bool" />
<param index="0" name="callable" type="Callable" />
@@ -119,7 +125,7 @@
<method name="is_null" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the signal's name does not exist in its object, or the object is not valid.
+ Returns [code]true[/code] if this [Signal] has no object and the signal name is empty. Equivalent to [code]signal == Signal()[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml
index 1167b70c8d..f5b808be8e 100644
--- a/doc/classes/Skeleton3D.xml
+++ b/doc/classes/Skeleton3D.xml
@@ -57,11 +57,6 @@
Force updates the bone transform for the bone at [param bone_idx] and all of its children.
</description>
</method>
- <method name="get_animate_physical_bones" qualifiers="const" deprecated="">
- <return type="bool" />
- <description>
- </description>
- </method>
<method name="get_bone_children" qualifiers="const">
<return type="PackedInt32Array" />
<param index="0" name="bone_idx" type="int" />
@@ -104,6 +99,21 @@
Returns the global rest transform for [param bone_idx].
</description>
</method>
+ <method name="get_bone_meta" qualifiers="const">
+ <return type="Variant" />
+ <param index="0" name="bone_idx" type="int" />
+ <param index="1" name="key" type="StringName" />
+ <description>
+ Returns bone metadata for [param bone_idx] with [param key].
+ </description>
+ </method>
+ <method name="get_bone_meta_list" qualifiers="const">
+ <return type="StringName[]" />
+ <param index="0" name="bone_idx" type="int" />
+ <description>
+ Returns a list of all metadata keys for [param bone_idx].
+ </description>
+ </method>
<method name="get_bone_name" qualifiers="const">
<return type="String" />
<param index="0" name="bone_idx" type="int" />
@@ -176,6 +186,14 @@
Use for invalidating caches in IK solvers and other nodes which process bones.
</description>
</method>
+ <method name="has_bone_meta" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="bone_idx" type="int" />
+ <param index="1" name="key" type="StringName" />
+ <description>
+ Returns whether there exists any bone metadata for [param bone_idx] with key [param key].
+ </description>
+ </method>
<method name="is_bone_enabled" qualifiers="const">
<return type="bool" />
<param index="0" name="bone_idx" type="int" />
@@ -239,12 +257,6 @@
Sets all bone poses to rests.
</description>
</method>
- <method name="set_animate_physical_bones" deprecated="">
- <return type="void" />
- <param index="0" name="enabled" type="bool" />
- <description>
- </description>
- </method>
<method name="set_bone_enabled">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
@@ -274,6 +286,15 @@
[b]Note:[/b] The pose transform needs to be a global pose! To convert a world transform from a [Node3D] to a global bone pose, multiply the [method Transform3D.affine_inverse] of the node's [member Node3D.global_transform] by the desired world transform.
</description>
</method>
+ <method name="set_bone_meta">
+ <return type="void" />
+ <param index="0" name="bone_idx" type="int" />
+ <param index="1" name="key" type="StringName" />
+ <param index="2" name="value" type="Variant" />
+ <description>
+ Sets bone metadata for [param bone_idx], will set the [param key] meta to [param value].
+ </description>
+ </method>
<method name="set_bone_name">
<return type="void" />
<param index="0" name="bone_idx" type="int" />
@@ -340,6 +361,10 @@
</method>
</methods>
<members>
+ <member name="animate_physical_bones" type="bool" setter="set_animate_physical_bones" getter="get_animate_physical_bones" default="true" deprecated="">
+ If you follow the recommended workflow and explicitly have [PhysicalBoneSimulator3D] as a child of [Skeleton3D], you can control whether it is affected by raycasting without running [method physical_bones_start_simulation], by its [member SkeletonModifier3D.active].
+ However, for old (deprecated) configurations, [Skeleton3D] has an internal virtual [PhysicalBoneSimulator3D] for compatibility. This property controls the internal virtual [PhysicalBoneSimulator3D]'s [member SkeletonModifier3D.active].
+ </member>
<member name="modifier_callback_mode_process" type="int" setter="set_modifier_callback_mode_process" getter="get_modifier_callback_mode_process" enum="Skeleton3D.ModifierCallbackModeProcess" default="1">
Sets the processing timing for the Modifier.
</member>
diff --git a/doc/classes/SkeletonIK3D.xml b/doc/classes/SkeletonIK3D.xml
index 4858a6ce22..dbb099a22b 100644
--- a/doc/classes/SkeletonIK3D.xml
+++ b/doc/classes/SkeletonIK3D.xml
@@ -31,7 +31,7 @@
<method name="get_parent_skeleton" qualifiers="const">
<return type="Skeleton3D" />
<description>
- Returns the parent [Skeleton3D] Node that was present when SkeletonIK entered the [SceneTree]. Returns null if the parent node was not a [Skeleton3D] Node when SkeletonIK3D entered the [SceneTree].
+ Returns the parent [Skeleton3D] node that was present when SkeletonIK entered the scene tree. Returns [code]null[/code] if the parent node was not a [Skeleton3D] node when SkeletonIK3D entered the scene tree.
</description>
</method>
<method name="is_running">
diff --git a/doc/classes/SkeletonModification2DTwoBoneIK.xml b/doc/classes/SkeletonModification2DTwoBoneIK.xml
index 1c7bb32f4a..d2417ba7bf 100644
--- a/doc/classes/SkeletonModification2DTwoBoneIK.xml
+++ b/doc/classes/SkeletonModification2DTwoBoneIK.xml
@@ -65,7 +65,7 @@
</methods>
<members>
<member name="flip_bend_direction" type="bool" setter="set_flip_bend_direction" getter="get_flip_bend_direction" default="false">
- If [code]true[/code], the bones in the modification will blend outward as opposed to inwards when contracting. If [code]false[/code], the bones will bend inwards when contracting.
+ If [code]true[/code], the bones in the modification will bend outward as opposed to inwards when contracting. If [code]false[/code], the bones will bend inwards when contracting.
</member>
<member name="target_maximum_distance" type="float" setter="set_target_maximum_distance" getter="get_target_maximum_distance" default="0.0">
The maximum distance the target can be at. If the target is farther than this distance, the modification will solve as if it's at this maximum distance. When set to [code]0[/code], the modification will solve without distance constraints.
diff --git a/doc/classes/SkeletonModifier3D.xml b/doc/classes/SkeletonModifier3D.xml
index 620eed9b70..7b1d70179a 100644
--- a/doc/classes/SkeletonModifier3D.xml
+++ b/doc/classes/SkeletonModifier3D.xml
@@ -6,9 +6,10 @@
<description>
[SkeletonModifier3D] retrieves a target [Skeleton3D] by having a [Skeleton3D] parent.
If there is [AnimationMixer], modification always performs after playback process of the [AnimationMixer].
- This node should be used to implement custom IK solvers, constraints, or skeleton physics
+ This node should be used to implement custom IK solvers, constraints, or skeleton physics.
</description>
<tutorials>
+ <link title="Design of the Skeleton Modifier 3D">https://godotengine.org/article/design-of-the-skeleton-modifier-3d/</link>
</tutorials>
<methods>
<method name="_process_modification" qualifiers="virtual">
diff --git a/doc/classes/Slider.xml b/doc/classes/Slider.xml
index a4ffa5c1e7..b1e78e8987 100644
--- a/doc/classes/Slider.xml
+++ b/doc/classes/Slider.xml
@@ -28,12 +28,12 @@
<signal name="drag_ended">
<param index="0" name="value_changed" type="bool" />
<description>
- Emitted when dragging stops. If [param value_changed] is true, [member Range.value] is different from the value when you started the dragging.
+ Emitted when the grabber stops being dragged. If [param value_changed] is [code]true[/code], [member Range.value] is different from the value when the dragging was started.
</description>
</signal>
<signal name="drag_started">
<description>
- Emitted when dragging is started. This is emitted before the corresponding [signal Range.value_changed] signal.
+ Emitted when the grabber starts being dragged. This is emitted before the corresponding [signal Range.value_changed] signal.
</description>
</signal>
</signals>
diff --git a/doc/classes/SoftBody3D.xml b/doc/classes/SoftBody3D.xml
index 195196b78c..4d8791d8c1 100644
--- a/doc/classes/SoftBody3D.xml
+++ b/doc/classes/SoftBody3D.xml
@@ -87,6 +87,7 @@
<param index="0" name="point_index" type="int" />
<param index="1" name="pinned" type="bool" />
<param index="2" name="attachment_path" type="NodePath" default="NodePath(&quot;&quot;)" />
+ <param index="3" name="insert_at" type="int" default="-1" />
<description>
Sets the pinned state of a surface vertex. When set to [code]true[/code], the optional [param attachment_path] can define a [Node3D] the pinned vertex will be attached to.
</description>
diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml
index 03e247ec8a..6da6a301fe 100644
--- a/doc/classes/SpinBox.xml
+++ b/doc/classes/SpinBox.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
[SpinBox] is a numerical input text field. It allows entering integers and floating-point numbers.
- [b]Example:[/b]
+ [b]Example:[/b] Create a [SpinBox], disable its context menu and set its text alignment to right.
[codeblocks]
[gdscript]
var spin_box = SpinBox.new()
@@ -22,10 +22,9 @@
spinBox.AlignHorizontal = LineEdit.HorizontalAlignEnum.Right;
[/csharp]
[/codeblocks]
- The above code will create a [SpinBox], disable context menu on it and set the text alignment to right.
See [Range] class for more options over the [SpinBox].
[b]Note:[/b] With the [SpinBox]'s context menu disabled, you can right-click the bottom half of the spinbox to set the value to its minimum, while right-clicking the top half sets the value to its maximum.
- [b]Note:[/b] [SpinBox] relies on an underlying [LineEdit] node. To theme a [SpinBox]'s background, add theme items for [LineEdit] and customize them.
+ [b]Note:[/b] [SpinBox] relies on an underlying [LineEdit] node. To theme a [SpinBox]'s background, add theme items for [LineEdit] and customize them. The [LineEdit] has the [code]SpinBoxInnerLineEdit[/code] theme variation, so that you can give it a distinct appearance from regular [LineEdit]s.
[b]Note:[/b] If you want to implement drag and drop for the underlying [LineEdit], you can use [method Control.set_drag_forwarding] on the node returned by [method get_line_edit].
</description>
<tutorials>
@@ -71,8 +70,98 @@
</member>
</members>
<theme_items>
+ <theme_item name="down_disabled_icon_modulate" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)">
+ Down button icon modulation color, when the button is disabled.
+ </theme_item>
+ <theme_item name="down_hover_icon_modulate" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
+ Down button icon modulation color, when the button is hovered.
+ </theme_item>
+ <theme_item name="down_icon_modulate" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
+ Down button icon modulation color.
+ </theme_item>
+ <theme_item name="down_pressed_icon_modulate" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
+ Down button icon modulation color, when the button is being pressed.
+ </theme_item>
+ <theme_item name="up_disabled_icon_modulate" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)">
+ Up button icon modulation color, when the button is disabled.
+ </theme_item>
+ <theme_item name="up_hover_icon_modulate" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
+ Up button icon modulation color, when the button is hovered.
+ </theme_item>
+ <theme_item name="up_icon_modulate" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
+ Up button icon modulation color.
+ </theme_item>
+ <theme_item name="up_pressed_icon_modulate" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
+ Up button icon modulation color, when the button is being pressed.
+ </theme_item>
+ <theme_item name="buttons_vertical_separation" data_type="constant" type="int" default="0">
+ Vertical separation between the up and down buttons.
+ </theme_item>
+ <theme_item name="buttons_width" data_type="constant" type="int" default="16">
+ Width of the up and down buttons. If smaller than any icon set on the buttons, the respective icon may overlap neighboring elements. If smaller than [code]0[/code], the width is automatically adjusted from the icon size.
+ </theme_item>
+ <theme_item name="field_and_buttons_separation" data_type="constant" type="int" default="2">
+ Width of the horizontal separation between the text input field ([LineEdit]) and the buttons.
+ </theme_item>
+ <theme_item name="set_min_buttons_width_from_icons" data_type="constant" type="int" default="1" deprecated="This property exists only for compatibility with older themes. Setting [theme_item buttons_width] to a negative value has the same effect.">
+ If not [code]0[/code], the minimum button width corresponds to the widest of all icons set on those buttons, even if [theme_item buttons_width] is smaller.
+ </theme_item>
+ <theme_item name="down" data_type="icon" type="Texture2D">
+ Down button icon, displayed in the middle of the down (value-decreasing) button.
+ </theme_item>
+ <theme_item name="down_disabled" data_type="icon" type="Texture2D">
+ Down button icon when the button is disabled.
+ </theme_item>
+ <theme_item name="down_hover" data_type="icon" type="Texture2D">
+ Down button icon when the button is hovered.
+ </theme_item>
+ <theme_item name="down_pressed" data_type="icon" type="Texture2D">
+ Down button icon when the button is being pressed.
+ </theme_item>
+ <theme_item name="up" data_type="icon" type="Texture2D">
+ Up button icon, displayed in the middle of the up (value-increasing) button.
+ </theme_item>
+ <theme_item name="up_disabled" data_type="icon" type="Texture2D">
+ Up button icon when the button is disabled.
+ </theme_item>
+ <theme_item name="up_hover" data_type="icon" type="Texture2D">
+ Up button icon when the button is hovered.
+ </theme_item>
+ <theme_item name="up_pressed" data_type="icon" type="Texture2D">
+ Up button icon when the button is being pressed.
+ </theme_item>
<theme_item name="updown" data_type="icon" type="Texture2D">
- Sets a custom [Texture2D] for up and down arrows of the [SpinBox].
+ Single texture representing both the up and down buttons icons. It is displayed in the middle of the buttons and does not change upon interaction. It is recommended to use individual [theme_item up] and [theme_item down] graphics for better usability. This can also be used as additional decoration between the two buttons.
+ </theme_item>
+ <theme_item name="down_background" data_type="style" type="StyleBox">
+ Background style of the down button.
+ </theme_item>
+ <theme_item name="down_background_disabled" data_type="style" type="StyleBox">
+ Background style of the down button when disabled.
+ </theme_item>
+ <theme_item name="down_background_hovered" data_type="style" type="StyleBox">
+ Background style of the down button when hovered.
+ </theme_item>
+ <theme_item name="down_background_pressed" data_type="style" type="StyleBox">
+ Background style of the down button when being pressed.
+ </theme_item>
+ <theme_item name="field_and_buttons_separator" data_type="style" type="StyleBox">
+ [StyleBox] drawn in the space occupied by the separation between the input field and the buttons.
+ </theme_item>
+ <theme_item name="up_background" data_type="style" type="StyleBox">
+ Background style of the up button.
+ </theme_item>
+ <theme_item name="up_background_disabled" data_type="style" type="StyleBox">
+ Background style of the up button when disabled.
+ </theme_item>
+ <theme_item name="up_background_hovered" data_type="style" type="StyleBox">
+ Background style of the up button when hovered.
+ </theme_item>
+ <theme_item name="up_background_pressed" data_type="style" type="StyleBox">
+ Background style of the up button when being pressed.
+ </theme_item>
+ <theme_item name="up_down_buttons_separator" data_type="style" type="StyleBox">
+ [StyleBox] drawn in the space occupied by the separation between the up and down buttons.
</theme_item>
</theme_items>
</class>
diff --git a/doc/classes/SplitContainer.xml b/doc/classes/SplitContainer.xml
index 454a542cc8..daafbbdd87 100644
--- a/doc/classes/SplitContainer.xml
+++ b/doc/classes/SplitContainer.xml
@@ -16,13 +16,39 @@
Clamps the [member split_offset] value to not go outside the currently possible minimal and maximum values.
</description>
</method>
+ <method name="get_drag_area_control">
+ <return type="Control" />
+ <description>
+ Returns the drag area [Control]. For example, you can move a pre-configured button into the drag area [Control] so that it rides along with the split bar. Try setting the [Button] anchors to [code]center[/code] prior to the [code]reparent()[/code] call.
+ [codeblock]
+ $BarnacleButton.reparent($SplitContainer.get_drag_area_control())
+ [/codeblock]
+ [b]Note:[/b] The drag area [Control] is drawn over the [SplitContainer]'s children, so [CanvasItem] draw objects called from the [Control] and children added to the [Control] will also appear over the [SplitContainer]'s children. Try setting [member Control.mouse_filter] of custom children to [constant Control.MOUSE_FILTER_IGNORE] to prevent blocking the mouse from dragging if desired.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash.
+ </description>
+ </method>
</methods>
<members>
<member name="collapsed" type="bool" setter="set_collapsed" getter="is_collapsed" default="false">
- If [code]true[/code], the area of the first [Control] will be collapsed and the dragger will be disabled.
+ If [code]true[/code], the dragger will be disabled and the children will be sized as if the [member split_offset] was [code]0[/code].
+ </member>
+ <member name="drag_area_highlight_in_editor" type="bool" setter="set_drag_area_highlight_in_editor" getter="is_drag_area_highlight_in_editor_enabled" default="false">
+ Highlights the drag area [Rect2] so you can see where it is during development. The drag area is gold if [member dragging_enabled] is [code]true[/code], and red if [code]false[/code].
+ </member>
+ <member name="drag_area_margin_begin" type="int" setter="set_drag_area_margin_begin" getter="get_drag_area_margin_begin" default="0">
+ Reduces the size of the drag area and split bar [theme_item split_bar_background] at the beginning of the container.
+ </member>
+ <member name="drag_area_margin_end" type="int" setter="set_drag_area_margin_end" getter="get_drag_area_margin_end" default="0">
+ Reduces the size of the drag area and split bar [theme_item split_bar_background] at the end of the container.
+ </member>
+ <member name="drag_area_offset" type="int" setter="set_drag_area_offset" getter="get_drag_area_offset" default="0">
+ Shifts the drag area in the axis of the container to prevent the drag area from overlapping the [ScrollBar] or other selectable [Control] of a child node.
</member>
<member name="dragger_visibility" type="int" setter="set_dragger_visibility" getter="get_dragger_visibility" enum="SplitContainer.DraggerVisibility" default="0">
- Determines the dragger's visibility. See [enum DraggerVisibility] for details.
+ Determines the dragger's visibility. See [enum DraggerVisibility] for details. This property does not determine whether dragging is enabled or not. Use [member dragging_enabled] for that.
+ </member>
+ <member name="dragging_enabled" type="bool" setter="set_dragging_enabled" getter="is_dragging_enabled" default="true">
+ Enables or disables split dragging.
</member>
<member name="split_offset" type="int" setter="set_split_offset" getter="get_split_offset" default="0">
The initial offset of the splitting between the two [Control]s, with [code]0[/code] being at the end of the first [Control].
@@ -33,6 +59,16 @@
</member>
</members>
<signals>
+ <signal name="drag_ended">
+ <description>
+ Emitted when the user ends dragging.
+ </description>
+ </signal>
+ <signal name="drag_started">
+ <description>
+ Emitted when the user starts dragging.
+ </description>
+ </signal>
<signal name="dragged">
<param index="0" name="offset" type="int" />
<description>
@@ -42,24 +78,28 @@
</signals>
<constants>
<constant name="DRAGGER_VISIBLE" value="0" enum="DraggerVisibility">
- The split dragger is visible when the cursor hovers it.
+ The split dragger icon is always visible when [theme_item autohide] is [code]false[/code], otherwise visible only when the cursor hovers it.
+ The size of the grabber icon determines the minimum [theme_item separation].
+ The dragger icon is automatically hidden if the length of the grabber icon is longer than the split bar.
</constant>
<constant name="DRAGGER_HIDDEN" value="1" enum="DraggerVisibility">
- The split dragger is never visible.
+ The split dragger icon is never visible regardless of the value of [theme_item autohide].
+ The size of the grabber icon determines the minimum [theme_item separation].
</constant>
<constant name="DRAGGER_HIDDEN_COLLAPSED" value="2" enum="DraggerVisibility">
- The split dragger is never visible and its space collapsed.
+ The split dragger icon is not visible, and the split bar is collapsed to zero thickness.
</constant>
</constants>
<theme_items>
<theme_item name="autohide" data_type="constant" type="int" default="1">
- Boolean value. If 1 ([code]true[/code]), the grabber will hide automatically when it isn't under the cursor. If 0 ([code]false[/code]), it's always visible.
+ Boolean value. If [code]1[/code] ([code]true[/code]), the grabber will hide automatically when it isn't under the cursor. If [code]0[/code] ([code]false[/code]), it's always visible. The [member dragger_visibility] must be [constant DRAGGER_VISIBLE].
</theme_item>
<theme_item name="minimum_grab_thickness" data_type="constant" type="int" default="6">
- The minimum thickness of the area users can click on to grab the splitting line. If [theme_item separation] or [theme_item h_grabber] / [theme_item v_grabber]'s thickness are too small, this ensure that the splitting line can still be dragged.
+ The minimum thickness of the area users can click on to grab the split bar. This ensures that the split bar can still be dragged if [theme_item separation] or [theme_item h_grabber] / [theme_item v_grabber]'s size is too narrow to easily select.
</theme_item>
<theme_item name="separation" data_type="constant" type="int" default="12">
- The space between sides of the container.
+ The split bar thickness, i.e., the gap between the two children of the container. This is overridden by the size of the grabber icon if [member dragger_visibility] is set to [constant DRAGGER_VISIBLE], or [constant DRAGGER_HIDDEN], and [theme_item separation] is smaller than the size of the grabber icon in the same axis.
+ [b]Note:[/b] To obtain [theme_item separation] values less than the size of the grabber icon, for example a [code]1 px[/code] hairline, set [theme_item h_grabber] or [theme_item v_grabber] to a new [ImageTexture], which effectively sets the grabber icon size to [code]0 px[/code].
</theme_item>
<theme_item name="grabber" data_type="icon" type="Texture2D">
The icon used for the grabber drawn in the middle area.
@@ -70,5 +110,8 @@
<theme_item name="v_grabber" data_type="icon" type="Texture2D">
The icon used for the grabber drawn in the middle area when [member vertical] is [code]true[/code].
</theme_item>
+ <theme_item name="split_bar_background" data_type="style" type="StyleBox">
+ Determines the background of the split bar if its thickness is greater than zero.
+ </theme_item>
</theme_items>
</class>
diff --git a/doc/classes/SpringArm3D.xml b/doc/classes/SpringArm3D.xml
index 99389fb78d..330317f352 100644
--- a/doc/classes/SpringArm3D.xml
+++ b/doc/classes/SpringArm3D.xml
@@ -7,6 +7,7 @@
[SpringArm3D] casts a ray or a shape along its Z axis and moves all its direct children to the collision point, with an optional margin. This is useful for 3rd person cameras that move closer to the player when inside a tight space (you may need to exclude the player's collider from the [SpringArm3D]'s collision check).
</description>
<tutorials>
+ <link title="Third-person camera with spring arm">$DOCS_URL/tutorials/3d/spring_arm.html</link>
</tutorials>
<methods>
<method name="add_excluded_object">
diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml
index 10ac4b0fcc..239c4dcf09 100644
--- a/doc/classes/Sprite2D.xml
+++ b/doc/classes/Sprite2D.xml
@@ -13,8 +13,8 @@
<method name="get_rect" qualifiers="const">
<return type="Rect2" />
<description>
- Returns a [Rect2] representing the Sprite2D's boundary in local coordinates. Can be used to detect if the Sprite2D was clicked.
- [b]Example:[/b]
+ Returns a [Rect2] representing the Sprite2D's boundary in local coordinates.
+ [b]Example:[/b] Detect if the Sprite2D was clicked:
[codeblocks]
[gdscript]
func _input(event):
@@ -76,7 +76,7 @@
If [code]true[/code], texture is cut from a larger atlas texture. See [member region_rect].
</member>
<member name="region_filter_clip_enabled" type="bool" setter="set_region_filter_clip_enabled" getter="is_region_filter_clip_enabled" default="false">
- If [code]true[/code], the outermost pixels get blurred out. [member region_enabled] must be [code]true[/code].
+ If [code]true[/code], the area outside of the [member region_rect] is clipped to avoid bleeding of the surrounding texture pixels. [member region_enabled] must be [code]true[/code].
</member>
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)">
The region of the atlas texture to display. [member region_enabled] must be [code]true[/code].
diff --git a/doc/classes/SpriteFrames.xml b/doc/classes/SpriteFrames.xml
index fd8c15c560..b891f4adcd 100644
--- a/doc/classes/SpriteFrames.xml
+++ b/doc/classes/SpriteFrames.xml
@@ -39,6 +39,14 @@
Removes all animations. An empty [code]default[/code] animation will be created.
</description>
</method>
+ <method name="duplicate_animation">
+ <return type="void" />
+ <param index="0" name="anim_from" type="StringName" />
+ <param index="1" name="anim_to" type="StringName" />
+ <description>
+ Duplicates the animation [param anim_from] to a new animation named [param anim_to]. Fails if [param anim_to] already exists, or if [param anim_from] does not exist.
+ </description>
+ </method>
<method name="get_animation_loop" qualifiers="const">
<return type="bool" />
<param index="0" name="anim" type="StringName" />
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 450e483f69..e59734cf03 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -6,7 +6,8 @@
<description>
This is the built-in string Variant type (and the one used by GDScript). Strings may contain any number of Unicode characters, and expose methods useful for manipulating and generating strings. Strings are reference-counted and use a copy-on-write approach (every modification to a string returns a new [String]), so passing them around is cheap in resources.
Some string methods have corresponding variations. Variations suffixed with [code]n[/code] ([method countn], [method findn], [method replacen], etc.) are [b]case-insensitive[/b] (they make no distinction between uppercase and lowercase letters). Method variations prefixed with [code]r[/code] ([method rfind], [method rsplit], etc.) are reversed, and start from the end of the string, instead of the beginning.
- [b]Note:[/b] In a boolean context, a string will evaluate to [code]false[/code] if it is empty ([code]""[/code]). Otherwise, a string will always evaluate to [code]true[/code]. The [code]not[/code] operator cannot be used. Instead, [method is_empty] should be used to check for empty strings.
+ To convert any Variant to or from a string, see [method @GlobalScope.str], [method @GlobalScope.str_to_var], and [method @GlobalScope.var_to_str].
+ [b]Note:[/b] In a boolean context, a string will evaluate to [code]false[/code] if it is empty ([code]""[/code]). Otherwise, a string will always evaluate to [code]true[/code].
</description>
<tutorials>
<link title="GDScript format strings">$DOCS_URL/tutorials/scripting/gdscript/gdscript_format_string.html</link>
@@ -247,7 +248,7 @@
<param index="1" name="placeholder" type="String" default="&quot;{_}&quot;" />
<description>
Formats the string by replacing all occurrences of [param placeholder] with the elements of [param values].
- [param values] can be a [Dictionary] or an [Array]. Any underscores in [param placeholder] will be replaced with the corresponding keys in advance. Array elements use their index as keys.
+ [param values] can be a [Dictionary], an [Array] or an [Object]. Any underscores in [param placeholder] will be replaced with the corresponding keys in advance. Array elements use their index as keys.
[codeblock]
# Prints "Waiting for Godot is a play by Samuel Beckett, and Godot Engine is named after it."
var use_array_values = "Waiting for {0} is a play by {1}, and {0} Engine is named after it."
@@ -262,13 +263,19 @@
print("User {} is {}.".format([42, "Godot"], "{}"))
print("User {id} is {name}.".format([["id", 42], ["name", "Godot"]]))
[/codeblock]
+ When passing an [Object], the property names from [method Object.get_property_list] are used as keys.
+ [codeblock]
+ # Prints: Visible true, position (0, 0).
+ var node = Node2D.new()
+ print("Visible {visible}, position {position}".format(node))
+ [/codeblock]
See also the [url=$DOCS_URL/tutorials/scripting/gdscript/gdscript_format_string.html]GDScript format string[/url] tutorial.
- [b]Note:[/b] The replacement of placeholders is not done all at once, instead each placeholder is replaced in the order they are passed, this means that if one of the replacement strings contains a key it will also be replaced. This can be very powerful, but can also cause unexpected results if you are not careful. If you do not need to perform replacement in the replacement strings, make sure your replacements do not contain placeholders to ensure reliable results.
+ [b]Note:[/b] Each replacement is done sequentially for each element of [param values], [b]not[/b] all at once. This means that if any element is inserted and it contains another placeholder, it may be changed by the next replacement. While this can be very useful, it often causes unexpected results. If not necessary, make sure [param values]'s elements do not contain placeholders.
[codeblock]
- print("{0} {1}".format(["{1}", "x"])) # Prints "x x".
- print("{0} {1}".format(["x", "{0}"])) # Prints "x {0}".
- print("{foo} {bar}".format({"foo": "{bar}", "bar": "baz"})) # Prints "baz baz".
- print("{foo} {bar}".format({"bar": "baz", "foo": "{bar}"})) # Prints "{bar} baz".
+ print("{0} {1}".format(["{1}", "x"])) # Prints "x x".
+ print("{0} {1}".format(["x", "{0}"])) # Prints "x {0}".
+ print("{a} {b}".format({"a": "{b}", "b": "c"})) # Prints "c c".
+ print("{a} {b}".format({"b": "c", "a": "{b}"})) # Prints "{b} c".
[/codeblock]
[b]Note:[/b] In C#, it's recommended to [url=https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated]interpolate strings with "$"[/url], instead.
</description>
@@ -324,7 +331,6 @@
<description>
Splits the string using a [param delimiter] and returns the substring at index [param slice]. Returns the original string if [param delimiter] does not occur in the string. Returns an empty string if the [param slice] does not exist.
This is faster than [method split], if you only need one substring.
- [b]Example:[/b]
[codeblock]
print("i/am/example/hi".get_slice("/", 2)) # Prints "example"
[/codeblock]
@@ -452,6 +458,19 @@
Returns [code]true[/code] if all characters of this string can be found in [param text] in their original order, [b]ignoring case[/b].
</description>
</method>
+ <method name="is_valid_ascii_identifier" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if this string is a valid ASCII identifier. A valid ASCII identifier may contain only letters, digits, and underscores ([code]_[/code]), and the first character may not be a digit.
+ [codeblock]
+ print("node_2d".is_valid_ascii_identifier()) # Prints true
+ print("TYPE_FLOAT".is_valid_ascii_identifier()) # Prints true
+ print("1st_method".is_valid_ascii_identifier()) # Prints false
+ print("MyMethod#2".is_valid_ascii_identifier()) # Prints false
+ [/codeblock]
+ See also [method is_valid_unicode_identifier].
+ </description>
+ </method>
<method name="is_valid_filename" qualifiers="const">
<return type="bool" />
<description>
@@ -491,7 +510,7 @@
Returns [code]true[/code] if this string is a valid color in hexadecimal HTML notation. The string must be a hexadecimal value (see [method is_valid_hex_number]) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign ([code]#[/code]). Other HTML notations for colors, such as names or [code]hsl()[/code], are not considered valid. See also [method Color.html].
</description>
</method>
- <method name="is_valid_identifier" qualifiers="const">
+ <method name="is_valid_identifier" qualifiers="const" deprecated="Use [method is_valid_ascii_identifier] instead.">
<return type="bool" />
<description>
Returns [code]true[/code] if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores ([code]_[/code]), and the first character may not be a digit.
@@ -522,12 +541,28 @@
Returns [code]true[/code] if this string represents a well-formatted IPv4 or IPv6 address. This method considers [url=https://en.wikipedia.org/wiki/Reserved_IP_addresses]reserved IP addresses[/url] such as [code]"0.0.0.0"[/code] and [code]"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"[/code] as valid.
</description>
</method>
+ <method name="is_valid_unicode_identifier" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if this string is a valid Unicode identifier.
+ A valid Unicode identifier must begin with a Unicode character of class [code]XID_Start[/code] or [code]"_"[/code], and may contain Unicode characters of class [code]XID_Continue[/code] in the other positions.
+ [codeblock]
+ print("node_2d".is_valid_unicode_identifier()) # Prints true
+ print("1st_method".is_valid_unicode_identifier()) # Prints false
+ print("MyMethod#2".is_valid_unicode_identifier()) # Prints false
+ print("állóképesség".is_valid_unicode_identifier()) # Prints true
+ print("выносливость".is_valid_unicode_identifier()) # Prints true
+ print("体力".is_valid_unicode_identifier()) # Prints true
+ [/codeblock]
+ See also [method is_valid_ascii_identifier].
+ [b]Note:[/b] This method checks identifiers the same way as GDScript. See [method TextServer.is_valid_identifier] for more advanced checks.
+ </description>
+ </method>
<method name="join" qualifiers="const">
<return type="String" />
<param index="0" name="parts" type="PackedStringArray" />
<description>
Returns the concatenation of [param parts]' elements, with each element separated by the string calling this method. This method is the opposite of [method split].
- [b]Example:[/b]
[codeblocks]
[gdscript]
var fruits = ["Apple", "Orange", "Pear", "Kiwi"]
@@ -647,7 +682,6 @@
Converts a [float] to a string representation of a decimal number, with the number of decimal places specified in [param decimals].
If [param decimals] is [code]-1[/code] as by default, the string representation may only have up to 14 significant digits, with digits before the decimal point having priority over digits after.
Trailing zeros are not included in the string. The last digit is rounded, not truncated.
- [b]Example:[/b]
[codeblock]
String.num(3.141593) # Returns "3.141593"
String.num(3.141593, 3) # Returns "3.142"
@@ -802,7 +836,6 @@
Splits the string using a [param delimiter] and returns an array of the substrings, starting from the end of the string. The splits in the returned array appear in the same order as the original string. If [param delimiter] is an empty string, each substring will be a single character.
If [param allow_empty] is [code]false[/code], empty strings between adjacent delimiters are excluded from the array.
If [param maxsplit] is greater than [code]0[/code], the number of splits may not exceed [param maxsplit]. By default, the entire string is split, which is mostly identical to [method split].
- [b]Example:[/b]
[codeblocks]
[gdscript]
var some_string = "One,Two,Three,Four"
@@ -854,7 +887,7 @@
<return type="float" />
<param index="0" name="text" type="String" />
<description>
- Returns the similarity index ([url=https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient]Sorensen-Dice coefficient[/url]) of this string compared to another. A result of [code]1.0[/code] means totally similar, while [code]0.0[/code] means totally dissimilar.
+ Returns the similarity index ([url=https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient]Sørensen-Dice coefficient[/url]) of this string compared to another. A result of [code]1.0[/code] means totally similar, while [code]0.0[/code] means totally dissimilar.
[codeblock]
print("ABC123".similarity("ABC123")) # Prints 1.0
print("ABC123".similarity("XYZ456")) # Prints 0.0
@@ -882,7 +915,6 @@
Splits the string using a [param delimiter] and returns an array of the substrings. If [param delimiter] is an empty string, each substring will be a single character. This method is the opposite of [method join].
If [param allow_empty] is [code]false[/code], empty strings between adjacent delimiters are excluded from the array.
If [param maxsplit] is greater than [code]0[/code], the number of splits may not exceed [param maxsplit]. By default, the entire string is split.
- [b]Example:[/b]
[codeblocks]
[gdscript]
var some_array = "One,Two,Three,Four".split(",", true, 2)
diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml
index 76586b7968..4982bc36a8 100644
--- a/doc/classes/StringName.xml
+++ b/doc/classes/StringName.xml
@@ -9,7 +9,7 @@
See also [NodePath], which is a similar concept specifically designed to store pre-parsed scene tree paths.
All of [String]'s methods are available in this class too. They convert the [StringName] into a string, and they also return a string. This is highly inefficient and should only be used if the string is desired.
[b]Note:[/b] In C#, an explicit conversion to [code]System.String[/code] is required to use the methods listed on this page. Use the [code]ToString()[/code] method to cast a [StringName] to a string, and then use the equivalent methods in [code]System.String[/code] or [code]StringExtensions[/code].
- [b]Note:[/b] In a boolean context, a [StringName] will evaluate to [code]false[/code] if it is empty ([code]StringName("")[/code]). Otherwise, a [StringName] will always evaluate to [code]true[/code]. The [code]not[/code] operator cannot be used. Instead, [method is_empty] should be used to check for empty [StringName]s.
+ [b]Note:[/b] In a boolean context, a [StringName] will evaluate to [code]false[/code] if it is empty ([code]StringName("")[/code]). Otherwise, a [StringName] will always evaluate to [code]true[/code].
</description>
<tutorials>
</tutorials>
@@ -247,6 +247,13 @@
print("User {id} is {name}.".format([["id", 42], ["name", "Godot"]]))
[/codeblock]
See also the [url=$DOCS_URL/tutorials/scripting/gdscript/gdscript_format_string.html]GDScript format string[/url] tutorial.
+ [b]Note:[/b] Each replacement is done sequentially for each element of [param values], [b]not[/b] all at once. This means that if any element is inserted and it contains another placeholder, it may be changed by the next replacement. While this can be very useful, it often causes unexpected results. If not necessary, make sure [param values]'s elements do not contain placeholders.
+ [codeblock]
+ print("{0} {1}".format(["{1}", "x"])) # Prints "x x".
+ print("{0} {1}".format(["x", "{0}"])) # Prints "x {0}".
+ print("{a} {b}".format({"a": "{b}", "b": "c"})) # Prints "c c".
+ print("{a} {b}".format({"b": "c", "a": "{b}"})) # Prints "{b} c".
+ [/codeblock]
[b]Note:[/b] In C#, it's recommended to [url=https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated]interpolate strings with "$"[/url], instead.
</description>
</method>
@@ -299,9 +306,8 @@
<param index="0" name="delimiter" type="String" />
<param index="1" name="slice" type="int" />
<description>
- Splits the string using a [param delimiter] and returns the substring at index [param slice]. Returns an empty string if the [param slice] does not exist.
+ Splits the string using a [param delimiter] and returns the substring at index [param slice]. Returns the original string if [param delimiter] does not occur in the string. Returns an empty string if the [param slice] does not exist.
This is faster than [method split], if you only need one substring.
- [b]Example:[/b]
[codeblock]
print("i/am/example/hi".get_slice("/", 2)) # Prints "example"
[/codeblock]
@@ -421,6 +427,19 @@
Returns [code]true[/code] if all characters of this string can be found in [param text] in their original order, [b]ignoring case[/b].
</description>
</method>
+ <method name="is_valid_ascii_identifier" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if this string is a valid ASCII identifier. A valid ASCII identifier may contain only letters, digits, and underscores ([code]_[/code]), and the first character may not be a digit.
+ [codeblock]
+ print("node_2d".is_valid_ascii_identifier()) # Prints true
+ print("TYPE_FLOAT".is_valid_ascii_identifier()) # Prints true
+ print("1st_method".is_valid_ascii_identifier()) # Prints false
+ print("MyMethod#2".is_valid_ascii_identifier()) # Prints false
+ [/codeblock]
+ See also [method is_valid_unicode_identifier].
+ </description>
+ </method>
<method name="is_valid_filename" qualifiers="const">
<return type="bool" />
<description>
@@ -460,7 +479,7 @@
Returns [code]true[/code] if this string is a valid color in hexadecimal HTML notation. The string must be a hexadecimal value (see [method is_valid_hex_number]) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign ([code]#[/code]). Other HTML notations for colors, such as names or [code]hsl()[/code], are not considered valid. See also [method Color.html].
</description>
</method>
- <method name="is_valid_identifier" qualifiers="const">
+ <method name="is_valid_identifier" qualifiers="const" deprecated="Use [method is_valid_ascii_identifier] instead.">
<return type="bool" />
<description>
Returns [code]true[/code] if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores ([code]_[/code]), and the first character may not be a digit.
@@ -491,12 +510,28 @@
Returns [code]true[/code] if this string represents a well-formatted IPv4 or IPv6 address. This method considers [url=https://en.wikipedia.org/wiki/Reserved_IP_addresses]reserved IP addresses[/url] such as [code]"0.0.0.0"[/code] and [code]"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"[/code] as valid.
</description>
</method>
+ <method name="is_valid_unicode_identifier" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if this string is a valid Unicode identifier.
+ A valid Unicode identifier must begin with a Unicode character of class [code]XID_Start[/code] or [code]"_"[/code], and may contain Unicode characters of class [code]XID_Continue[/code] in the other positions.
+ [codeblock]
+ print("node_2d".is_valid_unicode_identifier()) # Prints true
+ print("1st_method".is_valid_unicode_identifier()) # Prints false
+ print("MyMethod#2".is_valid_unicode_identifier()) # Prints false
+ print("állóképesség".is_valid_unicode_identifier()) # Prints true
+ print("выносливость".is_valid_unicode_identifier()) # Prints true
+ print("体力".is_valid_unicode_identifier()) # Prints true
+ [/codeblock]
+ See also [method is_valid_ascii_identifier].
+ [b]Note:[/b] This method checks identifiers the same way as GDScript. See [method TextServer.is_valid_identifier] for more advanced checks.
+ </description>
+ </method>
<method name="join" qualifiers="const">
<return type="String" />
<param index="0" name="parts" type="PackedStringArray" />
<description>
Returns the concatenation of [param parts]' elements, with each element separated by the string calling this method. This method is the opposite of [method split].
- [b]Example:[/b]
[codeblocks]
[gdscript]
var fruits = ["Apple", "Orange", "Pear", "Kiwi"]
@@ -703,7 +738,6 @@
Splits the string using a [param delimiter] and returns an array of the substrings, starting from the end of the string. The splits in the returned array appear in the same order as the original string. If [param delimiter] is an empty string, each substring will be a single character.
If [param allow_empty] is [code]false[/code], empty strings between adjacent delimiters are excluded from the array.
If [param maxsplit] is greater than [code]0[/code], the number of splits may not exceed [param maxsplit]. By default, the entire string is split, which is mostly identical to [method split].
- [b]Example:[/b]
[codeblocks]
[gdscript]
var some_string = "One,Two,Three,Four"
@@ -755,7 +789,7 @@
<return type="float" />
<param index="0" name="text" type="String" />
<description>
- Returns the similarity index ([url=https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient]Sorensen-Dice coefficient[/url]) of this string compared to another. A result of [code]1.0[/code] means totally similar, while [code]0.0[/code] means totally dissimilar.
+ Returns the similarity index ([url=https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient]Sørensen-Dice coefficient[/url]) of this string compared to another. A result of [code]1.0[/code] means totally similar, while [code]0.0[/code] means totally dissimilar.
[codeblock]
print("ABC123".similarity("ABC123")) # Prints 1.0
print("ABC123".similarity("XYZ456")) # Prints 0.0
@@ -783,7 +817,6 @@
Splits the string using a [param delimiter] and returns an array of the substrings. If [param delimiter] is an empty string, each substring will be a single character. This method is the opposite of [method join].
If [param allow_empty] is [code]false[/code], empty strings between adjacent delimiters are excluded from the array.
If [param maxsplit] is greater than [code]0[/code], the number of splits may not exceed [param maxsplit]. By default, the entire string is split.
- [b]Example:[/b]
[codeblocks]
[gdscript]
var some_array = "One,Two,Three,Four".split(",", true, 2)
@@ -845,7 +878,7 @@
<method name="to_ascii_buffer" qualifiers="const">
<return type="PackedByteArray" />
<description>
- Converts the string to an [url=https://en.wikipedia.org/wiki/ASCII]ASCII[/url]/Latin-1 encoded [PackedByteArray]. This method is slightly faster than [method to_utf8_buffer], but replaces all unsupported characters with spaces.
+ Converts the string to an [url=https://en.wikipedia.org/wiki/ASCII]ASCII[/url]/Latin-1 encoded [PackedByteArray]. This method is slightly faster than [method to_utf8_buffer], but replaces all unsupported characters with spaces. This is the inverse of [method PackedByteArray.get_string_from_ascii].
</description>
</method>
<method name="to_camel_case" qualifiers="const">
@@ -859,11 +892,11 @@
<description>
Converts the string representing a decimal number into a [float]. This method stops on the first non-number character, except the first decimal point ([code].[/code]) and the exponent letter ([code]e[/code]). See also [method is_valid_float].
[codeblock]
- var a = "12.35".to_float() # a is 12.35
- var b = "1.2.3".to_float() # b is 1.2
- var c = "12xy3".to_float() # c is 12.0
- var d = "1e3".to_float() # d is 1000.0
- var e = "Hello!".to_int() # e is 0.0
+ var a = "12.35".to_float() # a is 12.35
+ var b = "1.2.3".to_float() # b is 1.2
+ var c = "12xy3".to_float() # c is 12.0
+ var d = "1e3".to_float() # d is 1000.0
+ var e = "Hello!".to_float() # e is 0.0
[/codeblock]
</description>
</method>
@@ -919,25 +952,25 @@
<method name="to_utf8_buffer" qualifiers="const">
<return type="PackedByteArray" />
<description>
- Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-8]UTF-8[/url] encoded [PackedByteArray]. This method is slightly slower than [method to_ascii_buffer], but supports all UTF-8 characters. For most cases, prefer using this method.
+ Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-8]UTF-8[/url] encoded [PackedByteArray]. This method is slightly slower than [method to_ascii_buffer], but supports all UTF-8 characters. For most cases, prefer using this method. This is the inverse of [method PackedByteArray.get_string_from_utf8].
</description>
</method>
<method name="to_utf16_buffer" qualifiers="const">
<return type="PackedByteArray" />
<description>
- Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-16]UTF-16[/url] encoded [PackedByteArray].
+ Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-16]UTF-16[/url] encoded [PackedByteArray]. This is the inverse of [method PackedByteArray.get_string_from_utf16].
</description>
</method>
<method name="to_utf32_buffer" qualifiers="const">
<return type="PackedByteArray" />
<description>
- Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-32]UTF-32[/url] encoded [PackedByteArray].
+ Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-32]UTF-32[/url] encoded [PackedByteArray]. This is the inverse of [method PackedByteArray.get_string_from_utf32].
</description>
</method>
<method name="to_wchar_buffer" qualifiers="const">
<return type="PackedByteArray" />
<description>
- Converts the string to a [url=https://en.wikipedia.org/wiki/Wide_character]wide character[/url] ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded [PackedByteArray].
+ Converts the string to a [url=https://en.wikipedia.org/wiki/Wide_character]wide character[/url] ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded [PackedByteArray]. This is the inverse of [method PackedByteArray.get_string_from_wchar].
</description>
</method>
<method name="trim_prefix" qualifiers="const">
@@ -964,7 +997,7 @@
<method name="uri_decode" qualifiers="const">
<return type="String" />
<description>
- Decodes the string from its URL-encoded format. This method is meant to properly decode the parameters in a URL when receiving an HTTP request.
+ Decodes the string from its URL-encoded format. This method is meant to properly decode the parameters in a URL when receiving an HTTP request. See also [method uri_encode].
[codeblocks]
[gdscript]
var url = "$DOCS_URL/?highlight=Godot%20Engine%3%docs"
@@ -980,7 +1013,7 @@
<method name="uri_encode" qualifiers="const">
<return type="String" />
<description>
- Encodes the string to URL-friendly format. This method is meant to properly encode the parameters in a URL when sending an HTTP request.
+ Encodes the string to URL-friendly format. This method is meant to properly encode the parameters in a URL when sending an HTTP request. See also [method uri_decode].
[codeblocks]
[gdscript]
var prefix = "$DOCS_URL/?highlight="
diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml
index 181e1ff77a..8c629b12c5 100644
--- a/doc/classes/StyleBoxFlat.xml
+++ b/doc/classes/StyleBoxFlat.xml
@@ -5,8 +5,7 @@
</brief_description>
<description>
By configuring various properties of this style box, you can achieve many common looks without the need of a texture. This includes optionally rounded borders, antialiasing, shadows, and skew.
- Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system.
- [b]Example:[/b]
+ Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system:
[codeblock lang=text]
height = 30
corner_radius_top_left = 50
diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml
index 14bceb4d4c..07d4b13f36 100644
--- a/doc/classes/StyleBoxTexture.xml
+++ b/doc/classes/StyleBoxTexture.xml
@@ -80,9 +80,9 @@
Modulates the color of the texture when this style box is drawn.
</member>
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)">
- Species a sub-region of the texture to use.
- This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region.
- If empty ([code]Rect2(0, 0, 0, 0)[/code]), the whole texture will be used.
+ The region to use from the [member texture].
+ This is equivalent to first wrapping the [member texture] in an [AtlasTexture] with the same region.
+ If empty ([code]Rect2(0, 0, 0, 0)[/code]), the whole [member texture] is used.
</member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
The texture to use when drawing this style box.
diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml
index a8bd068b1c..9265e6b345 100644
--- a/doc/classes/SurfaceTool.xml
+++ b/doc/classes/SurfaceTool.xml
@@ -140,7 +140,7 @@
<param index="0" name="flip" type="bool" default="false" />
<description>
Generates normals from vertices so you do not have to do it manually. If [param flip] is [code]true[/code], the resulting normals will be inverted. [method generate_normals] should be called [i]after[/i] generating geometry and [i]before[/i] committing the mesh using [method commit] or [method commit_to_arrays]. For correct display of normal-mapped surfaces, you will also have to generate tangents using [method generate_tangents].
- [b]Note:[/b] [method generate_normals] only works if the primitive type to be set to [constant Mesh.PRIMITIVE_TRIANGLES].
+ [b]Note:[/b] [method generate_normals] only works if the primitive type is set to [constant Mesh.PRIMITIVE_TRIANGLES].
[b]Note:[/b] [method generate_normals] takes smooth groups into account. To generate smooth normals, set the smooth group to a value greater than or equal to [code]0[/code] using [method set_smooth_group] or leave the smooth group at the default of [code]0[/code]. To generate flat normals, set the smooth group to [code]-1[/code] using [method set_smooth_group] prior to adding vertices.
</description>
</method>
@@ -241,7 +241,7 @@
<param index="0" name="count" type="int" enum="SurfaceTool.SkinWeightCount" />
<description>
Set to [constant SKIN_8_WEIGHTS] to indicate that up to 8 bone influences per vertex may be used.
- By default, only 4 bone influences are used ([constant SKIN_4_WEIGHTS])
+ By default, only 4 bone influences are used ([constant SKIN_4_WEIGHTS]).
[b]Note:[/b] This function takes an enum, not the exact number of weights.
</description>
</method>
diff --git a/doc/classes/SyntaxHighlighter.xml b/doc/classes/SyntaxHighlighter.xml
index 27cee26c50..22d20d24e5 100644
--- a/doc/classes/SyntaxHighlighter.xml
+++ b/doc/classes/SyntaxHighlighter.xml
@@ -41,11 +41,11 @@
<return type="Dictionary" />
<param index="0" name="line" type="int" />
<description>
- Returns syntax highlighting data for a single line. If the line is not cached, calls [method _get_line_syntax_highlighting] to calculate the data.
- The return [Dictionary] is column number to [Dictionary]. The column number notes the start of a region, the region will end if another region is found, or at the end of the line. The nested [Dictionary] contains the data for that region, currently only the key "color" is supported.
- [b]Example return:[/b]
+ Returns the syntax highlighting data for the line at index [param line]. If the line is not cached, calls [method _get_line_syntax_highlighting] first to calculate the data.
+ Each entry is a column number containing a nested [Dictionary]. The column number denotes the start of a region, the region will end if another region is found, or at the end of the line. The nested [Dictionary] contains the data for that region. Currently only the key [code]"color"[/code] is supported.
+ [b]Example:[/b] Possible return value. This means columns [code]0[/code] to [code]4[/code] should be red, and columns [code]5[/code] to the end of the line should be green:
[codeblock]
- var color_map = {
+ {
0: {
"color": Color(1, 0, 0)
},
@@ -54,7 +54,6 @@
}
}
[/codeblock]
- This will color columns 0-4 red, and columns 5-eol in green.
</description>
</method>
<method name="get_text_edit" qualifiers="const">
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index 75cad4d08b..13721d9d62 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -124,7 +124,6 @@
<return type="void" />
<description>
Starts an edit for multiple carets. The edit must be ended with [method end_multicaret_edit]. Multicaret edits can be used to edit text at multiple carets and delay merging the carets until the end, so the caret indexes aren't affected immediately. [method begin_multicaret_edit] and [method end_multicaret_edit] can be nested, and the merge will happen at the last [method end_multicaret_edit].
- Example usage:
[codeblock]
begin_complex_operation()
begin_multicaret_edit()
@@ -764,7 +763,8 @@
<return type="bool" />
<param index="0" name="caret_index" type="int" default="0" />
<description>
- Returns [code]true[/code] if the caret is visible on the screen.
+ Returns [code]true[/code] if the caret is visible, [code]false[/code] otherwise. A caret will be considered hidden if it is outside the scrollable area when scrolling is enabled.
+ [b]Note:[/b] [method is_caret_visible] does not account for a caret being off-screen if it is still within the scrollable area. It will return [code]true[/code] even if the caret is off-screen as long as it meets [TextEdit]'s own conditions for being visible. This includes uses of [member scroll_fit_content_width] and [member scroll_fit_content_height] that cause the [TextEdit] to expand beyond the viewport's bounds.
</description>
</method>
<method name="is_dragging_cursor" qualifiers="const">
@@ -1278,6 +1278,9 @@
<member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true">
If [code]true[/code], a right-click displays the context menu.
</member>
+ <member name="custom_word_separators" type="String" setter="set_custom_word_separators" getter="get_custom_word_separators" default="&quot;&quot;">
+ The characters to consider as word delimiters if [member use_custom_word_separators] is [code]true[/code]. The characters should be defined without separation, for example [code]#_![/code].
+ </member>
<member name="deselect_on_focus_loss_enabled" type="bool" setter="set_deselect_on_focus_loss_enabled" getter="is_deselect_on_focus_loss_enabled" default="true">
If [code]true[/code], the selected text will be deselected when focus is lost.
</member>
@@ -1296,6 +1299,9 @@
<member name="editable" type="bool" setter="set_editable" getter="is_editable" default="true" keywords="readonly, disabled, enabled">
If [code]false[/code], existing text cannot be modified and new text cannot be added.
</member>
+ <member name="empty_selection_clipboard_enabled" type="bool" setter="set_empty_selection_clipboard_enabled" getter="is_empty_selection_clipboard_enabled" default="true">
+ If [code]true[/code], copying or cutting without a selection is performed on all lines with a caret. Otherwise, copy and cut require a selection.
+ </member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" />
<member name="highlight_all_occurrences" type="bool" setter="set_highlight_all_occurrences" getter="is_highlight_all_occurrences_enabled" default="false">
If [code]true[/code], all occurrences of the selected text will be highlighted.
@@ -1324,7 +1330,10 @@
Text shown when the [TextEdit] is empty. It is [b]not[/b] the [TextEdit]'s default value (see [member text]).
</member>
<member name="scroll_fit_content_height" type="bool" setter="set_fit_content_height_enabled" getter="is_fit_content_height_enabled" default="false">
- If [code]true[/code], [TextEdit] will disable vertical scroll and fit minimum height to the number of visible lines.
+ If [code]true[/code], [TextEdit] will disable vertical scroll and fit minimum height to the number of visible lines. When both this property and [member scroll_fit_content_width] are [code]true[/code], no scrollbars will be displayed.
+ </member>
+ <member name="scroll_fit_content_width" type="bool" setter="set_fit_content_width_enabled" getter="is_fit_content_width_enabled" default="false">
+ If [code]true[/code], [TextEdit] will disable horizontal scroll and fit minimum width to the widest line in the text. When both this property and [member scroll_fit_content_height] are [code]true[/code], no scrollbars will be displayed.
</member>
<member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0">
If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
@@ -1355,7 +1364,8 @@
Set additional options for BiDi override.
</member>
<member name="syntax_highlighter" type="SyntaxHighlighter" setter="set_syntax_highlighter" getter="get_syntax_highlighter">
- Sets the [SyntaxHighlighter] to use.
+ The syntax highlighter to use.
+ [b]Note:[/b] A [SyntaxHighlighter] instance should not be used across multiple [TextEdit] nodes.
</member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
String value of the [TextEdit].
@@ -1363,6 +1373,12 @@
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
Base text writing direction.
</member>
+ <member name="use_custom_word_separators" type="bool" setter="set_use_custom_word_separators" getter="is_custom_word_separators_enabled" default="false">
+ If [code]false[/code], using [kbd]Ctrl + Left[/kbd] or [kbd]Ctrl + Right[/kbd] ([kbd]Cmd + Left[/kbd] or [kbd]Cmd + Right[/kbd] on macOS) bindings will use the behavior of [member use_default_word_separators]. If [code]true[/code], it will also stop the caret if a character within [member custom_word_separators] is detected. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
+ </member>
+ <member name="use_default_word_separators" type="bool" setter="set_use_default_word_separators" getter="is_default_word_separators_enabled" default="true">
+ If [code]false[/code], using [kbd]Ctrl + Left[/kbd] or [kbd]Ctrl + Right[/kbd] ([kbd]Cmd + Left[/kbd] or [kbd]Cmd + Right[/kbd] on macOS) bindings will stop moving caret only if a space or punctuation is detected. If [code]true[/code], it will also stop the caret if a character is part of [code]!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^`{|}~[/code], the Unicode General Punctuation table, or the Unicode CJK Punctuation table. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
+ </member>
<member name="virtual_keyboard_enabled" type="bool" setter="set_virtual_keyboard_enabled" getter="is_virtual_keyboard_enabled" default="true">
If [code]true[/code], the native virtual keyboard is shown when focused on platforms that support it.
</member>
@@ -1608,7 +1624,7 @@
The caret's width in pixels. Greater values can be used to improve accessibility by ensuring the caret is easily visible, or to ensure consistency with a large font size. If set to [code]0[/code] or lower, the caret width is automatically set to 1 pixel and multiplied by the display scaling factor.
</theme_item>
<theme_item name="line_spacing" data_type="constant" type="int" default="4">
- Sets the spacing between the lines.
+ Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
diff --git a/doc/classes/TextMesh.xml b/doc/classes/TextMesh.xml
index 9e705311c5..b6b1052af5 100644
--- a/doc/classes/TextMesh.xml
+++ b/doc/classes/TextMesh.xml
@@ -31,13 +31,13 @@
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
- Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
+ Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for text shaping algorithms, if left empty current locale is used instead.
</member>
<member name="line_spacing" type="float" setter="set_line_spacing" getter="get_line_spacing" default="0.0">
- Vertical space between lines in multiline [TextMesh].
+ Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
</member>
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)">
The text drawing offset (in pixels).
diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml
index 541078ed22..c9ac660b8c 100644
--- a/doc/classes/TextParagraph.xml
+++ b/doc/classes/TextParagraph.xml
@@ -175,7 +175,7 @@
<return type="Vector2" />
<param index="0" name="line" type="int" />
<description>
- Returns size of the bounding box of the line of text.
+ Returns size of the bounding box of the line of text. Returned size is rounded up.
</description>
</method>
<method name="get_line_underline_position" qualifiers="const">
@@ -278,7 +278,10 @@
Ellipsis character used for text clipping.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
- Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
+ Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
+ </member>
+ <member name="line_spacing" type="float" setter="set_line_spacing" getter="get_line_spacing" default="0.0">
+ Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
</member>
<member name="max_lines_visible" type="int" setter="set_max_lines_visible" getter="get_max_lines_visible" default="-1">
Limits the lines of text shown.
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index 34137a18ef..d76e65b618 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -229,6 +229,11 @@
[code]points[/code] - [PackedVector3Array], containing outline points. [code]x[/code] and [code]y[/code] are point coordinates. [code]z[/code] is the type of the point, using the [enum ContourPointTag] values.
[code]contours[/code] - [PackedInt32Array], containing indices the end points of each contour.
[code]orientation[/code] - [bool], contour orientation. If [code]true[/code], clockwise contours must be filled.
+ - Two successive [constant CONTOUR_CURVE_TAG_ON] points indicate a line segment.
+ - One [constant CONTOUR_CURVE_TAG_OFF_CONIC] point between two [constant CONTOUR_CURVE_TAG_ON] points indicates a single conic (quadratic) Bézier arc.
+ - Two [constant CONTOUR_CURVE_TAG_OFF_CUBIC] points between two [constant CONTOUR_CURVE_TAG_ON] points indicate a single cubic Bézier arc.
+ - Two successive [constant CONTOUR_CURVE_TAG_OFF_CONIC] points indicate two successive conic (quadratic) Bézier arcs with a virtual [constant CONTOUR_CURVE_TAG_ON] point at their middle.
+ - Each contour is closed. The last point of a contour uses the first point of a contour as its next point, and vice versa. The first point can be [constant CONTOUR_CURVE_TAG_OFF_CONIC] point.
</description>
</method>
<method name="font_get_glyph_index" qualifiers="const">
@@ -459,6 +464,13 @@
Returns a string containing all the characters available in the font.
</description>
</method>
+ <method name="font_get_supported_glyphs" qualifiers="const">
+ <return type="PackedInt32Array" />
+ <param index="0" name="font_rid" type="RID" />
+ <description>
+ Returns an array containing all glyph indices in the font.
+ </description>
+ </method>
<method name="font_get_texture_count" qualifiers="const">
<return type="int" />
<param index="0" name="font_rid" type="RID" />
@@ -1725,7 +1737,7 @@
Returns array of the composite character boundaries.
[codeblock]
var ts = TextServerManager.get_primary_interface()
- print(ts.string_get_word_breaks("Test ❤️‍🔥 Test")) # Prints [1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14]
+ print(ts.string_get_character_breaks("Test ❤️‍🔥 Test")) # Prints [1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14]
[/codeblock]
</description>
</method>
@@ -1739,8 +1751,9 @@
When [param chars_per_line] is greater than zero, line break boundaries are returned instead.
[codeblock]
var ts = TextServerManager.get_primary_interface()
- print(ts.string_get_word_breaks("Godot Engine")) # Prints [0, 5, 6, 12]
- print(ts.string_get_word_breaks("Godot Engine", "en", 5)) # Prints [0, 5, 6, 11, 11, 12]
+ print(ts.string_get_word_breaks("The Godot Engine, 4")) # Prints [0, 3, 4, 9, 10, 16, 18, 19], which corresponds to the following substrings: "The", "Godot", "Engine", "4"
+ print(ts.string_get_word_breaks("The Godot Engine, 4", "en", 5)) # Prints [0, 3, 4, 9, 10, 15, 15, 19], which corresponds to the following substrings: "The", "Godot", "Engin", "e, 4"
+ print(ts.string_get_word_breaks("The Godot Engine, 4", "en", 10)) # Prints [0, 9, 10, 19], which corresponds to the following substrings: "The Godot", "Engine, 4"
[/codeblock]
</description>
</method>
diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml
index c148cdad52..3c27404f8e 100644
--- a/doc/classes/TextServerExtension.xml
+++ b/doc/classes/TextServerExtension.xml
@@ -496,6 +496,14 @@
Returns a string containing all the characters available in the font.
</description>
</method>
+ <method name="_font_get_supported_glyphs" qualifiers="virtual const">
+ <return type="PackedInt32Array" />
+ <param index="0" name="font_rid" type="RID" />
+ <description>
+ [b]Required.[/b]
+ Returns an array containing all glyph indices in the font.
+ </description>
+ </method>
<method name="_font_get_texture_count" qualifiers="virtual const">
<return type="int" />
<param index="0" name="font_rid" type="RID" />
diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml
index eb3c170583..479456ae66 100644
--- a/doc/classes/Theme.xml
+++ b/doc/classes/Theme.xml
@@ -551,7 +551,7 @@
</member>
<member name="default_font_size" type="int" setter="set_default_font_size" getter="get_default_font_size" default="-1">
The default font size of this theme resource. Used as the default value when trying to fetch a font size value that doesn't exist in this theme or is in invalid state. If the default font size is also missing or invalid, the engine fallback value is used (see [member ThemeDB.fallback_font_size]).
- Values below [code]0[/code] are invalid and can be used to unset the property. Use [method has_default_font_size] to check if this value is valid.
+ Values below [code]1[/code] are invalid and can be used to unset the property. Use [method has_default_font_size] to check if this value is valid.
</member>
</members>
<constants>
diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml
index 91df90580c..f9505124ef 100644
--- a/doc/classes/TileData.xml
+++ b/doc/classes/TileData.xml
@@ -16,6 +16,13 @@
Adds a collision polygon to the tile on the given TileSet physics layer.
</description>
</method>
+ <method name="add_occluder_polygon">
+ <return type="void" />
+ <param index="0" name="layer_id" type="int" />
+ <description>
+ Adds an occlusion polygon to the tile on the TileSet occlusion layer with index [param layer_id].
+ </description>
+ </method>
<method name="get_collision_polygon_one_way_margin" qualifiers="const">
<return type="float" />
<param index="0" name="layer_id" type="int" />
@@ -78,7 +85,7 @@
[param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon.
</description>
</method>
- <method name="get_occluder" qualifiers="const">
+ <method name="get_occluder" qualifiers="const" deprecated="Use [method get_occluder_polygon] instead.">
<return type="OccluderPolygon2D" />
<param index="0" name="layer_id" type="int" />
<param index="1" name="flip_h" type="bool" default="false" />
@@ -89,6 +96,25 @@
[param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon.
</description>
</method>
+ <method name="get_occluder_polygon" qualifiers="const">
+ <return type="OccluderPolygon2D" />
+ <param index="0" name="layer_id" type="int" />
+ <param index="1" name="polygon_index" type="int" />
+ <param index="2" name="flip_h" type="bool" default="false" />
+ <param index="3" name="flip_v" type="bool" default="false" />
+ <param index="4" name="transpose" type="bool" default="false" />
+ <description>
+ Returns the occluder polygon at index [param polygon_index] from the TileSet occlusion layer with index [param layer_id].
+ The [param flip_h], [param flip_v], and [param transpose] parameters can be [code]true[/code] to transform the returned polygon.
+ </description>
+ </method>
+ <method name="get_occluder_polygons_count" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="layer_id" type="int" />
+ <description>
+ Returns the number of occluder polygons of the tile in the TileSet occlusion layer with index [param layer_id].
+ </description>
+ </method>
<method name="get_terrain_peering_bit" qualifiers="const">
<return type="int" />
<param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
@@ -119,6 +145,14 @@
Removes the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
</description>
</method>
+ <method name="remove_occluder_polygon">
+ <return type="void" />
+ <param index="0" name="layer_id" type="int" />
+ <param index="1" name="polygon_index" type="int" />
+ <description>
+ Removes the polygon at index [param polygon_index] for TileSet occlusion layer with index [param layer_id].
+ </description>
+ </method>
<method name="set_collision_polygon_one_way">
<return type="void" />
<param index="0" name="layer_id" type="int" />
@@ -134,7 +168,7 @@
<param index="1" name="polygon_index" type="int" />
<param index="2" name="one_way_margin" type="float" />
<description>
- Enables/disables one-way collisions on the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
+ Sets the one-way margin (for one-way platforms) of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
</description>
</method>
<method name="set_collision_polygon_points">
@@ -194,7 +228,7 @@
Sets the navigation polygon for the TileSet navigation layer with index [param layer_id].
</description>
</method>
- <method name="set_occluder">
+ <method name="set_occluder" deprecated="Use [method set_occluder_polygon] instead.">
<return type="void" />
<param index="0" name="layer_id" type="int" />
<param index="1" name="occluder_polygon" type="OccluderPolygon2D" />
@@ -202,6 +236,23 @@
Sets the occluder for the TileSet occlusion layer with index [param layer_id].
</description>
</method>
+ <method name="set_occluder_polygon">
+ <return type="void" />
+ <param index="0" name="layer_id" type="int" />
+ <param index="1" name="polygon_index" type="int" />
+ <param index="2" name="polygon" type="OccluderPolygon2D" />
+ <description>
+ Sets the occluder for polygon with index [param polygon_index] in the TileSet occlusion layer with index [param layer_id].
+ </description>
+ </method>
+ <method name="set_occluder_polygons_count">
+ <return type="void" />
+ <param index="0" name="layer_id" type="int" />
+ <param index="1" name="polygons_count" type="int" />
+ <description>
+ Sets the occluder polygon count in the TileSet occlusion layer with index [param layer_id].
+ </description>
+ </method>
<method name="set_terrain_peering_bit">
<return type="void" />
<param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index 3f70810a7f..4683f063f1 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="TileMap" inherits="Node2D" deprecated="Use multiple [TileMapLayer] nodes instead." keywords="gridmap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="TileMap" inherits="Node2D" deprecated="Use multiple [TileMapLayer] nodes instead. To convert a TileMap to a set of TileMapLayer nodes, open the TileMap bottom panel with the node selected, click the toolbox icon in the top-right corner and choose &apos;Extract TileMap layers as individual TileMapLayer nodes&apos;." keywords="gridmap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Node for 2D tile-based maps.
</brief_description>
@@ -256,6 +256,33 @@
Returns a rectangle enclosing the used (non-empty) tiles of the map, including all layers.
</description>
</method>
+ <method name="is_cell_flipped_h" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="layer" type="int" />
+ <param index="1" name="coords" type="Vector2i" />
+ <param index="2" name="use_proxies" type="bool" default="false" />
+ <description>
+ Returns [code]true[/code] if the cell on layer [param layer] at coordinates [param coords] is flipped horizontally. The result is valid only for atlas sources.
+ </description>
+ </method>
+ <method name="is_cell_flipped_v" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="layer" type="int" />
+ <param index="1" name="coords" type="Vector2i" />
+ <param index="2" name="use_proxies" type="bool" default="false" />
+ <description>
+ Returns [code]true[/code] if the cell on layer [param layer] at coordinates [param coords] is flipped vertically. The result is valid only for atlas sources.
+ </description>
+ </method>
+ <method name="is_cell_transposed" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="layer" type="int" />
+ <param index="1" name="coords" type="Vector2i" />
+ <param index="2" name="use_proxies" type="bool" default="false" />
+ <description>
+ Returns [code]true[/code] if the cell on layer [param layer] at coordinates [param coords] is transposed. The result is valid only for atlas sources.
+ </description>
+ </method>
<method name="is_layer_enabled" qualifiers="const">
<return type="bool" />
<param index="0" name="layer" type="int" />
@@ -353,7 +380,7 @@
<param index="4" name="ignore_empty_terrains" type="bool" default="true" />
<description>
Update all the cells in the [param cells] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. If an updated cell has the same terrain as one of its neighboring cells, this function tries to join the two. This function might update neighboring tiles if needed to create correct terrain transitions.
- If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
+ If [param ignore_empty_terrains] is [code]true[/code], empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
If [param layer] is negative, the layers are accessed from the last one.
[b]Note:[/b] To work correctly, this method requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results.
</description>
@@ -367,7 +394,7 @@
<param index="4" name="ignore_empty_terrains" type="bool" default="true" />
<description>
Update all the cells in the [param path] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. The function will also connect two successive cell in the path with the same terrain. This function might update neighboring tiles if needed to create correct terrain transitions.
- If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
+ If [param ignore_empty_terrains] is [code]true[/code], empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
If [param layer] is negative, the layers are accessed from the last one.
[b]Note:[/b] To work correctly, this method requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results.
</description>
diff --git a/doc/classes/TileMapLayer.xml b/doc/classes/TileMapLayer.xml
index b9acef2095..43708ca142 100644
--- a/doc/classes/TileMapLayer.xml
+++ b/doc/classes/TileMapLayer.xml
@@ -22,6 +22,21 @@
[b]Note:[/b] If the properties of [param tile_data] object should change over time, use [method notify_runtime_tile_data_update] to notify the [TileMapLayer] it needs an update.
</description>
</method>
+ <method name="_update_cells" qualifiers="virtual">
+ <return type="void" />
+ <param index="0" name="coords" type="Vector2i[]" />
+ <param index="1" name="forced_cleanup" type="bool" />
+ <description>
+ Called when this [TileMapLayer]'s cells need an internal update. This update may be caused from individual cells being modified or by a change in the [member tile_set] (causing all cells to be queued for an update). The first call to this function is always for initializing all the [TileMapLayer]'s cells. [param coords] contains the coordinates of all modified cells, roughly in the order they were modified. [param forced_cleanup] is [code]true[/code] when the [TileMapLayer]'s internals should be fully cleaned up. This is the case when:
+ - The layer is disabled;
+ - The layer is not visible;
+ - [member tile_set] is set to [code]null[/code];
+ - The node is removed from the tree;
+ - The node is freed.
+ Note that any internal update happening while one of these conditions is verified is considered to be a "cleanup". See also [method update_internals].
+ [b]Warning:[/b] Implementing this method may degrade the [TileMapLayer]'s performance.
+ </description>
+ </method>
<method name="_use_tile_data_runtime_update" qualifiers="virtual">
<return type="bool" />
<param index="0" name="coords" type="Vector2i" />
@@ -120,7 +135,7 @@
<return type="Vector2i[]" />
<param index="0" name="coords" type="Vector2i" />
<description>
- Returns the list of all neighboring cells to the one at [param coords].
+ Returns the list of all neighboring cells to the one at [param coords]. Any neighboring cell is one that is touching edges, so for a square cell 4 cells would be returned, for a hexagon 6 cells are returned.
</description>
</method>
<method name="get_used_cells" qualifiers="const">
@@ -153,6 +168,27 @@
Returns whether the provided [param body] [RID] belongs to one of this [TileMapLayer]'s cells.
</description>
</method>
+ <method name="is_cell_flipped_h" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="coords" type="Vector2i" />
+ <description>
+ Returns [code]true[/code] if the cell at coordinates [param coords] is flipped horizontally. The result is valid only for atlas sources.
+ </description>
+ </method>
+ <method name="is_cell_flipped_v" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="coords" type="Vector2i" />
+ <description>
+ Returns [code]true[/code] if the cell at coordinates [param coords] is flipped vertically. The result is valid only for atlas sources.
+ </description>
+ </method>
+ <method name="is_cell_transposed" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="coords" type="Vector2i" />
+ <description>
+ Returns [code]true[/code] if the cell at coordinates [param coords] is transposed. The result is valid only for atlas sources.
+ </description>
+ </method>
<method name="local_to_map" qualifiers="const">
<return type="Vector2i" />
<param index="0" name="local_position" type="Vector2" />
@@ -207,7 +243,7 @@
<param index="3" name="ignore_empty_terrains" type="bool" default="true" />
<description>
Update all the cells in the [param cells] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. If an updated cell has the same terrain as one of its neighboring cells, this function tries to join the two. This function might update neighboring tiles if needed to create correct terrain transitions.
- If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
+ If [param ignore_empty_terrains] is [code]true[/code], empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
[b]Note:[/b] To work correctly, this method requires the [TileMapLayer]'s TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results.
</description>
</method>
@@ -219,7 +255,7 @@
<param index="3" name="ignore_empty_terrains" type="bool" default="true" />
<description>
Update all the cells in the [param path] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. The function will also connect two successive cell in the path with the same terrain. This function might update neighboring tiles if needed to create correct terrain transitions.
- If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
+ If [param ignore_empty_terrains] is [code]true[/code], empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
[b]Note:[/b] To work correctly, this method requires the [TileMapLayer]'s TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results.
</description>
</method>
@@ -263,6 +299,9 @@
<member name="navigation_visibility_mode" type="int" setter="set_navigation_visibility_mode" getter="get_navigation_visibility_mode" enum="TileMapLayer.DebugVisibilityMode" default="0">
Show or hide the [TileMapLayer]'s navigation meshes. If set to [constant DEBUG_VISIBILITY_MODE_DEFAULT], this depends on the show navigation debug settings.
</member>
+ <member name="occlusion_enabled" type="bool" setter="set_occlusion_enabled" getter="is_occlusion_enabled" default="true">
+ Enable or disable light occlusion.
+ </member>
<member name="rendering_quadrant_size" type="int" setter="set_rendering_quadrant_size" getter="get_rendering_quadrant_size" default="16">
The [TileMapLayer]'s quadrant size. A quadrant is a group of tiles to be drawn together on a single canvas item, for optimization purposes. [member rendering_quadrant_size] defines the length of a square's side, in the map's coordinate system, that forms the quadrant. Thus, the default quadrant size groups together [code]16 * 16 = 256[/code] tiles.
The quadrant size does not apply on a Y-sorted [TileMapLayer], as tiles are grouped by Y position instead in that case.
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index 64cd4fb7b2..19b6e8d92c 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -4,7 +4,7 @@
Tile library for tilemaps.
</brief_description>
<description>
- 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.
+ A TileSet is a library of tiles for a [TileMapLayer]. A TileSet handles a list of [TileSetSource], each of them storing a set of tiles.
Tiles can either be from a [TileSetAtlasSource], which renders 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 fewer properties. To do so, the TileSet resources use property layers, which you can add or remove depending on your needs.
@@ -218,6 +218,13 @@
Returns the collision mask of bodies on the given TileSet's physics layer.
</description>
</method>
+ <method name="get_physics_layer_collision_priority" qualifiers="const">
+ <return type="float" />
+ <param index="0" name="layer_index" type="int" />
+ <description>
+ Returns the collision priority of bodies on the given TileSet's physics layer.
+ </description>
+ </method>
<method name="get_physics_layer_physics_material" qualifiers="const">
<return type="PhysicsMaterial" />
<param index="0" name="layer_index" type="int" />
@@ -547,7 +554,7 @@
<param index="0" name="layer_index" type="int" />
<param index="1" name="layer" type="int" />
<description>
- Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer.
+ Sets the collision layer (as in the physics server) for bodies in the given TileSet physics layer.
</description>
</method>
<method name="set_physics_layer_collision_mask">
@@ -555,7 +562,15 @@
<param index="0" name="layer_index" type="int" />
<param index="1" name="mask" type="int" />
<description>
- Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer.
+ Sets the collision mask for bodies in the given TileSet physics layer.
+ </description>
+ </method>
+ <method name="set_physics_layer_collision_priority">
+ <return type="void" />
+ <param index="0" name="layer_index" type="int" />
+ <param index="1" name="priority" type="float" />
+ <description>
+ Sets the collision priority for bodies in the given TileSet physics layer.
</description>
</method>
<method name="set_physics_layer_physics_material">
diff --git a/doc/classes/TileSetScenesCollectionSource.xml b/doc/classes/TileSetScenesCollectionSource.xml
index 9d2742b844..40ad269e83 100644
--- a/doc/classes/TileSetScenesCollectionSource.xml
+++ b/doc/classes/TileSetScenesCollectionSource.xml
@@ -6,6 +6,32 @@
<description>
When placed on a [TileMap], tiles from [TileSetScenesCollectionSource] will automatically instantiate an associated scene at the cell's position in the TileMap.
Scenes are instantiated 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 instantiate/free the scene accordingly.
+ [b]Note:[/b] Scene tiles all occupy one tile slot and instead use alternate tile ID to identify scene index. [method TileSetSource.get_tiles_count] will always return [code]1[/code]. Use [method get_scene_tiles_count] to get a number of scenes in a [TileSetScenesCollectionSource].
+ Use this code if you want to find the scene path at a given tile in [TileMapLayer]:
+ [codeblocks]
+ [gdscript]
+ var source_id = tile_map_layer.get_cell_source_id(Vector2i(x, y))
+ if source_id &gt; -1:
+ var scene_source = tile_map_layer.tile_set.get_source(source_id)
+ if scene_source is TileSetScenesCollectionSource:
+ var alt_id = tile_map_layer.get_cell_alternative_tile(Vector2i(x, y))
+ # The assigned PackedScene.
+ var scene = scene_source.get_scene_tile_scene(alt_id)
+ [/gdscript]
+ [csharp]
+ int sourceId = tileMapLayer.GetCellSourceId(new Vector2I(x, y));
+ if (sourceId &gt; -1)
+ {
+ TileSetSource source = tileMapLayer.TileSet.GetSource(sourceId);
+ if (source is TileSetScenesCollectionSource sceneSource)
+ {
+ int altId = tileMapLayer.GetCellAlternativeTile(new Vector2I(x, y));
+ // The assigned PackedScene.
+ PackedScene scene = sceneSource.GetSceneTileScene(altId);
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml
index 9de1e09273..09f3dba8cf 100644
--- a/doc/classes/Timer.xml
+++ b/doc/classes/Timer.xml
@@ -28,7 +28,7 @@
<return type="void" />
<param index="0" name="time_sec" type="float" default="-1" />
<description>
- Starts the timer, if it was not started already. Fails if the timer is not inside the tree. If [param time_sec] is greater than [code]0[/code], this value is used for the [member wait_time].
+ Starts the timer, or resets the timer if it was started already. Fails if the timer is not inside the tree. If [param time_sec] is greater than [code]0[/code], this value is used for the [member wait_time].
[b]Note:[/b] This method does not resume a paused timer. See [member paused].
</description>
</method>
@@ -43,6 +43,7 @@
<member name="autostart" type="bool" setter="set_autostart" getter="has_autostart" default="false">
If [code]true[/code], the timer will start immediately when it enters the scene tree.
[b]Note:[/b] After the timer enters the tree, this property is automatically set to [code]false[/code].
+ [b]Note:[/b] This property does nothing when the timer is running in the editor.
</member>
<member name="one_shot" type="bool" setter="set_one_shot" getter="is_one_shot" default="false">
If [code]true[/code], the timer will stop after reaching the end. Otherwise, as by default, the timer will automatically restart.
diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml
index 5052518583..faeaaba5b6 100644
--- a/doc/classes/TouchScreenButton.xml
+++ b/doc/classes/TouchScreenButton.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. Unlike [Button], TouchScreenButton supports multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch input.
- This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings.
+ This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make button nodes react to touch events, you can enable [member ProjectSettings.input_devices/pointing/emulate_mouse_from_touch] in the Project Settings.
You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices.
</description>
<tutorials>
diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml
index 345d0512ff..665e5e9d67 100644
--- a/doc/classes/Transform2D.xml
+++ b/doc/classes/Transform2D.xml
@@ -4,8 +4,10 @@
A 2×3 matrix representing a 2D transformation.
</brief_description>
<description>
- A 2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, and scaling. It consists of three [Vector2] values: [member x], [member y], and the [member origin].
+ The [Transform2D] built-in [Variant] type is a 2×3 [url=https://en.wikipedia.org/wiki/Matrix_(mathematics)]matrix[/url] representing a transformation in 2D space. It contains three [Vector2] values: [member x], [member y], and [member origin]. Together, they can represent translation, rotation, scale, and skew.
+ The [member x] and [member y] axes form a 2×2 matrix, known as the transform's [b]basis[/b]. The length of each axis ([method Vector2.length]) influences the transform's scale, while the direction of all axes influence the rotation. Usually, both axes are perpendicular to one another. However, when you rotate one axis individually, the transform becomes skewed. Applying a skewed transform to a 2D sprite will make the sprite appear distorted.
For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial.
+ [b]Note:[/b] Unlike [Transform3D], there is no 2D equivalent to the [Basis] type. All mentions of "basis" refer to the [member x] and [member y] components of [Transform2D].
</description>
<tutorials>
<link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link>
@@ -17,7 +19,8 @@
<constructor name="Transform2D">
<return type="Transform2D" />
<description>
- Constructs a default-initialized [Transform2D] set to [constant IDENTITY].
+ Constructs a [Transform2D] identical to [constant IDENTITY].
+ [b]Note:[/b] In C#, this constructs a [Transform2D] with all of its components set to [constant Vector2.ZERO].
</description>
</constructor>
<constructor name="Transform2D">
@@ -32,7 +35,7 @@
<param index="0" name="rotation" type="float" />
<param index="1" name="position" type="Vector2" />
<description>
- Constructs the transform from a given angle (in radians) and position.
+ Constructs a [Transform2D] from a given angle (in radians) and position.
</description>
</constructor>
<constructor name="Transform2D">
@@ -42,7 +45,7 @@
<param index="2" name="skew" type="float" />
<param index="3" name="position" type="Vector2" />
<description>
- Constructs the transform from a given angle (in radians), scale, skew (in radians) and position.
+ Constructs a [Transform2D] from a given angle (in radians), scale, skew (in radians), and position.
</description>
</constructor>
<constructor name="Transform2D">
@@ -51,7 +54,7 @@
<param index="1" name="y_axis" type="Vector2" />
<param index="2" name="origin" type="Vector2" />
<description>
- Constructs the transform from 3 [Vector2] values representing [member x], [member y], and the [member origin] (the three column vectors).
+ Constructs a [Transform2D] from 3 [Vector2] values representing [member x], [member y], and the [member origin] (the three matrix columns).
</description>
</constructor>
</constructors>
@@ -59,56 +62,81 @@
<method name="affine_inverse" qualifiers="const">
<return type="Transform2D" />
<description>
- Returns the inverse of the transform, under the assumption that the basis is invertible (must have non-zero determinant).
+ Returns the inverted version of this transform. Unlike [method inverse], this method works with almost any basis, including non-uniform ones, but is slower. See also [method inverse].
+ [b]Note:[/b] For this method to return correctly, the transform's basis needs to have a determinant that is not exactly [code]0[/code] (see [method determinant]).
</description>
</method>
<method name="basis_xform" qualifiers="const">
<return type="Vector2" />
<param index="0" name="v" type="Vector2" />
<description>
- Returns a vector transformed (multiplied) by the basis matrix.
- This method does not account for translation (the [member origin] vector).
+ Returns a copy of the [param v] vector, transformed (multiplied) by the transform basis's matrix. Unlike the multiplication operator ([code]*[/code]), this method ignores the [member origin].
</description>
</method>
<method name="basis_xform_inv" qualifiers="const">
<return type="Vector2" />
<param index="0" name="v" type="Vector2" />
<description>
- Returns a vector transformed (multiplied) by the inverse basis matrix, under the assumption that the basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
- This method does not account for translation (the [member origin] vector).
- [code]transform.basis_xform_inv(vector)[/code] is equivalent to [code]transform.inverse().basis_xform(vector)[/code]. See [method inverse].
- For non-orthonormal transforms (e.g. with scaling) [code]transform.affine_inverse().basis_xform(vector)[/code] can be used instead. See [method affine_inverse].
+ Returns a copy of the [param v] vector, transformed (multiplied) by the inverse transform basis's matrix (see [method inverse]). This method ignores the [member origin].
+ [b]Note:[/b] This method assumes that this transform's basis is [i]orthonormal[/i] (see [method orthonormalized]). If the basis is not orthonormal, [code]transform.affine_inverse().basis_xform(vector)[/code] should be used instead (see [method affine_inverse]).
</description>
</method>
<method name="determinant" qualifiers="const">
<return type="float" />
<description>
- Returns the determinant of the basis matrix. If the basis is uniformly scaled, then its determinant equals the square of the scale factor.
- A negative determinant means the basis was flipped, so one part of the scale is negative. A zero determinant means the basis isn't invertible, and is usually considered invalid.
+ Returns the [url=https://en.wikipedia.org/wiki/Determinant]determinant[/url] of this transform basis's matrix. For advanced math, this number can be used to determine a few attributes:
+ - If the determinant is exactly [code]0[/code], the basis is not invertible (see [method inverse]).
+ - If the determinant is a negative number, the basis represents a negative scale.
+ [b]Note:[/b] If the basis's scale is the same for every axis, its determinant is always that scale by the power of 2.
</description>
</method>
<method name="get_origin" qualifiers="const">
<return type="Vector2" />
<description>
- Returns the transform's origin (translation).
+ Returns this transform's translation. Equivalent to [member origin].
</description>
</method>
<method name="get_rotation" qualifiers="const">
<return type="float" />
<description>
- Returns the transform's rotation (in radians).
+ Returns this transform's rotation (in radians). This is equivalent to [member x]'s angle (see [method Vector2.angle]).
</description>
</method>
<method name="get_scale" qualifiers="const">
<return type="Vector2" />
<description>
- Returns the scale.
+ Returns the length of both [member x] and [member y], as a [Vector2]. If this transform's basis is not skewed, this value is the scaling factor. It is not affected by rotation.
+ [codeblocks]
+ [gdscript]
+ var my_transform = Transform2D(
+ Vector2(2, 0),
+ Vector2(0, 4),
+ Vector2(0, 0)
+ )
+ # Rotating the Transform2D in any way preserves its scale.
+ my_transform = my_transform.rotated(TAU / 2)
+
+ print(my_transform.get_scale()) # Prints (2, 4).
+ [/gdscript]
+ [csharp]
+ var myTransform = new Transform2D(
+ Vector3(2.0f, 0.0f),
+ Vector3(0.0f, 4.0f),
+ Vector3(0.0f, 0.0f)
+ );
+ // Rotating the Transform2D in any way preserves its scale.
+ myTransform = myTransform.Rotated(Mathf.Tau / 2.0f);
+
+ GD.Print(myTransform.GetScale()); // Prints (2, 4, 8).
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] If the value returned by [method determinant] is negative, the scale is also negative.
</description>
</method>
<method name="get_skew" qualifiers="const">
<return type="float" />
<description>
- Returns the transform's skew (in radians).
+ Returns this transform's skew (in radians).
</description>
</method>
<method name="interpolate_with" qualifiers="const">
@@ -116,19 +144,21 @@
<param index="0" name="xform" type="Transform2D" />
<param index="1" name="weight" type="float" />
<description>
- Returns a transform interpolated between this transform and another by a given [param weight] (on the range of 0.0 to 1.0).
+ Returns the result of the linear interpolation between this transform and [param xform] by the given [param weight].
+ The [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). Values outside this range are allowed and can be used to perform [i]extrapolation[/i] instead.
</description>
</method>
<method name="inverse" qualifiers="const">
<return type="Transform2D" />
<description>
- Returns the inverse of the transform, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not). Use [method affine_inverse] for non-orthonormal transforms (e.g. with scaling).
+ Returns the [url=https://en.wikipedia.org/wiki/Invertible_matrix]inverted version of this transform[/url].
+ [b]Note:[/b] For this method to return correctly, the transform's basis needs to be [i]orthonormal[/i] (see [method orthonormalized]). That means, the basis should only represent a rotation. If it does not, use [method affine_inverse] instead.
</description>
</method>
<method name="is_conformal" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the transform's basis is conformal, meaning it preserves angles and distance ratios, and may only be composed of rotation and uniform scale. Returns [code]false[/code] if the transform's basis has non-uniform scale or shear/skew. This can be used to validate if the transform is non-distorted, which is important for physics and other use cases.
+ Returns [code]true[/code] if this transform's basis is conformal. A conformal basis is both [i]orthogonal[/i] (the axes are perpendicular to each other) and [i]uniform[/i] (the axes share the same length). This method can be especially useful during physics calculations.
</description>
</method>
<method name="is_equal_approx" qualifiers="const">
@@ -148,14 +178,13 @@
<return type="Transform2D" />
<param index="0" name="target" type="Vector2" default="Vector2(0, 0)" />
<description>
- Returns a copy of the transform rotated such that the rotated X-axis points towards the [param target] position.
- Operations take place in global space.
+ Returns a copy of the transform rotated such that the rotated X-axis points towards the [param target] position, in global space.
</description>
</method>
<method name="orthonormalized" qualifiers="const">
<return type="Transform2D" />
<description>
- Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1).
+ Returns a copy of this transform with its basis orthonormalized. An orthonormal basis is both [i]orthogonal[/i] (the axes are perpendicular to each other) and [i]normalized[/i] (the axes have a length of [code]1[/code]), which also means it can only represent rotation.
</description>
</method>
<method name="rotated" qualifiers="const">
@@ -215,24 +244,41 @@
</methods>
<members>
<member name="origin" type="Vector2" setter="" getter="" default="Vector2(0, 0)">
- The origin vector (column 2, the third column). Equivalent to array index [code]2[/code]. The origin vector represents translation.
+ The translation offset of this transform, and the column [code]2[/code] of the matrix. In 2D space, this can be seen as the position.
</member>
<member name="x" type="Vector2" setter="" getter="" default="Vector2(1, 0)">
- The basis matrix's X vector (column 0). Equivalent to array index [code]0[/code].
+ The transform basis's X axis, and the column [code]0[/code] of the matrix. Combined with [member y], this represents the transform's rotation, scale, and skew.
+ On the identity transform, this vector points right ([constant Vector2.RIGHT]).
</member>
<member name="y" type="Vector2" setter="" getter="" default="Vector2(0, 1)">
- The basis matrix's Y vector (column 1). Equivalent to array index [code]1[/code].
+ The transform basis's Y axis, and the column [code]1[/code] of the matrix. Combined with [member x], this represents the transform's rotation, scale, and skew.
+ On the identity transform, this vector points down ([constant Vector2.DOWN]).
</member>
</members>
<constants>
<constant name="IDENTITY" value="Transform2D(1, 0, 0, 1, 0, 0)">
- The identity [Transform2D] with no translation, rotation or scaling applied. When applied to other data structures, [constant IDENTITY] performs no transformation.
+ The identity [Transform2D]. A transform with no translation, no rotation, and its scale being [code]1[/code]. When multiplied by another [Variant] such as [Rect2] or another [Transform2D], no transformation occurs. This means that:
+ - The [member x] points right ([constant Vector2.RIGHT]);
+ - The [member y] points down ([constant Vector2.DOWN]).
+ [codeblock]
+ var transform = Transform2D.IDENTITY
+ print("| X | Y | Origin")
+ print("| %s | %s | %s" % [transform.x.x, transform.y.x, transform.origin.x])
+ print("| %s | %s | %s" % [transform.x.y, transform.y.y, transform.origin.y])
+ # Prints:
+ # | X | Y | Origin
+ # | 1 | 0 | 0
+ # | 0 | 1 | 0
+ [/codeblock]
+ This is identical to creating [constructor Transform2D] without any parameters. This constant can be used to make your code clearer, and for consistency with C#.
</constant>
<constant name="FLIP_X" value="Transform2D(-1, 0, 0, 1, 0, 0)">
- The [Transform2D] that will flip something along the X axis.
+ When any transform is multiplied by [constant FLIP_X], it negates all components of the [member x] axis (the X column).
+ When [constant FLIP_X] is multiplied by any basis, it negates the [member Vector2.x] component of all axes (the X row).
</constant>
<constant name="FLIP_Y" value="Transform2D(1, 0, 0, -1, 0, 0)">
- The [Transform2D] that will flip something along the Y axis.
+ When any transform is multiplied by [constant FLIP_Y], it negates all components of the [member y] axis (the Y column).
+ When [constant FLIP_Y] is multiplied by any basis, it negates the [member Vector2.y] component of all axes (the Y row).
</constant>
</constants>
<operators>
@@ -240,7 +286,7 @@
<return type="bool" />
<param index="0" name="right" type="Transform2D" />
<description>
- Returns [code]true[/code] if the transforms are not equal.
+ Returns [code]true[/code] if the components of both transforms are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
</description>
</operator>
@@ -248,63 +294,69 @@
<return type="PackedVector2Array" />
<param index="0" name="right" type="PackedVector2Array" />
<description>
- Transforms (multiplies) each element of the [Vector2] array by the given [Transform2D] matrix.
+ Transforms (multiplies) every [Vector2] element of the given [PackedVector2Array] by this transformation matrix.
+ On larger arrays, this operation is much faster than transforming each [Vector2] individually.
</description>
</operator>
<operator name="operator *">
<return type="Rect2" />
<param index="0" name="right" type="Rect2" />
<description>
- Transforms (multiplies) the [Rect2] by the given [Transform2D] matrix.
+ Transforms (multiplies) the [Rect2] by this transformation matrix.
</description>
</operator>
<operator name="operator *">
<return type="Transform2D" />
<param index="0" name="right" type="Transform2D" />
<description>
- Composes these two transformation matrices by multiplying them together. This has the effect of transforming the second transform (the child) by the first transform (the parent).
+ Transforms (multiplies) this transform by the [param right] transform.
+ This is the operation performed between parent and child [CanvasItem] nodes.
+ [b]Note:[/b] If you need to only modify one attribute of this transform, consider using one of the following methods, instead:
+ - For translation, see [method translated] or [method translated_local].
+ - For rotation, see [method rotated] or [method rotated_local].
+ - For scale, see [method scaled] or [method scaled_local].
</description>
</operator>
<operator name="operator *">
<return type="Vector2" />
<param index="0" name="right" type="Vector2" />
<description>
- Transforms (multiplies) the [Vector2] by the given [Transform2D] matrix.
+ Transforms (multiplies) the [Vector2] by this transformation matrix.
</description>
</operator>
<operator name="operator *">
<return type="Transform2D" />
<param index="0" name="right" type="float" />
<description>
- This operator multiplies all components of the [Transform2D], including the [member origin] vector, which scales it uniformly.
+ Multiplies all components of the [Transform2D] by the given [float], including the [member origin]. This affects the transform's scale uniformly.
</description>
</operator>
<operator name="operator *">
<return type="Transform2D" />
<param index="0" name="right" type="int" />
<description>
- This operator multiplies all components of the [Transform2D], including the [member origin] vector, which scales it uniformly.
+ Multiplies all components of the [Transform2D] by the given [int], including the [member origin]. This affects the transform's scale uniformly.
</description>
</operator>
<operator name="operator /">
<return type="Transform2D" />
<param index="0" name="right" type="float" />
<description>
- This operator divides all components of the [Transform2D], including the [member origin] vector, which inversely scales it uniformly.
+ Divides all components of the [Transform2D] by the given [float], including the [member origin]. This affects the transform's scale uniformly.
</description>
</operator>
<operator name="operator /">
<return type="Transform2D" />
<param index="0" name="right" type="int" />
<description>
- This operator divides all components of the [Transform2D], including the [member origin] vector, which inversely scales it uniformly.
+ Divides all components of the [Transform2D] by the given [int], including the [member origin]. This affects the transform's scale uniformly.
</description>
</operator>
<operator name="operator ==">
<return type="bool" />
<param index="0" name="right" type="Transform2D" />
<description>
- Returns [code]true[/code] if the transforms are exactly equal.
+ Returns [code]true[/code] if the components of both transforms are exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
</description>
</operator>
@@ -312,7 +364,7 @@
<return type="Vector2" />
<param index="0" name="index" type="int" />
<description>
- Access transform components using their index. [code]t[0][/code] is equivalent to [code]t.x[/code], [code]t[1][/code] is equivalent to [code]t.y[/code], and [code]t[2][/code] is equivalent to [code]t.origin[/code].
+ Accesses each axis (column) of this transform by their index. Index [code]0[/code] is the same as [member x], index [code]1[/code] is the same as [member y], and index [code]2[/code] is the same as [member origin].
</description>
</operator>
</operators>
diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml
index 2a0bbc46af..98e9d56adb 100644
--- a/doc/classes/Transform3D.xml
+++ b/doc/classes/Transform3D.xml
@@ -6,7 +6,7 @@
<description>
The [Transform3D] built-in [Variant] type is a 3×4 matrix representing a transformation in 3D space. It contains a [Basis], which on its own can represent rotation, scale, and shear. Additionally, combined with its own [member origin], the transform can also represent a translation.
For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial.
- [b]Note:[/b] Godot uses a [url=https://en.wikipedia.org/wiki/Right-hand_rule]right-handed coordinate system[/url], which is a common standard. For directions, the convention for built-in types like [Camera3D] is for -Z to point forward (+X is right, +Y is up, and +Z is back). Other objects may use different direction conventions. For more information, see the [url=$DOCS_URL/tutorials/assets_pipeline/importing_scenes.html#d-asset-direction-conventions]Importing 3D Scenes[/url] tutorial.
+ [b]Note:[/b] Godot uses a [url=https://en.wikipedia.org/wiki/Right-hand_rule]right-handed coordinate system[/url], which is a common standard. For directions, the convention for built-in types like [Camera3D] is for -Z to point forward (+X is right, +Y is up, and +Z is back). Other objects may use different direction conventions. For more information, see the [url=$DOCS_URL/tutorials/assets_pipeline/importing_3d_scenes/model_export_considerations.html#d-asset-direction-conventions]3D asset direction conventions[/url] tutorial.
</description>
<tutorials>
<link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link>
@@ -21,6 +21,7 @@
<return type="Transform3D" />
<description>
Constructs a [Transform3D] identical to the [constant IDENTITY].
+ [b]Note:[/b] In C#, this constructs a [Transform3D] with its [member origin] and the components of its [member basis] set to [constant Vector3.ZERO].
</description>
</constructor>
<constructor name="Transform3D">
@@ -128,7 +129,7 @@
<param index="1" name="angle" type="float" />
<description>
Returns a copy of this transform rotated around the given [param axis] by the given [param angle] (in radians).
- The [param axis] must be a normalized vector.
+ The [param axis] must be a normalized vector in the transform's local coordinate system. For example, to rotate around the local X-axis, use [constant Vector3.RIGHT].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code].
This can be seen as transforming with respect to the local frame.
</description>
diff --git a/doc/classes/TranslationDomain.xml b/doc/classes/TranslationDomain.xml
new file mode 100644
index 0000000000..5045f86260
--- /dev/null
+++ b/doc/classes/TranslationDomain.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="TranslationDomain" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+ <brief_description>
+ A self-contained collection of [Translation] resources.
+ </brief_description>
+ <description>
+ [TranslationDomain] is a self-contained collection of [Translation] resources. Translations can be added to or removed from it.
+ If you're working with the main translation domain, it is more convenient to use the wrap methods on [TranslationServer].
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_translation">
+ <return type="void" />
+ <param index="0" name="translation" type="Translation" />
+ <description>
+ Adds a translation.
+ </description>
+ </method>
+ <method name="clear">
+ <return type="void" />
+ <description>
+ Removes all translations.
+ </description>
+ </method>
+ <method name="get_translation_object" qualifiers="const">
+ <return type="Translation" />
+ <param index="0" name="locale" type="String" />
+ <description>
+ Returns the [Translation] instance that best matches [param locale]. Returns [code]null[/code] if there are no matches.
+ </description>
+ </method>
+ <method name="pseudolocalize" qualifiers="const">
+ <return type="StringName" />
+ <param index="0" name="message" type="StringName" />
+ <description>
+ Returns the pseudolocalized string based on the [param message] passed in.
+ </description>
+ </method>
+ <method name="remove_translation">
+ <return type="void" />
+ <param index="0" name="translation" type="Translation" />
+ <description>
+ Removes the given translation.
+ </description>
+ </method>
+ <method name="translate" qualifiers="const">
+ <return type="StringName" />
+ <param index="0" name="message" type="StringName" />
+ <param index="1" name="context" type="StringName" default="&amp;&quot;&quot;" />
+ <description>
+ Returns the current locale's translation for the given message and context.
+ </description>
+ </method>
+ <method name="translate_plural" qualifiers="const">
+ <return type="StringName" />
+ <param index="0" name="message" type="StringName" />
+ <param index="1" name="message_plural" type="StringName" />
+ <param index="2" name="n" type="int" />
+ <param index="3" name="context" type="StringName" default="&amp;&quot;&quot;" />
+ <description>
+ Returns the current locale's translation for the given message, plural message and context.
+ The number [param n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="pseudolocalization_accents_enabled" type="bool" setter="set_pseudolocalization_accents_enabled" getter="is_pseudolocalization_accents_enabled" default="true">
+ Replace all characters with their accented variants during pseudolocalization.
+ [b]Note:[/b] Updating this property does not automatically update texts in the scene tree. Please propagate the [constant MainLoop.NOTIFICATION_TRANSLATION_CHANGED] notification manually after you have finished modifying pseudolocalization related options.
+ </member>
+ <member name="pseudolocalization_double_vowels_enabled" type="bool" setter="set_pseudolocalization_double_vowels_enabled" getter="is_pseudolocalization_double_vowels_enabled" default="false">
+ Double vowels in strings during pseudolocalization to simulate the lengthening of text due to localization.
+ [b]Note:[/b] Updating this property does not automatically update texts in the scene tree. Please propagate the [constant MainLoop.NOTIFICATION_TRANSLATION_CHANGED] notification manually after you have finished modifying pseudolocalization related options.
+ </member>
+ <member name="pseudolocalization_enabled" type="bool" setter="set_pseudolocalization_enabled" getter="is_pseudolocalization_enabled" default="false">
+ If [code]true[/code], enables pseudolocalization for the project. This can be used to spot untranslatable strings or layout issues that may occur once the project is localized to languages that have longer strings than the source language.
+ [b]Note:[/b] Updating this property does not automatically update texts in the scene tree. Please propagate the [constant MainLoop.NOTIFICATION_TRANSLATION_CHANGED] notification manually after you have finished modifying pseudolocalization related options.
+ </member>
+ <member name="pseudolocalization_expansion_ratio" type="float" setter="set_pseudolocalization_expansion_ratio" getter="get_pseudolocalization_expansion_ratio" default="0.0">
+ The expansion ratio to use during pseudolocalization. A value of [code]0.3[/code] is sufficient for most practical purposes, and will increase the length of each string by 30%.
+ [b]Note:[/b] Updating this property does not automatically update texts in the scene tree. Please propagate the [constant MainLoop.NOTIFICATION_TRANSLATION_CHANGED] notification manually after you have finished modifying pseudolocalization related options.
+ </member>
+ <member name="pseudolocalization_fake_bidi_enabled" type="bool" setter="set_pseudolocalization_fake_bidi_enabled" getter="is_pseudolocalization_fake_bidi_enabled" default="false">
+ If [code]true[/code], emulate bidirectional (right-to-left) text when pseudolocalization is enabled. This can be used to spot issues with RTL layout and UI mirroring that will crop up if the project is localized to RTL languages such as Arabic or Hebrew.
+ [b]Note:[/b] Updating this property does not automatically update texts in the scene tree. Please propagate the [constant MainLoop.NOTIFICATION_TRANSLATION_CHANGED] notification manually after you have finished modifying pseudolocalization related options.
+ </member>
+ <member name="pseudolocalization_override_enabled" type="bool" setter="set_pseudolocalization_override_enabled" getter="is_pseudolocalization_override_enabled" default="false">
+ Replace all characters in the string with [code]*[/code]. Useful for finding non-localizable strings.
+ [b]Note:[/b] Updating this property does not automatically update texts in the scene tree. Please propagate the [constant MainLoop.NOTIFICATION_TRANSLATION_CHANGED] notification manually after you have finished modifying pseudolocalization related options.
+ </member>
+ <member name="pseudolocalization_prefix" type="String" setter="set_pseudolocalization_prefix" getter="get_pseudolocalization_prefix" default="&quot;[&quot;">
+ Prefix that will be prepended to the pseudolocalized string.
+ [b]Note:[/b] Updating this property does not automatically update texts in the scene tree. Please propagate the [constant MainLoop.NOTIFICATION_TRANSLATION_CHANGED] notification manually after you have finished modifying pseudolocalization related options.
+ </member>
+ <member name="pseudolocalization_skip_placeholders_enabled" type="bool" setter="set_pseudolocalization_skip_placeholders_enabled" getter="is_pseudolocalization_skip_placeholders_enabled" default="true">
+ Skip placeholders for string formatting like [code]%s[/code] or [code]%f[/code] during pseudolocalization. Useful to identify strings which need additional control characters to display correctly.
+ [b]Note:[/b] Updating this property does not automatically update texts in the scene tree. Please propagate the [constant MainLoop.NOTIFICATION_TRANSLATION_CHANGED] notification manually after you have finished modifying pseudolocalization related options.
+ </member>
+ <member name="pseudolocalization_suffix" type="String" setter="set_pseudolocalization_suffix" getter="get_pseudolocalization_suffix" default="&quot;]&quot;">
+ Suffix that will be appended to the pseudolocalized string.
+ [b]Note:[/b] Updating this property does not automatically update texts in the scene tree. Please propagate the [constant MainLoop.NOTIFICATION_TRANSLATION_CHANGED] notification manually after you have finished modifying pseudolocalization related options.
+ </member>
+ </members>
+</class>
diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml
index db1a65278c..69ca984f67 100644
--- a/doc/classes/TranslationServer.xml
+++ b/doc/classes/TranslationServer.xml
@@ -4,7 +4,8 @@
The server responsible for language translations.
</brief_description>
<description>
- The server that manages all language translations. Translations can be added to or removed from it.
+ The translation server is the API backend that manages all language translations.
+ Translations are stored in [TranslationDomain]s, which can be accessed by name. The most commonly used translation domain is the main translation domain. It always exists and can be accessed using an empty [StringName]. The translation server provides wrapper methods for accessing the main translation domain directly, without having to fetch the translation domain first. Custom translation domains are mainly for advanced usages like editor plugins. Names starting with [code]godot.[/code] are reserved for engine internals.
</description>
<tutorials>
<link title="Internationalizing games">$DOCS_URL/tutorials/i18n/internationalizing_games.html</link>
@@ -15,13 +16,13 @@
<return type="void" />
<param index="0" name="translation" type="Translation" />
<description>
- Adds a [Translation] resource.
+ Adds a translation to the main translation domain.
</description>
</method>
<method name="clear">
<return type="void" />
<description>
- Clears the server from all translations.
+ Removes all translations from the main translation domain.
</description>
</method>
<method name="compare_locales" qualifiers="const">
@@ -84,6 +85,13 @@
Returns a locale's language and its variant (e.g. [code]"en_US"[/code] would return [code]"English (United States)"[/code]).
</description>
</method>
+ <method name="get_or_add_domain">
+ <return type="TranslationDomain" />
+ <param index="0" name="domain" type="StringName" />
+ <description>
+ Returns the translation domain with the specified name. An empty translation domain will be created and added if it does not exist.
+ </description>
+ </method>
<method name="get_script_name" qualifiers="const">
<return type="String" />
<param index="0" name="script" type="String" />
@@ -102,8 +110,14 @@
<return type="Translation" />
<param index="0" name="locale" type="String" />
<description>
- Returns the [Translation] instance based on the [param locale] passed in.
- It will return [code]null[/code] if there is no [Translation] instance that matches the [param locale].
+ Returns the [Translation] instance that best matches [param locale] in the main translation domain. Returns [code]null[/code] if there are no matches.
+ </description>
+ </method>
+ <method name="has_domain" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="domain" type="StringName" />
+ <description>
+ Returns [code]true[/code] if a translation domain with the specified name exists.
</description>
</method>
<method name="pseudolocalize" qualifiers="const">
@@ -111,19 +125,28 @@
<param index="0" name="message" type="StringName" />
<description>
Returns the pseudolocalized string based on the [param message] passed in.
+ [b]Note:[/b] This method always uses the main translation domain.
</description>
</method>
<method name="reload_pseudolocalization">
<return type="void" />
<description>
- Reparses the pseudolocalization options and reloads the translation.
+ Reparses the pseudolocalization options and reloads the translation for the main translation domain.
+ </description>
+ </method>
+ <method name="remove_domain">
+ <return type="void" />
+ <param index="0" name="domain" type="StringName" />
+ <description>
+ Removes the translation domain with the specified name.
+ [b]Note:[/b] Trying to remove the main translation domain is an error.
</description>
</method>
<method name="remove_translation">
<return type="void" />
<param index="0" name="translation" type="Translation" />
<description>
- Removes the given translation from the server.
+ Removes the given translation from the main translation domain.
</description>
</method>
<method name="set_locale">
@@ -146,7 +169,8 @@
<param index="0" name="message" type="StringName" />
<param index="1" name="context" type="StringName" default="&amp;&quot;&quot;" />
<description>
- Returns the current locale's translation for the given message (key) and context.
+ Returns the current locale's translation for the given message and context.
+ [b]Note:[/b] This method always uses the main translation domain.
</description>
</method>
<method name="translate_plural" qualifiers="const">
@@ -156,14 +180,15 @@
<param index="2" name="n" type="int" />
<param index="3" name="context" type="StringName" default="&amp;&quot;&quot;" />
<description>
- Returns the current locale's translation for the given message (key), plural message and context.
+ Returns the current locale's translation for the given message, plural message and context.
The number [param n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language.
+ [b]Note:[/b] This method always uses the main translation domain.
</description>
</method>
</methods>
<members>
<member name="pseudolocalization_enabled" type="bool" setter="set_pseudolocalization_enabled" getter="is_pseudolocalization_enabled" default="false">
- If [code]true[/code], enables the use of pseudolocalization. See [member ProjectSettings.internationalization/pseudolocalization/use_pseudolocalization] for details.
+ If [code]true[/code], enables the use of pseudolocalization on the main translation domain. See [member ProjectSettings.internationalization/pseudolocalization/use_pseudolocalization] for details.
</member>
</members>
</class>
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index b0cb25fafd..9510d237da 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -509,6 +509,12 @@
<theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)">
Text [Color] for a [constant TreeItem.CELL_MODE_CHECK] mode cell when it's non-editable (see [method TreeItem.set_editable]).
</theme_item>
+ <theme_item name="font_hovered_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
+ Text [Color] used when the item is hovered.
+ </theme_item>
+ <theme_item name="font_hovered_dimmed_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
+ Text [Color] used when the item is hovered, while a button of the same item is hovered as the same time.
+ </theme_item>
<theme_item name="font_outline_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)">
The tint of text outline of the item.
</theme_item>
@@ -645,6 +651,9 @@
<theme_item name="updown" data_type="icon" type="Texture2D">
The updown arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell.
</theme_item>
+ <theme_item name="button_hover" data_type="style" type="StyleBox">
+ [StyleBox] used when a button in the tree is hovered.
+ </theme_item>
<theme_item name="button_pressed" data_type="style" type="StyleBox">
[StyleBox] used when a button in the tree is pressed.
</theme_item>
@@ -666,6 +675,12 @@
<theme_item name="focus" data_type="style" type="StyleBox">
The focused style for the [Tree], drawn on top of everything.
</theme_item>
+ <theme_item name="hovered" data_type="style" type="StyleBox">
+ [StyleBox] for the item being hovered.
+ </theme_item>
+ <theme_item name="hovered_dimmed" data_type="style" type="StyleBox">
+ [StyleBox] for the item being hovered, while a button of the same item is hovered as the same time.
+ </theme_item>
<theme_item name="panel" data_type="style" type="StyleBox">
The background style for the [Tree].
</theme_item>
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index 78a703c213..d04a6f7316 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -19,7 +19,7 @@
<param index="3" name="disabled" type="bool" default="false" />
<param index="4" name="tooltip_text" type="String" default="&quot;&quot;" />
<description>
- Adds a button with [Texture2D] [param button] at column [param column]. The [param id] is used to identify the button in the according [signal Tree.button_clicked] signal and can be different from the buttons index. If not specified, the next available index is used, which may be retrieved by calling [method get_button_count] immediately before this method. Optionally, the button can be [param disabled] and have a [param tooltip_text].
+ Adds a button with [Texture2D] [param button] to the end of the cell at column [param column]. The [param id] is used to identify the button in the according [signal Tree.button_clicked] signal and can be different from the buttons index. If not specified, the next available index is used, which may be retrieved by calling [method get_button_count] immediately before this method. Optionally, the button can be [param disabled] and have a [param tooltip_text].
</description>
</method>
<method name="add_child">
@@ -73,6 +73,13 @@
Removes the button at index [param button_index] in column [param column].
</description>
</method>
+ <method name="get_auto_translate_mode" qualifiers="const">
+ <return type="int" enum="Node.AutoTranslateMode" />
+ <param index="0" name="column" type="int" />
+ <description>
+ Returns the column's auto translate mode.
+ </description>
+ </method>
<method name="get_autowrap_mode" qualifiers="const">
<return type="int" enum="TextServer.AutowrapMode" />
<param index="0" name="column" type="int" />
@@ -223,6 +230,13 @@
Returns the [Color] modulating the column's icon.
</description>
</method>
+ <method name="get_icon_overlay" qualifiers="const">
+ <return type="Texture2D" />
+ <param index="0" name="column" type="int" />
+ <description>
+ Returns the given column's icon overlay [Texture2D].
+ </description>
+ </method>
<method name="get_icon_region" qualifiers="const">
<return type="Rect2" />
<param index="0" name="column" type="int" />
@@ -253,7 +267,7 @@
<method name="get_next" qualifiers="const">
<return type="TreeItem" />
<description>
- Returns the next sibling TreeItem in the tree or a null object if there is none.
+ Returns the next sibling TreeItem in the tree or a [code]null[/code] object if there is none.
</description>
</method>
<method name="get_next_in_tree">
@@ -275,13 +289,13 @@
<method name="get_parent" qualifiers="const">
<return type="TreeItem" />
<description>
- Returns the parent TreeItem or a null object if there is none.
+ Returns the parent TreeItem or a [code]null[/code] object if there is none.
</description>
</method>
<method name="get_prev">
<return type="TreeItem" />
<description>
- Returns the previous sibling TreeItem in the tree or a null object if there is none.
+ Returns the previous sibling TreeItem in the tree or a [code]null[/code] object if there is none.
</description>
</method>
<method name="get_prev_in_tree">
@@ -486,6 +500,15 @@
Selects the given [param column].
</description>
</method>
+ <method name="set_auto_translate_mode">
+ <return type="void" />
+ <param index="0" name="column" type="int" />
+ <param index="1" name="mode" type="int" enum="Node.AutoTranslateMode" />
+ <description>
+ Sets the given column's auto translate mode to [param mode].
+ All columns use [constant Node.AUTO_TRANSLATE_MODE_INHERIT] by default, which uses the same auto translate mode as the [Tree] itself.
+ </description>
+ </method>
<method name="set_autowrap_mode">
<return type="void" />
<param index="0" name="column" type="int" />
@@ -643,7 +666,7 @@
<param index="0" name="column" type="int" />
<param index="1" name="texture" type="Texture2D" />
<description>
- Sets the given cell's icon [Texture2D]. The cell has to be in [constant CELL_MODE_ICON] mode.
+ Sets the given cell's icon [Texture2D]. If the cell is in [constant CELL_MODE_ICON] mode, the icon is displayed in the center of the cell. Otherwise, the icon is displayed before the cell's text. [constant CELL_MODE_RANGE] does not display an icon.
</description>
</method>
<method name="set_icon_max_width">
@@ -662,6 +685,14 @@
Modulates the given column's icon with [param modulate].
</description>
</method>
+ <method name="set_icon_overlay">
+ <return type="void" />
+ <param index="0" name="column" type="int" />
+ <param index="1" name="texture" type="Texture2D" />
+ <description>
+ Sets the given cell's icon overlay [Texture2D]. The cell has to be in [constant CELL_MODE_ICON] mode, and icon has to be set. Overlay is drawn on top of icon, in the bottom left corner.
+ </description>
+ </method>
<method name="set_icon_region">
<return type="void" />
<param index="0" name="column" type="int" />
@@ -811,17 +842,17 @@
</members>
<constants>
<constant name="CELL_MODE_STRING" value="0" enum="TreeCellMode">
- Cell shows a string label. When editable, the text can be edited using a [LineEdit], or a [TextEdit] popup if [method set_edit_multiline] is used.
+ Cell shows a string label, optionally with an icon. When editable, the text can be edited using a [LineEdit], or a [TextEdit] popup if [method set_edit_multiline] is used.
</constant>
<constant name="CELL_MODE_CHECK" value="1" enum="TreeCellMode">
- Cell shows a checkbox, optionally with text. The checkbox can be pressed, released, or indeterminate (via [method set_indeterminate]). The checkbox can't be clicked unless the cell is editable.
+ Cell shows a checkbox, optionally with text and an icon. The checkbox can be pressed, released, or indeterminate (via [method set_indeterminate]). The checkbox can't be clicked unless the cell is editable.
</constant>
<constant name="CELL_MODE_RANGE" value="2" enum="TreeCellMode">
Cell shows a numeric range. When editable, it can be edited using a range slider. Use [method set_range] to set the value and [method set_range_config] to configure the range.
This cell can also be used in a text dropdown mode when you assign a text with [method set_text]. Separate options with a comma, e.g. [code]"Option1,Option2,Option3"[/code].
</constant>
<constant name="CELL_MODE_ICON" value="3" enum="TreeCellMode">
- Cell shows an icon. It can't be edited nor display text.
+ Cell shows an icon. It can't be edited nor display text. The icon is always centered within the cell.
</constant>
<constant name="CELL_MODE_CUSTOM" value="4" enum="TreeCellMode">
Cell shows as a clickable button. It will display an arrow similar to [OptionButton], but doesn't feature a dropdown (for that you can use [constant CELL_MODE_RANGE]). Clicking the button emits the [signal Tree.item_edited] signal. The button is flat by default, you can use [method set_custom_as_button] to display it with a [StyleBox].
diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml
index ac16bebecb..147d9fa4bd 100644
--- a/doc/classes/Tween.xml
+++ b/doc/classes/Tween.xml
@@ -183,7 +183,6 @@
<return type="Tween" />
<description>
Makes the next [Tweener] run parallelly to the previous one.
- [b]Example:[/b]
[codeblocks]
[gdscript]
var tween = create_tween()
@@ -219,8 +218,14 @@
<return type="Tween" />
<param index="0" name="ease" type="int" enum="Tween.EaseType" />
<description>
- Sets the default ease type for [PropertyTweener]s and [MethodTweener]s animated by this [Tween].
- If not specified, the default value is [constant EASE_IN_OUT].
+ Sets the default ease type for [PropertyTweener]s and [MethodTweener]s appended after this method.
+ Before this method is called, the default ease type is [constant EASE_IN_OUT].
+ [codeblock]
+ var tween = create_tween()
+ tween.tween_property(self, "position", Vector2(300, 0), 0.5) # Uses EASE_IN_OUT.
+ tween.set_ease(Tween.EASE_IN)
+ tween.tween_property(self, "rotation_degrees", 45.0, 0.5) # Uses EASE_IN.
+ [/codeblock]
</description>
</method>
<method name="set_loops">
@@ -272,14 +277,36 @@
<return type="Tween" />
<param index="0" name="trans" type="int" enum="Tween.TransitionType" />
<description>
- Sets the default transition type for [PropertyTweener]s and [MethodTweener]s animated by this [Tween].
- If not specified, the default value is [constant TRANS_LINEAR].
+ Sets the default transition type for [PropertyTweener]s and [MethodTweener]s appended after this method.
+ Before this method is called, the default transition type is [constant TRANS_LINEAR].
+ [codeblock]
+ var tween = create_tween()
+ tween.tween_property(self, "position", Vector2(300, 0), 0.5) # Uses TRANS_LINEAR.
+ tween.set_trans(Tween.TRANS_SINE)
+ tween.tween_property(self, "rotation_degrees", 45.0, 0.5) # Uses TRANS_SINE.
+ [/codeblock]
</description>
</method>
<method name="stop">
<return type="void" />
<description>
Stops the tweening and resets the [Tween] to its initial state. This will not remove any appended [Tweener]s.
+ [b]Note:[/b] This does [i]not[/i] reset targets of [PropertyTweener]s to their values when the [Tween] first started.
+ [codeblock]
+ var tween = create_tween()
+
+ # Will move from 0 to 500 over 1 second.
+ position.x = 0.0
+ tween.tween_property(self, "position:x", 500, 1.0)
+
+ # Will be at (about) 250 when the timer finishes.
+ await get_tree().create_timer(0.5).timeout
+
+ # Will now move from (about) 250 to 500 over 1 second,
+ # thus at half the speed as before.
+ tween.stop()
+ tween.play()
+ [/codeblock]
[b]Note:[/b] If a Tween is stopped and not bound to any node, it will exist indefinitely until manually started or invalidated. If you lose a reference to such Tween, you can retrieve it using [method SceneTree.get_processed_tweens].
</description>
</method>
@@ -410,7 +437,6 @@
<param index="3" name="duration" type="float" />
<description>
Creates and appends a [PropertyTweener]. This method tweens a [param property] of an [param object] between an initial value and [param final_val] in a span of time equal to [param duration], in seconds. The initial value by default is the property's value at the time the tweening of the [PropertyTweener] starts.
- [b]Example:[/b]
[codeblocks]
[gdscript]
var tween = create_tween()
diff --git a/doc/classes/Tweener.xml b/doc/classes/Tweener.xml
index 65148e875d..88f5f9978c 100644
--- a/doc/classes/Tweener.xml
+++ b/doc/classes/Tweener.xml
@@ -11,7 +11,7 @@
<signals>
<signal name="finished">
<description>
- Emitted when the [Tweener] has just finished its job.
+ Emitted when the [Tweener] has just finished its job or became invalid (e.g. due to a freed object).
</description>
</signal>
</signals>
diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml
index 8f54b767e0..b351f2ccb6 100644
--- a/doc/classes/Vector4i.xml
+++ b/doc/classes/Vector4i.xml
@@ -216,7 +216,7 @@
<return type="Vector4i" />
<param index="0" name="right" type="int" />
<description>
- Gets the remainder of each component of the [Vector4i] with the the given [int]. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers.
+ Gets the remainder of each component of the [Vector4i] with the given [int]. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers.
[codeblock]
print(Vector4i(10, -20, 30, -40) % 7) # Prints "(3, -6, 2, -5)"
[/codeblock]
diff --git a/doc/classes/VehicleWheel3D.xml b/doc/classes/VehicleWheel3D.xml
index 92b2297bf4..621f32de6d 100644
--- a/doc/classes/VehicleWheel3D.xml
+++ b/doc/classes/VehicleWheel3D.xml
@@ -18,6 +18,18 @@
Returns [code]null[/code] if the wheel is not in contact with a surface, or the contact body is not a [PhysicsBody3D].
</description>
</method>
+ <method name="get_contact_normal" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Returns the normal of the suspension's collision in world space if the wheel is in contact. If the wheel isn't in contact with anything, returns a vector pointing directly along the suspension axis toward the vehicle in world space.
+ </description>
+ </method>
+ <method name="get_contact_point" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Returns the point of the suspension's collision in world space if the wheel is in contact. If the wheel isn't in contact with anything, returns the maximum point of the wheel's ray cast in world space, which is defined by [code]wheel_rest_length + wheel_radius[/code].
+ </description>
+ </method>
<method name="get_rpm" qualifiers="const">
<return type="float" />
<description>
@@ -42,10 +54,10 @@
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.
</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.
+ The damping applied to the suspension spring when being compressed, meaning when the wheel is moving up relative to the vehicle. It is measured in Newton-seconds per millimeter (N⋅s/mm), or megagrams per second (Mg/s). This value should be between 0.0 (no damping) and 1.0, but may be more. 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.
</member>
<member name="damping_relaxation" type="float" setter="set_damping_relaxation" getter="get_damping_relaxation" default="0.88">
- 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.
+ The damping applied to the suspension spring when rebounding or extending, meaning when the wheel is moving down relative to the vehicle. It is measured in Newton-seconds per millimeter (N⋅s/mm), or megagrams per second (Mg/s). This value should be between 0.0 (no damping) and 1.0, but may be more. 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 sped 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.
@@ -59,7 +71,7 @@
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.
</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.
+ The stiffness of the suspension, measured in Newtons per millimeter (N/mm), or megagrams per second squared (Mg/s²). 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.
</member>
<member name="suspension_travel" type="float" setter="set_suspension_travel" getter="get_suspension_travel" default="0.2">
This is the distance the suspension can travel. As Godot units are equivalent to meters, keep this setting relatively low. Try a value between 0.1 and 0.3 depending on the type of car.
diff --git a/doc/classes/VideoStreamPlayback.xml b/doc/classes/VideoStreamPlayback.xml
index 8b4a7f8d29..17e29ae337 100644
--- a/doc/classes/VideoStreamPlayback.xml
+++ b/doc/classes/VideoStreamPlayback.xml
@@ -54,7 +54,7 @@
<method name="_play" qualifiers="virtual">
<return type="void" />
<description>
- Called in response to [member VideoStreamPlayer.autoplay] or [method VideoStreamPlayer.play]. Note that manual playback may also invoke [method _stop] multiple times before this method is called. [method _is_playing] should return true once playing.
+ Called in response to [member VideoStreamPlayer.autoplay] or [method VideoStreamPlayer.play]. Note that manual playback may also invoke [method _stop] multiple times before this method is called. [method _is_playing] should return [code]true[/code] once playing.
</description>
</method>
<method name="_seek" qualifiers="virtual">
@@ -81,14 +81,14 @@
<method name="_stop" qualifiers="virtual">
<return type="void" />
<description>
- Stops playback. May be called multiple times before [method _play], or in response to [method VideoStreamPlayer.stop]. [method _is_playing] should return false once stopped.
+ Stops playback. May be called multiple times before [method _play], or in response to [method VideoStreamPlayer.stop]. [method _is_playing] should return [code]false[/code] once stopped.
</description>
</method>
<method name="_update" qualifiers="virtual">
<return type="void" />
<param index="0" name="delta" type="float" />
<description>
- Ticks video playback for [param delta] seconds. Called every frame as long as [method _is_paused] and [method _is_playing] return true.
+ Ticks video playback for [param delta] seconds. Called every frame as long as both [method _is_paused] and [method _is_playing] return [code]true[/code].
</description>
</method>
<method name="mix_audio">
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index b288ee7ff6..78b6d527ea 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -33,10 +33,22 @@
Returns the first valid [World3D] for this viewport, searching the [member world_3d] property of itself and any Viewport ancestor.
</description>
</method>
+ <method name="get_audio_listener_2d" qualifiers="const">
+ <return type="AudioListener2D" />
+ <description>
+ Returns the currently active 2D audio listener. Returns [code]null[/code] if there are no active 2D audio listeners, in which case the active 2D camera will be treated as listener.
+ </description>
+ </method>
+ <method name="get_audio_listener_3d" qualifiers="const">
+ <return type="AudioListener3D" />
+ <description>
+ Returns the currently active 3D audio listener. Returns [code]null[/code] if there are no active 3D audio listeners, in which case the active 3D camera will be treated as listener.
+ </description>
+ </method>
<method name="get_camera_2d" qualifiers="const">
<return type="Camera2D" />
<description>
- Returns the currently active 2D camera. Returns null if there are no active cameras.
+ Returns the currently active 2D camera. Returns [code]null[/code] if there are no active cameras.
</description>
</method>
<method name="get_camera_3d" qualifiers="const">
@@ -102,6 +114,7 @@
await RenderingServer.frame_post_draw
$Viewport.get_texture().get_image().save_png("user://Screenshot.png")
[/codeblock]
+ [b]Note:[/b] When [member use_hdr_2d] is [code]true[/code] the returned texture will be an HDR image encoded in linear space.
</description>
</method>
<method name="get_viewport_rid" qualifiers="const">
@@ -116,6 +129,12 @@
Returns the visible rectangle in global screen coordinates.
</description>
</method>
+ <method name="gui_cancel_drag">
+ <return type="void" />
+ <description>
+ Cancels the drag operation that was previously started through [method Control._get_drag_data] or forced with [method Control.force_drag].
+ </description>
+ </method>
<method name="gui_get_drag_data" qualifiers="const">
<return type="Variant" />
<description>
@@ -125,13 +144,13 @@
<method name="gui_get_focus_owner" qualifiers="const">
<return type="Control" />
<description>
- Returns the [Control] having the focus within this viewport. If no [Control] has the focus, returns null.
+ Returns the currently focused [Control] within this viewport. If no [Control] is focused, returns [code]null[/code].
</description>
</method>
<method name="gui_get_hovered_control" qualifiers="const">
<return type="Control" />
<description>
- Returns the [Control] that the mouse is currently hovering over in this viewport. If no [Control] has the cursor, returns null.
+ Returns the [Control] that the mouse is currently hovering over in this viewport. If no [Control] has the cursor, returns [code]null[/code].
Typically the leaf [Control] node or deepest level of the subtree which claims hover. This is very useful when used together with [method Node.is_ancestor_of] to find if the mouse is within a control tree.
</description>
</method>
@@ -144,7 +163,7 @@
<method name="gui_is_dragging" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the viewport is currently performing a drag operation.
+ Returns [code]true[/code] if a drag operation is currently ongoing and where the drop action could happen in this viewport.
Alternative to [constant Node.NOTIFICATION_DRAG_BEGIN] and [constant Node.NOTIFICATION_DRAG_END] when you prefer polling the value.
</description>
</method>
@@ -293,14 +312,17 @@
[b]Note:[/b] [member mesh_lod_threshold] does not affect [GeometryInstance3D] visibility ranges (also known as "manual" LOD or hierarchical LOD).
</member>
<member name="msaa_2d" type="int" setter="set_msaa_2d" getter="get_msaa_2d" enum="Viewport.MSAA" default="0">
- The multisample anti-aliasing mode for 2D/Canvas rendering. A higher number results in smoother edges at the cost of significantly worse performance. A value of 2 or 4 is best unless targeting very high-end systems. This has no effect on shader-induced aliasing or texture aliasing.
+ The multisample antialiasing mode for 2D/Canvas rendering. A higher number results in smoother edges at the cost of significantly worse performance. A value of [constant Viewport.MSAA_2X] or [constant Viewport.MSAA_4X] is best unless targeting very high-end systems. This has no effect on shader-induced aliasing or texture aliasing.
+ See also [member ProjectSettings.rendering/anti_aliasing/quality/msaa_2d] and [method RenderingServer.viewport_set_msaa_2d].
</member>
<member name="msaa_3d" type="int" setter="set_msaa_3d" getter="get_msaa_3d" enum="Viewport.MSAA" default="0">
- The multisample anti-aliasing mode for 3D rendering. A higher number results in smoother edges at the cost of significantly worse performance. A value of 2 or 4 is best unless targeting very high-end systems. See also bilinear scaling 3d [member scaling_3d_mode] for supersampling, which provides higher quality but is much more expensive. This has no effect on shader-induced aliasing or texture aliasing.
+ The multisample antialiasing mode for 3D rendering. A higher number results in smoother edges at the cost of significantly worse performance. A value of [constant Viewport.MSAA_2X] or [constant Viewport.MSAA_4X] is best unless targeting very high-end systems. See also bilinear scaling 3D [member scaling_3d_mode] for supersampling, which provides higher quality but is much more expensive. This has no effect on shader-induced aliasing or texture aliasing.
+ See also [member ProjectSettings.rendering/anti_aliasing/quality/msaa_3d] and [method RenderingServer.viewport_set_msaa_3d].
</member>
<member name="own_world_3d" type="bool" setter="set_use_own_world_3d" getter="is_using_own_world_3d" default="false">
If [code]true[/code], the viewport will use a unique copy of the [World3D] defined in [member world_3d].
</member>
+ <member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" overrides="Node" enum="Node.PhysicsInterpolationMode" default="1" />
<member name="physics_object_picking" type="bool" setter="set_physics_object_picking" getter="get_physics_object_picking" default="false">
If [code]true[/code], the objects rendered by viewport become subjects of mouse picking process.
[b]Note:[/b] The number of simultaneously pickable objects is limited to 64 and they are selected in a non-deterministic order, which can be different in each picking process.
@@ -335,7 +357,7 @@
[b]Note:[/b] If this is set to [code]0[/code], no positional shadows will be visible at all. This can improve performance significantly on low-end systems by reducing both the CPU and GPU load (as fewer draw calls are needed to draw the scene without shadows).
</member>
<member name="scaling_3d_mode" type="int" setter="set_scaling_3d_mode" getter="get_scaling_3d_mode" enum="Viewport.Scaling3DMode" default="0">
- Sets scaling 3d mode. Bilinear scaling renders at different resolution to either undersample or supersample the viewport. FidelityFX Super Resolution 1.0, abbreviated to FSR, is an upscaling technology that produces high quality images at fast framerates by using a spatially aware upscaling algorithm. FSR is slightly more expensive than bilinear, but it produces significantly higher image quality. FSR should be used where possible.
+ Sets scaling 3D mode. Bilinear scaling renders at different resolution to either undersample or supersample the viewport. FidelityFX Super Resolution 1.0, abbreviated to FSR, is an upscaling technology that produces high quality images at fast framerates by using a spatially aware upscaling algorithm. FSR is slightly more expensive than bilinear, but it produces significantly higher image quality. FSR should be used where possible.
To control this property on the root viewport, set the [member ProjectSettings.rendering/scaling_3d/mode] project setting.
</member>
<member name="scaling_3d_scale" type="float" setter="set_scaling_3d_scale" getter="get_scaling_3d_scale" default="1.0">
@@ -345,6 +367,7 @@
</member>
<member name="screen_space_aa" type="int" setter="set_screen_space_aa" getter="get_screen_space_aa" enum="Viewport.ScreenSpaceAA" default="0">
Sets the screen-space antialiasing method used. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry.
+ See also [member ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa] and [method RenderingServer.viewport_set_screen_space_aa].
</member>
<member name="sdf_oversize" type="int" setter="set_sdf_oversize" getter="get_sdf_oversize" enum="Viewport.SDFOversize" default="1">
Controls how much of the original viewport's size should be covered by the 2D signed distance field. This SDF can be sampled in [CanvasItem] shaders and is also used for [GPUParticles2D] collision. Higher values allow portions of occluders located outside the viewport to still be taken into account in the generated signed distance field, at the cost of performance. If you notice particles falling through [LightOccluder2D]s as the occluders leave the viewport, increase this setting.
@@ -369,8 +392,9 @@
If [code]true[/code], the viewport should render its background as transparent.
</member>
<member name="use_debanding" type="bool" setter="set_use_debanding" getter="is_using_debanding" default="false">
- If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible in 3D. 2D rendering is [i]not[/i] affected by debanding unless the [member Environment.background_mode] is [constant Environment.BG_CANVAS]. See also [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding].
+ If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible in 3D. 2D rendering is [i]not[/i] affected by debanding unless the [member Environment.background_mode] is [constant Environment.BG_CANVAS].
In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
+ See also [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding] and [method RenderingServer.viewport_set_use_debanding].
</member>
<member name="use_hdr_2d" type="bool" setter="set_use_hdr_2d" getter="is_using_hdr_2d" default="false">
If [code]true[/code], 2D rendering will use an high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ renderer this will be an [code]RGBA16[/code] framebuffer, while when using the Mobile renderer it will be an [code]RGB10_A2[/code] framebuffer. Additionally, 2D rendering will take place in linear color space and will be converted to sRGB space immediately before blitting to the screen (if the Viewport is attached to the screen). Practically speaking, this means that the end result of the Viewport will not be clamped into the [code]0-1[/code] range and can be used in 3D rendering without color space adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients.
@@ -382,8 +406,9 @@
[b]Note:[/b] Due to memory constraints, occlusion culling is not supported by default in Web export templates. It can be enabled by compiling custom Web export templates with [code]module_raycast_enabled=yes[/code].
</member>
<member name="use_taa" type="bool" setter="set_use_taa" getter="is_using_taa" default="false">
- Enables Temporal Anti-Aliasing for this viewport. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion.
+ Enables temporal antialiasing for this viewport. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion.
[b]Note:[/b] The implementation is not complete yet, some visual instances such as particles and skinned meshes may show artifacts.
+ See also [member ProjectSettings.rendering/anti_aliasing/quality/use_taa] and [method RenderingServer.viewport_set_use_taa].
</member>
<member name="use_xr" type="bool" setter="set_use_xr" getter="is_using_xr" default="false">
If [code]true[/code], the viewport will use the primary XR interface to render XR output. When applicable this can result in a stereoscopic image and the resulting render being output to a headset.
diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml
index ba2352ab61..f6840d6b09 100644
--- a/doc/classes/ViewportTexture.xml
+++ b/doc/classes/ViewportTexture.xml
@@ -8,6 +8,11 @@
To get a [ViewportTexture] in code, use the [method Viewport.get_texture] method on the target viewport.
[b]Note:[/b] A [ViewportTexture] is always local to its scene (see [member Resource.resource_local_to_scene]). If the scene root is not ready, it may return incorrect data (see [signal Node.ready]).
[b]Note:[/b] Instantiating scenes containing a high-resolution [ViewportTexture] may cause noticeable stutter.
+ [b]Note:[/b] When using a [Viewport] with [member Viewport.use_hdr_2d] set to [code]true[/code] the returned texture will be an HDR image encoded in linear space. This may look darker than normal when displayed directly on screen. To convert to gamma space, you can do the following:
+ [codeblock]
+ img.convert(Image.FORMAT_RGBA8)
+ imb.linear_to_srgb()
+ [/codeblock]
</description>
<tutorials>
<link title="GUI in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2807</link>
diff --git a/doc/classes/VisibleOnScreenNotifier2D.xml b/doc/classes/VisibleOnScreenNotifier2D.xml
index cf4a0c0018..418abb6d17 100644
--- a/doc/classes/VisibleOnScreenNotifier2D.xml
+++ b/doc/classes/VisibleOnScreenNotifier2D.xml
@@ -4,7 +4,7 @@
A rectangular region of 2D space that detects whether it is visible on screen.
</brief_description>
<description>
- [VisibleOnScreenEnabler2D] represents a rectangular region of 2D space. When any part of this region becomes visible on screen or in a viewport, it will emit a [signal screen_entered] signal, and likewise it will emit a [signal screen_exited] signal when no part of it remains visible.
+ [VisibleOnScreenNotifier2D] represents a rectangular region of 2D space. When any part of this region becomes visible on screen or in a viewport, it will emit a [signal screen_entered] signal, and likewise it will emit a [signal screen_exited] signal when no part of it remains visible.
If you want a node to be enabled automatically when this region is visible on screen, use [VisibleOnScreenEnabler2D].
[b]Note:[/b] [VisibleOnScreenNotifier2D] uses the render culling code to determine whether it's visible on screen, so it won't function unless [member CanvasItem.visible] is set to [code]true[/code].
</description>
diff --git a/doc/classes/VisibleOnScreenNotifier3D.xml b/doc/classes/VisibleOnScreenNotifier3D.xml
index 38d55cd331..ce8a4b398d 100644
--- a/doc/classes/VisibleOnScreenNotifier3D.xml
+++ b/doc/classes/VisibleOnScreenNotifier3D.xml
@@ -4,7 +4,7 @@
A box-shaped region of 3D space that detects whether it is visible on screen.
</brief_description>
<description>
- [VisibleOnScreenEnabler3D] represents a box-shaped region of 3D space. When any part of this region becomes visible on screen or in a [Camera3D]'s view, it will emit a [signal screen_entered] signal, and likewise it will emit a [signal screen_exited] signal when no part of it remains visible.
+ [VisibleOnScreenNotifier3D] represents a box-shaped region of 3D space. When any part of this region becomes visible on screen or in a [Camera3D]'s view, it will emit a [signal screen_entered] signal, and likewise it will emit a [signal screen_exited] signal when no part of it remains visible.
If you want a node to be enabled automatically when this region is visible on screen, use [VisibleOnScreenEnabler3D].
[b]Note:[/b] [VisibleOnScreenNotifier3D] uses an approximate heuristic that doesn't take walls and other occlusion into account, unless occlusion culling is used. It also won't function unless [member Node3D.visible] is set to [code]true[/code].
</description>
diff --git a/doc/classes/VisualShaderNodeCompare.xml b/doc/classes/VisualShaderNodeCompare.xml
index b566ca62f3..9f554dacb4 100644
--- a/doc/classes/VisualShaderNodeCompare.xml
+++ b/doc/classes/VisualShaderNodeCompare.xml
@@ -69,10 +69,10 @@
Represents the size of the [enum Function] enum.
</constant>
<constant name="COND_ALL" value="0" enum="Condition">
- The result will be true if all of component in vector satisfy the comparison condition.
+ The result will be [code]true[/code] if all components in the vector satisfy the comparison condition.
</constant>
<constant name="COND_ANY" value="1" enum="Condition">
- The result will be true if any of component in vector satisfy the comparison condition.
+ The result will be [code]true[/code] if any component in the vector satisfies the comparison condition.
</constant>
<constant name="COND_MAX" value="2" enum="Condition">
Represents the size of the [enum Condition] enum.
diff --git a/doc/classes/VisualShaderNodeCubemap.xml b/doc/classes/VisualShaderNodeCubemap.xml
index 4e6cf2120a..6f3df9865a 100644
--- a/doc/classes/VisualShaderNodeCubemap.xml
+++ b/doc/classes/VisualShaderNodeCubemap.xml
@@ -9,7 +9,7 @@
<tutorials>
</tutorials>
<members>
- <member name="cube_map" type="Cubemap" setter="set_cube_map" getter="get_cube_map">
+ <member name="cube_map" type="TextureLayered" setter="set_cube_map" getter="get_cube_map">
The [Cubemap] texture to sample when using [constant SOURCE_TEXTURE] as [member source].
</member>
<member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeCubemap.Source" default="0">
diff --git a/doc/classes/VisualShaderNodeIntParameter.xml b/doc/classes/VisualShaderNodeIntParameter.xml
index ed72584b1b..ba17da49a8 100644
--- a/doc/classes/VisualShaderNodeIntParameter.xml
+++ b/doc/classes/VisualShaderNodeIntParameter.xml
@@ -15,6 +15,9 @@
<member name="default_value_enabled" type="bool" setter="set_default_value_enabled" getter="is_default_value_enabled" default="false">
If [code]true[/code], the node will have a custom default value.
</member>
+ <member name="enum_names" type="PackedStringArray" setter="set_enum_names" getter="get_enum_names" default="PackedStringArray()">
+ The names used for the enum select in the editor. [member hint] must be [constant HINT_ENUM] for this to take effect.
+ </member>
<member name="hint" type="int" setter="set_hint" getter="get_hint" enum="VisualShaderNodeIntParameter.Hint" default="0">
Range hint of this node. Use it to customize valid parameter range.
</member>
@@ -38,7 +41,10 @@
<constant name="HINT_RANGE_STEP" value="2" enum="Hint">
The parameter's value must be within the specified range, with the given [member step] between values.
</constant>
- <constant name="HINT_MAX" value="3" enum="Hint">
+ <constant name="HINT_ENUM" value="3" enum="Hint">
+ The parameter uses an enum to associate preset values to names in the editor.
+ </constant>
+ <constant name="HINT_MAX" value="4" enum="Hint">
Represents the size of the [enum Hint] enum.
</constant>
</constants>
diff --git a/doc/classes/VisualShaderNodeRemap.xml b/doc/classes/VisualShaderNodeRemap.xml
index 102672ff60..d4ecb2dd31 100644
--- a/doc/classes/VisualShaderNodeRemap.xml
+++ b/doc/classes/VisualShaderNodeRemap.xml
@@ -8,4 +8,34 @@
</description>
<tutorials>
</tutorials>
+ <members>
+ <member name="op_type" type="int" setter="set_op_type" getter="get_op_type" enum="VisualShaderNodeRemap.OpType" default="0">
+ </member>
+ </members>
+ <constants>
+ <constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
+ A floating-point scalar type.
+ </constant>
+ <constant name="OP_TYPE_VECTOR_2D" value="1" enum="OpType">
+ A 2D vector type.
+ </constant>
+ <constant name="OP_TYPE_VECTOR_2D_SCALAR" value="2" enum="OpType">
+ The [code]value[/code] port uses a 2D vector type, while the [code]input min[/code], [code]input max[/code], [code]output min[/code], and [code]output max[/code] ports use a floating-point scalar type.
+ </constant>
+ <constant name="OP_TYPE_VECTOR_3D" value="3" enum="OpType">
+ A 3D vector type.
+ </constant>
+ <constant name="OP_TYPE_VECTOR_3D_SCALAR" value="4" enum="OpType">
+ The [code]value[/code] port uses a 3D vector type, while the [code]input min[/code], [code]input max[/code], [code]output min[/code], and [code]output max[/code] ports use a floating-point scalar type.
+ </constant>
+ <constant name="OP_TYPE_VECTOR_4D" value="5" enum="OpType">
+ A 4D vector type.
+ </constant>
+ <constant name="OP_TYPE_VECTOR_4D_SCALAR" value="6" enum="OpType">
+ The [code]value[/code] port uses a 4D vector type, while the [code]input min[/code], [code]input max[/code], [code]output min[/code], and [code]output max[/code] ports use a floating-point scalar type.
+ </constant>
+ <constant name="OP_TYPE_MAX" value="7" enum="OpType">
+ Represents the size of the [enum OpType] enum.
+ </constant>
+ </constants>
</class>
diff --git a/doc/classes/VisualShaderNodeTexture2DArray.xml b/doc/classes/VisualShaderNodeTexture2DArray.xml
index 8852cb7cb4..bdf5a42821 100644
--- a/doc/classes/VisualShaderNodeTexture2DArray.xml
+++ b/doc/classes/VisualShaderNodeTexture2DArray.xml
@@ -9,7 +9,7 @@
<tutorials>
</tutorials>
<members>
- <member name="texture_array" type="Texture2DArray" setter="set_texture_array" getter="get_texture_array">
+ <member name="texture_array" type="TextureLayered" setter="set_texture_array" getter="get_texture_array">
A source texture array. Used if [member VisualShaderNodeSample3D.source] is set to [constant VisualShaderNodeSample3D.SOURCE_TEXTURE].
</member>
</members>
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index 286b35d642..424941b842 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -370,6 +370,9 @@
<param index="0" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)" />
<description>
Shows the [Window] and makes it transient (see [member transient]). If [param rect] is provided, it will be set as the [Window]'s size. Fails if called on the main window.
+ If [member ProjectSettings.display/window/subwindows/embed_subwindows] is [code]true[/code] (single-window mode), [param rect]'s coordinates are global and relative to the main window's top-left corner (excluding window decorations). If [param rect]'s position coordinates are negative, the window will be located outside the main window and may not be visible as a result.
+ If [member ProjectSettings.display/window/subwindows/embed_subwindows] is [code]false[/code] (multi-window mode), [param rect]'s coordinates are global and relative to the top-left corner of the leftmost screen. If [param rect]'s position coordinates are negative, the window will be placed at the top-left corner of the screen.
+ [b]Note:[/b] [param rect] must be in global coordinates if specified.
</description>
</method>
<method name="popup_centered">
@@ -380,7 +383,7 @@
[b]Note:[/b] Calling it with the default value of [param minsize] is equivalent to calling it with [member size].
</description>
</method>
- <method name="popup_centered_clamped">
+ <method name="popup_centered_clamped" keywords="minsize">
<return type="void" />
<param index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" />
<param index="1" name="fallback_ratio" type="float" default="0.75" />
@@ -415,7 +418,7 @@
See also [method set_unparent_when_invisible] and [method Node.get_last_exclusive_window].
</description>
</method>
- <method name="popup_exclusive_centered_clamped">
+ <method name="popup_exclusive_centered_clamped" keywords="minsize">
<return type="void" />
<param index="0" name="from_node" type="Node" />
<param index="1" name="minsize" type="Vector2i" default="Vector2i(0, 0)" />
@@ -656,6 +659,11 @@
If [member ProjectSettings.display/window/subwindows/embed_subwindows] is [code]false[/code], the position is in absolute screen coordinates. This typically applies to editor plugins. If the setting is [code]true[/code], the window's position is in the coordinates of its parent [Viewport].
[b]Note:[/b] This property only works if [member initial_position] is set to [constant WINDOW_INITIAL_POSITION_ABSOLUTE].
</member>
+ <member name="sharp_corners" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], the [Window] will override the OS window style to display sharp corners.
+ [b]Note:[/b] This property is implemented only on Windows (11).
+ [b]Note:[/b] This property only works with native windows.
+ </member>
<member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(100, 100)">
The window's size in pixels.
</member>
@@ -717,8 +725,6 @@
<param index="0" name="files" type="PackedStringArray" />
<description>
Emitted when files are dragged from the OS file manager and dropped in the game window. The argument is a list of file paths.
- Note that this method only works with native windows, i.e. the main window and [Window]-derived nodes when [member Viewport.gui_embed_subwindows] is disabled in the main viewport.
- Example usage:
[codeblock]
func _ready():
get_viewport().files_dropped.connect(on_files_dropped)
@@ -726,6 +732,7 @@
func on_files_dropped(files):
print(files)
[/codeblock]
+ [b]Note:[/b] This signal only works with native windows, i.e. the main window and [Window]-derived nodes when [member Viewport.gui_embed_subwindows] is disabled in the main viewport.
</description>
</signal>
<signal name="focus_entered">
@@ -839,7 +846,12 @@
All mouse events are passed to the underlying window of the same application.
[b]Note:[/b] This flag has no effect in embedded windows.
</constant>
- <constant name="FLAG_MAX" value="8" enum="Flags">
+ <constant name="FLAG_SHARP_CORNERS" value="8" enum="Flags">
+ Window style is overridden, forcing sharp corners.
+ [b]Note:[/b] This flag has no effect in embedded windows.
+ [b]Note:[/b] This flag is implemented only on Windows (11).
+ </constant>
+ <constant name="FLAG_MAX" value="9" enum="Flags">
Max value of the [enum Flags].
</constant>
<constant name="CONTENT_SCALE_MODE_DISABLED" value="0" enum="ContentScaleMode">
@@ -875,7 +887,7 @@
<constant name="LAYOUT_DIRECTION_INHERITED" value="0" enum="LayoutDirection">
Automatic layout direction, determined from the parent window layout direction.
</constant>
- <constant name="LAYOUT_DIRECTION_LOCALE" value="1" enum="LayoutDirection">
+ <constant name="LAYOUT_DIRECTION_APPLICATION_LOCALE" value="1" enum="LayoutDirection">
Automatic layout direction, determined from the current locale.
</constant>
<constant name="LAYOUT_DIRECTION_LTR" value="2" enum="LayoutDirection">
@@ -884,6 +896,14 @@
<constant name="LAYOUT_DIRECTION_RTL" value="3" enum="LayoutDirection">
Right-to-left layout direction.
</constant>
+ <constant name="LAYOUT_DIRECTION_SYSTEM_LOCALE" value="4" enum="LayoutDirection">
+ Automatic layout direction, determined from the system locale.
+ </constant>
+ <constant name="LAYOUT_DIRECTION_MAX" value="5" enum="LayoutDirection">
+ Represents the size of the [enum LayoutDirection] enum.
+ </constant>
+ <constant name="LAYOUT_DIRECTION_LOCALE" value="1" enum="LayoutDirection" deprecated="Use [constant LAYOUT_DIRECTION_APPLICATION_LOCALE] instead.">
+ </constant>
<constant name="WINDOW_INITIAL_POSITION_ABSOLUTE" value="0" enum="WindowInitialPosition">
Initial window position is determined by [member position].
</constant>
diff --git a/doc/classes/XRCamera3D.xml b/doc/classes/XRCamera3D.xml
index a7904b3ada..e49e884f33 100644
--- a/doc/classes/XRCamera3D.xml
+++ b/doc/classes/XRCamera3D.xml
@@ -4,7 +4,7 @@
A camera node with a few overrules for AR/VR applied, such as location tracking.
</brief_description>
<description>
- This is a helper spatial node for our camera; note that, if stereoscopic rendering is applicable (VR-HMD), most of the camera properties are ignored, as the HMD information overrides them. The only properties that can be trusted are the near and far planes.
+ This is a helper 3D node for our camera. Note that, if stereoscopic rendering is applicable (VR-HMD), most of the camera properties are ignored, as the HMD information overrides them. The only properties that can be trusted are the near and far planes.
The position and orientation of this node is automatically updated by the XR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the XR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the XRCamera3D can lag a few milliseconds behind what is used for rendering as a result.
</description>
<tutorials>
diff --git a/doc/classes/XRController3D.xml b/doc/classes/XRController3D.xml
index 8a068661c9..508752e0ae 100644
--- a/doc/classes/XRController3D.xml
+++ b/doc/classes/XRController3D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="XRController3D" inherits="XRNode3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- A spatial node representing a spatially-tracked controller.
+ A 3D node representing a spatially-tracked controller.
</brief_description>
<description>
- This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers.
+ This is a helper 3D node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers.
Controllers are linked by their ID. You can create controller nodes before the controllers are available. If your game always uses two controllers (one for each hand), you can predefine the controllers with ID 1 and 2; they will become active as soon as the controllers are identified. If you expect additional controllers to be used, you should react to the signals and add XRController3D nodes to your scene.
The position of the controller node is automatically updated by the [XRServer]. This makes this node ideal to add child nodes to visualize the controller.
As many XR runtimes now use a configurable action map all inputs are named.
diff --git a/doc/classes/XRHandTracker.xml b/doc/classes/XRHandTracker.xml
index 636af6625b..79ea237480 100644
--- a/doc/classes/XRHandTracker.xml
+++ b/doc/classes/XRHandTracker.xml
@@ -107,7 +107,10 @@
<constant name="HAND_TRACKING_SOURCE_CONTROLLER" value="2" enum="HandTrackingSource">
The source of hand tracking data is a controller, meaning that joint positions are inferred from controller inputs.
</constant>
- <constant name="HAND_TRACKING_SOURCE_MAX" value="3" enum="HandTrackingSource">
+ <constant name="HAND_TRACKING_SOURCE_NOT_TRACKED" value="3" enum="HandTrackingSource">
+ No hand tracking data is tracked, this either means the hand is obscured, the controller is turned off, or tracking is not supported for the current input type.
+ </constant>
+ <constant name="HAND_TRACKING_SOURCE_MAX" value="4" enum="HandTrackingSource">
Represents the size of the [enum HandTrackingSource] enum.
</constant>
<constant name="HAND_JOINT_PALM" value="0" enum="HandJoint">
diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml
index 175caca598..68d055ad8d 100644
--- a/doc/classes/XRInterface.xml
+++ b/doc/classes/XRInterface.xml
@@ -176,6 +176,10 @@
Triggers a haptic pulse on a device associated with this interface.
[param action_name] is the name of the action for this pulse.
[param tracker_name] is optional and can be used to direct the pulse to a specific device provided that device is bound to this haptic.
+ [param frequency] is the frequency of the pulse, set to [code]0.0[/code] to have the system use a default frequency.
+ [param amplitude] is the amplitude of the pulse between [code]0.0[/code] and [code]1.0[/code].
+ [param duration_sec] is the duration of the pulse in seconds.
+ [param delay_sec] is a delay in seconds before the pulse is given.
</description>
</method>
<method name="uninitialize">
diff --git a/doc/classes/XRNode3D.xml b/doc/classes/XRNode3D.xml
index dfe5600fcc..fce3708d9a 100644
--- a/doc/classes/XRNode3D.xml
+++ b/doc/classes/XRNode3D.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="XRNode3D" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- A spatial node that has its position automatically updated by the [XRServer].
+ A 3D node that has its position automatically updated by the [XRServer].
</brief_description>
<description>
This node can be bound to a specific pose of a [XRPositionalTracker] and will automatically have its [member Node3D.transform] updated by the [XRServer]. Nodes of this type must be added as children of the [XROrigin3D] node.
@@ -38,6 +38,10 @@
<description>
Triggers a haptic pulse on a device associated with this interface.
[param action_name] is the name of the action for this pulse.
+ [param frequency] is the frequency of the pulse, set to [code]0.0[/code] to have the system use a default frequency.
+ [param amplitude] is the amplitude of the pulse between [code]0.0[/code] and [code]1.0[/code].
+ [param duration_sec] is the duration of the pulse in seconds.
+ [param delay_sec] is a delay in seconds before the pulse is given.
</description>
</method>
</methods>
diff --git a/doc/classes/XRPose.xml b/doc/classes/XRPose.xml
index 60a2226a60..76c1ced352 100644
--- a/doc/classes/XRPose.xml
+++ b/doc/classes/XRPose.xml
@@ -29,11 +29,11 @@
The linear velocity of this pose.
</member>
<member name="name" type="StringName" setter="set_name" getter="get_name" default="&amp;&quot;&quot;">
- The name of this pose. Pose names are often driven by an action map setup by the user. Godot does suggest a number of pose names that it expects [XRInterface]s to implement:
- - [code]root[/code] defines a root location, often used for tracked objects that do not have further nodes.
- - [code]aim[/code] defines the tip of a controller with the orientation pointing outwards, for example: add your raycasts to this.
- - [code]grip[/code] defines the location where the user grips the controller
- - [code]skeleton[/code] defines the root location a hand mesh should be placed when using hand tracking and the animated skeleton supplied by the XR runtime.
+ The name of this pose. Usually, this name is derived from an action map set up by the user. Godot also suggests some pose names that [XRInterface] objects are expected to implement:
+ - [code]root[/code] is the root location, often used for tracked objects that do not have further nodes.
+ - [code]aim[/code] is the tip of a controller with its orientation pointing outwards, often used for raycasts.
+ - [code]grip[/code] is the location where the user grips the controller.
+ - [code]skeleton[/code] is the root location for a hand mesh, when using hand tracking and an animated skeleton is supplied by the XR runtime.
</member>
<member name="tracking_confidence" type="int" setter="set_tracking_confidence" getter="get_tracking_confidence" enum="XRPose.TrackingConfidence" default="0">
The tracking confidence for this pose, provides insight on how accurate the spatial positioning of this record is.