summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/@GlobalScope.xml1317
-rw-r--r--doc/classes/AABB.xml60
-rw-r--r--doc/classes/AESContext.xml43
-rw-r--r--doc/classes/AStar.xml89
-rw-r--r--doc/classes/AStar2D.xml72
-rw-r--r--doc/classes/AcceptDialog.xml5
-rw-r--r--doc/classes/AnimatedSprite2D.xml7
-rw-r--r--doc/classes/Animation.xml32
-rw-r--r--doc/classes/AnimationNodeAdd3.xml1
-rw-r--r--doc/classes/AnimationNodeAnimation.xml2
-rw-r--r--doc/classes/AnimationNodeBlend2.xml2
-rw-r--r--doc/classes/AnimationNodeBlendSpace2D.xml1
-rw-r--r--doc/classes/AnimationNodeOneShot.xml1
-rw-r--r--doc/classes/AnimationNodeOutput.xml2
-rw-r--r--doc/classes/AnimationNodeStateMachine.xml10
-rw-r--r--doc/classes/AnimationNodeStateMachinePlayback.xml10
-rw-r--r--doc/classes/AnimationNodeStateMachineTransition.xml11
-rw-r--r--doc/classes/AnimationNodeTimeScale.xml1
-rw-r--r--doc/classes/AnimationNodeTransition.xml2
-rw-r--r--doc/classes/AnimationPlayer.xml6
-rw-r--r--doc/classes/AnimationTree.xml2
-rw-r--r--doc/classes/Area2D.xml9
-rw-r--r--doc/classes/Area3D.xml10
-rw-r--r--doc/classes/Array.xml226
-rw-r--r--doc/classes/ArrayMesh.xml104
-rw-r--r--doc/classes/AspectRatioContainer.xml51
-rw-r--r--doc/classes/AudioEffect.xml1
-rw-r--r--doc/classes/AudioEffectHighShelfFilter.xml2
-rw-r--r--doc/classes/AudioEffectLowShelfFilter.xml2
-rw-r--r--doc/classes/AudioEffectRecord.xml1
-rw-r--r--doc/classes/AudioEffectReverb.xml1
-rw-r--r--doc/classes/AudioServer.xml3
-rw-r--r--doc/classes/AudioStream.xml3
-rw-r--r--doc/classes/AudioStreamGenerator.xml2
-rw-r--r--doc/classes/AudioStreamPlayback.xml1
-rw-r--r--doc/classes/AudioStreamPlayer.xml5
-rw-r--r--doc/classes/AudioStreamPlayer3D.xml28
-rw-r--r--doc/classes/BaseButton.xml12
-rw-r--r--doc/classes/BaseMaterial3D.xml32
-rw-r--r--doc/classes/Basis.xml106
-rw-r--r--doc/classes/BitmapFont.xml112
-rw-r--r--doc/classes/BoxMesh.xml (renamed from doc/classes/CubeMesh.xml)10
-rw-r--r--doc/classes/BoxShape3D.xml3
-rw-r--r--doc/classes/Button.xml65
-rw-r--r--doc/classes/ButtonGroup.xml2
-rw-r--r--doc/classes/CPUParticles2D.xml30
-rw-r--r--doc/classes/CPUParticles3D.xml44
-rw-r--r--doc/classes/Callable.xml73
-rw-r--r--doc/classes/Camera2D.xml3
-rw-r--r--doc/classes/Camera3D.xml10
-rw-r--r--doc/classes/CanvasGroup.xml21
-rw-r--r--doc/classes/CanvasItem.xml194
-rw-r--r--doc/classes/CanvasLayer.xml1
-rw-r--r--doc/classes/CanvasTexture.xml29
-rw-r--r--doc/classes/CapsuleShape3D.xml1
-rw-r--r--doc/classes/CharFXTransform.xml24
-rw-r--r--doc/classes/CheckBox.xml4
-rw-r--r--doc/classes/CheckButton.xml24
-rw-r--r--doc/classes/CodeEdit.xml7
-rw-r--r--doc/classes/CollisionShape2D.xml3
-rw-r--r--doc/classes/CollisionShape3D.xml3
-rw-r--r--doc/classes/Color.xml393
-rw-r--r--doc/classes/ColorPicker.xml1
-rw-r--r--doc/classes/ColorPickerButton.xml6
-rw-r--r--doc/classes/ColorRect.xml14
-rw-r--r--doc/classes/ConcavePolygonShape3D.xml1
-rw-r--r--doc/classes/ConfigFile.xml22
-rw-r--r--doc/classes/ConfirmationDialog.xml11
-rw-r--r--doc/classes/Control.xml426
-rw-r--r--doc/classes/ConvexPolygonShape3D.xml1
-rw-r--r--doc/classes/Crypto.xml81
-rw-r--r--doc/classes/Curve2D.xml8
-rw-r--r--doc/classes/Curve3D.xml10
-rw-r--r--doc/classes/CylinderShape3D.xml3
-rw-r--r--doc/classes/DTLSServer.xml97
-rw-r--r--doc/classes/Decal.xml24
-rw-r--r--doc/classes/Dictionary.xml249
-rw-r--r--doc/classes/DirectionalLight2D.xml20
-rw-r--r--doc/classes/DirectionalLight3D.xml3
-rw-r--r--doc/classes/Directory.xml33
-rw-r--r--doc/classes/DisplayServer.xml30
-rw-r--r--doc/classes/DynamicFont.xml135
-rw-r--r--doc/classes/DynamicFontData.xml35
-rw-r--r--doc/classes/EditorImportPlugin.xml97
-rw-r--r--doc/classes/EditorInterface.xml4
-rw-r--r--doc/classes/EditorNode3DGizmoPlugin.xml7
-rw-r--r--doc/classes/EditorPlugin.xml186
-rw-r--r--doc/classes/EditorScenePostImport.xml42
-rw-r--r--doc/classes/EditorScript.xml19
-rw-r--r--doc/classes/EditorSettings.xml48
-rw-r--r--doc/classes/EditorTranslationParserPlugin.xml72
-rw-r--r--doc/classes/Engine.xml16
-rw-r--r--doc/classes/Environment.xml58
-rw-r--r--doc/classes/Expression.xml35
-rw-r--r--doc/classes/File.xml54
-rw-r--r--doc/classes/Font.xml288
-rw-r--r--doc/classes/FontData.xml330
-rw-r--r--doc/classes/FuncRef.xml57
-rw-r--r--doc/classes/GIProbe.xml1
-rw-r--r--doc/classes/GIProbeData.xml1
-rw-r--r--doc/classes/GPUParticles2D.xml5
-rw-r--r--doc/classes/GPUParticles3D.xml3
-rw-r--r--doc/classes/GPUParticlesAttractor3D.xml23
-rw-r--r--doc/classes/GPUParticlesAttractorBox.xml17
-rw-r--r--doc/classes/GPUParticlesAttractorSphere.xml17
-rw-r--r--doc/classes/GPUParticlesAttractorVectorField.xml19
-rw-r--r--doc/classes/GPUParticlesCollision3D.xml17
-rw-r--r--doc/classes/GPUParticlesCollisionBox.xml17
-rw-r--r--doc/classes/GPUParticlesCollisionHeightField.xml43
-rw-r--r--doc/classes/GPUParticlesCollisionSDF.xml37
-rw-r--r--doc/classes/GPUParticlesCollisionSphere.xml17
-rw-r--r--doc/classes/Generic6DOFJoint3D.xml2
-rw-r--r--doc/classes/Geometry2D.xml19
-rw-r--r--doc/classes/Geometry3D.xml9
-rw-r--r--doc/classes/Gradient.xml14
-rw-r--r--doc/classes/GraphEdit.xml29
-rw-r--r--doc/classes/GraphNode.xml33
-rw-r--r--doc/classes/GridContainer.xml1
-rw-r--r--doc/classes/HMACContext.xml88
-rw-r--r--doc/classes/HTTPClient.xml37
-rw-r--r--doc/classes/HTTPRequest.xml106
-rw-r--r--doc/classes/HashingContext.xml36
-rw-r--r--doc/classes/Image.xml107
-rw-r--r--doc/classes/ImageTexture.xml35
-rw-r--r--doc/classes/Input.xml112
-rw-r--r--doc/classes/InputEvent.xml2
-rw-r--r--doc/classes/InputEventAction.xml2
-rw-r--r--doc/classes/InputEventMouseMotion.xml1
-rw-r--r--doc/classes/InputEventWithModifiers.xml4
-rw-r--r--doc/classes/InputMap.xml2
-rw-r--r--doc/classes/InstancePlaceholder.xml3
-rw-r--r--doc/classes/ItemList.xml105
-rw-r--r--doc/classes/JSONParseResult.xml17
-rw-r--r--doc/classes/JSONParser.xml57
-rw-r--r--doc/classes/JavaScript.xml1
-rw-r--r--doc/classes/Joint3D.xml1
-rw-r--r--doc/classes/KinematicBody2D.xml29
-rw-r--r--doc/classes/KinematicBody3D.xml18
-rw-r--r--doc/classes/Label.xml60
-rw-r--r--doc/classes/Light2D.xml56
-rw-r--r--doc/classes/Light3D.xml1
-rw-r--r--doc/classes/LightOccluder2D.xml8
-rw-r--r--doc/classes/Line2D.xml2
-rw-r--r--doc/classes/LineEdit.xml136
-rw-r--r--doc/classes/LinkButton.xml44
-rw-r--r--doc/classes/MainLoop.xml35
-rw-r--r--doc/classes/MarginContainer.xml13
-rw-r--r--doc/classes/Material.xml2
-rw-r--r--doc/classes/MenuButton.xml5
-rw-r--r--doc/classes/Mesh.xml131
-rw-r--r--doc/classes/MeshDataTool.xml38
-rw-r--r--doc/classes/MeshInstance3D.xml4
-rw-r--r--doc/classes/MeshLibrary.xml2
-rw-r--r--doc/classes/MultiMesh.xml2
-rw-r--r--doc/classes/MultiplayerAPI.xml14
-rw-r--r--doc/classes/Navigation2D.xml1
-rw-r--r--doc/classes/Navigation3D.xml1
-rw-r--r--doc/classes/NavigationMesh.xml11
-rw-r--r--doc/classes/NavigationPolygon.xml30
-rw-r--r--doc/classes/NavigationServer2D.xml1
-rw-r--r--doc/classes/NavigationServer3D.xml1
-rw-r--r--doc/classes/NetworkedMultiplayerPeer.xml1
-rw-r--r--doc/classes/NinePatchRect.xml18
-rw-r--r--doc/classes/Node.xml49
-rw-r--r--doc/classes/Node2D.xml1
-rw-r--r--doc/classes/Node3D.xml20
-rw-r--r--doc/classes/NodePath.xml95
-rw-r--r--doc/classes/OS.xml63
-rw-r--r--doc/classes/OptionButton.xml24
-rw-r--r--doc/classes/PCKPacker.xml12
-rw-r--r--doc/classes/PackedByteArray.xml93
-rw-r--r--doc/classes/PackedColorArray.xml88
-rw-r--r--doc/classes/PackedFloat32Array.xml72
-rw-r--r--doc/classes/PackedFloat64Array.xml80
-rw-r--r--doc/classes/PackedInt32Array.xml88
-rw-r--r--doc/classes/PackedInt64Array.xml88
-rw-r--r--doc/classes/PackedScene.xml50
-rw-r--r--doc/classes/PackedStringArray.xml89
-rw-r--r--doc/classes/PackedVector2Array.xml97
-rw-r--r--doc/classes/PackedVector3Array.xml96
-rw-r--r--doc/classes/PacketPeerUDP.xml33
-rw-r--r--doc/classes/Panel.xml3
-rw-r--r--doc/classes/PanelContainer.xml1
-rw-r--r--doc/classes/ParticlesMaterial.xml80
-rw-r--r--doc/classes/PathFollow2D.xml4
-rw-r--r--doc/classes/Performance.xml66
-rw-r--r--doc/classes/PhysicalBone3D.xml3
-rw-r--r--doc/classes/PhysicsBody2D.xml3
-rw-r--r--doc/classes/PhysicsDirectSpaceState2D.xml3
-rw-r--r--doc/classes/PhysicsShapeQueryParameters2D.xml35
-rw-r--r--doc/classes/PhysicsShapeQueryParameters3D.xml35
-rw-r--r--doc/classes/Plane.xml89
-rw-r--r--doc/classes/PointLight2D.xml27
-rw-r--r--doc/classes/Polygon2D.xml10
-rw-r--r--doc/classes/Popup.xml2
-rw-r--r--doc/classes/PopupMenu.xml85
-rw-r--r--doc/classes/PrimitiveMesh.xml17
-rw-r--r--doc/classes/ProgressBar.xml3
-rw-r--r--doc/classes/ProjectSettings.xml159
-rw-r--r--doc/classes/ProximityGroup3D.xml4
-rw-r--r--doc/classes/QuadMesh.xml2
-rw-r--r--doc/classes/Quat.xml166
-rw-r--r--doc/classes/RDTextureFormat.xml2
-rw-r--r--doc/classes/RDUniform.xml2
-rw-r--r--doc/classes/RID.xml61
-rw-r--r--doc/classes/RandomNumberGenerator.xml24
-rw-r--r--doc/classes/RayCast3D.xml1
-rw-r--r--doc/classes/Rect2.xml71
-rw-r--r--doc/classes/Rect2i.xml65
-rw-r--r--doc/classes/RectangleShape2D.xml2
-rw-r--r--doc/classes/Reference.xml1
-rw-r--r--doc/classes/ReferenceRect.xml5
-rw-r--r--doc/classes/RenderingServer.xml230
-rw-r--r--doc/classes/Resource.xml2
-rw-r--r--doc/classes/ResourceLoader.xml9
-rw-r--r--doc/classes/RichTextLabel.xml196
-rw-r--r--doc/classes/RigidBody2D.xml9
-rw-r--r--doc/classes/RigidBody3D.xml7
-rw-r--r--doc/classes/SceneTree.xml2
-rw-r--r--doc/classes/ScriptEditor.xml1
-rw-r--r--doc/classes/Signal.xml40
-rw-r--r--doc/classes/Skeleton3D.xml2
-rw-r--r--doc/classes/SkeletonIK3D.xml1
-rw-r--r--doc/classes/SphereShape3D.xml1
-rw-r--r--doc/classes/SpotLight3D.xml1
-rw-r--r--doc/classes/Sprite2D.xml14
-rw-r--r--doc/classes/Sprite3D.xml3
-rw-r--r--doc/classes/SpriteBase3D.xml12
-rw-r--r--doc/classes/StaticBody3D.xml3
-rw-r--r--doc/classes/StreamPeerTCP.xml2
-rw-r--r--doc/classes/String.xml424
-rw-r--r--doc/classes/StringName.xml50
-rw-r--r--doc/classes/StyleBox.xml1
-rw-r--r--doc/classes/StyleBoxTexture.xml4
-rw-r--r--doc/classes/SubViewport.xml15
-rw-r--r--doc/classes/SurfaceTool.xml204
-rw-r--r--doc/classes/TabContainer.xml6
-rw-r--r--doc/classes/Tabs.xml82
-rw-r--r--doc/classes/TextEdit.xml157
-rw-r--r--doc/classes/TextLine.xml212
-rw-r--r--doc/classes/TextParagraph.xml299
-rw-r--r--doc/classes/TextServer.xml1207
-rw-r--r--doc/classes/TextServerManager.xml82
-rw-r--r--doc/classes/Texture2D.xml33
-rw-r--r--doc/classes/TextureButton.xml2
-rw-r--r--doc/classes/TextureProgressBar.xml (renamed from doc/classes/TextureProgress.xml)4
-rw-r--r--doc/classes/TextureRect.xml1
-rw-r--r--doc/classes/Theme.xml216
-rw-r--r--doc/classes/Thread.xml1
-rw-r--r--doc/classes/TileMap.xml8
-rw-r--r--doc/classes/TileSet.xml28
-rw-r--r--doc/classes/Timer.xml1
-rw-r--r--doc/classes/Transform.xml120
-rw-r--r--doc/classes/Transform2D.xml114
-rw-r--r--doc/classes/Tree.xml92
-rw-r--r--doc/classes/TreeItem.xml109
-rw-r--r--doc/classes/VBoxContainer.xml1
-rw-r--r--doc/classes/Vector2.xml183
-rw-r--r--doc/classes/Vector2i.xml178
-rw-r--r--doc/classes/Vector3.xml209
-rw-r--r--doc/classes/Vector3i.xml182
-rw-r--r--doc/classes/VehicleBody3D.xml2
-rw-r--r--doc/classes/VehicleWheel3D.xml1
-rw-r--r--doc/classes/VideoPlayer.xml3
-rw-r--r--doc/classes/Viewport.xml34
-rw-r--r--doc/classes/ViewportTexture.xml4
-rw-r--r--doc/classes/VisibilityNotifier2D.xml1
-rw-r--r--doc/classes/VisualShaderNode.xml6
-rw-r--r--doc/classes/VisualShaderNodeCurveTexture.xml17
-rw-r--r--doc/classes/VisualShaderNodeGroupBase.xml7
-rw-r--r--doc/classes/VisualShaderNodeMultiplyAdd.xml10
-rw-r--r--doc/classes/VisualShaderNodeResizableBase.xml18
-rw-r--r--doc/classes/Window.xml63
-rw-r--r--doc/classes/World2D.xml2
-rw-r--r--doc/classes/World3D.xml2
-rw-r--r--doc/classes/WorldEnvironment.xml3
-rw-r--r--doc/classes/XRController3D.xml2
-rw-r--r--doc/classes/XRPositionalTracker.xml28
-rw-r--r--doc/classes/bool.xml137
-rw-r--r--doc/classes/float.xml239
-rw-r--r--doc/classes/int.xml315
-rwxr-xr-xdoc/tools/doc_merge.py237
-rwxr-xr-xdoc/tools/makerst.py2
-rw-r--r--doc/translations/ar.po6
-rw-r--r--doc/translations/ca.po6
-rw-r--r--doc/translations/classes.pot8
-rw-r--r--doc/translations/cs.po6
-rw-r--r--doc/translations/de.po6
-rw-r--r--doc/translations/es.po10
-rw-r--r--doc/translations/fa.po6
-rw-r--r--doc/translations/fi.po6
-rw-r--r--doc/translations/fr.po6
-rw-r--r--doc/translations/id.po6
-rw-r--r--doc/translations/it.po6
-rw-r--r--doc/translations/ja.po6
-rw-r--r--doc/translations/ko.po6
-rw-r--r--doc/translations/nl.po6
-rw-r--r--doc/translations/pl.po6
-rw-r--r--doc/translations/pt_BR.po6
-rw-r--r--doc/translations/ro.po6
-rw-r--r--doc/translations/ru.po6
-rw-r--r--doc/translations/sr_Cyrl.po6
-rw-r--r--doc/translations/th.po6
-rw-r--r--doc/translations/tr.po6
-rw-r--r--doc/translations/uk.po6
-rw-r--r--doc/translations/zh_Hans.po6
-rw-r--r--doc/translations/zh_Hant.po6
307 files changed, 12576 insertions, 3194 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 2b1770f12b..f94eb7adef 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -10,6 +10,1147 @@
<tutorials>
</tutorials>
<methods>
+ <method name="abs">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="x" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="absf">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the absolute value of float parameter [code]x[/code] (i.e. positive value).
+ [codeblock]
+ # a is 1.2
+ a = absf(-1.2)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="absi">
+ <return type="int">
+ </return>
+ <argument index="0" name="x" type="int">
+ </argument>
+ <description>
+ Returns the absolute value of int parameter [code]x[/code] (i.e. positive value).
+ [codeblock]
+ # a is 1
+ a = absi(-1)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="acos">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the arc cosine of [code]x[/code] in radians. Use to get the angle of cosine [code]x[/code].
+ [codeblock]
+ # c is 0.523599 or 30 degrees if converted with rad2deg(c)
+ c = acos(0.866025)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="asin">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the arc sine of [code]x[/code] in radians. Use to get the angle of sine [code]x[/code].
+ [codeblock]
+ # s is 0.523599 or 30 degrees if converted with rad2deg(s)
+ s = asin(0.5)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="atan">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the arc tangent of [code]x[/code] in radians. Use it to get the angle from an angle's tangent in trigonometry: [code]atan(tan(angle)) == angle[/code].
+ The method cannot know in which quadrant the angle should fall. See [method atan2] if you have both [code]y[/code] and [code]x[/code].
+ [codeblock]
+ a = atan(0.5) # a is 0.463648
+ [/codeblock]
+ </description>
+ </method>
+ <method name="atan2">
+ <return type="float">
+ </return>
+ <argument index="0" name="y" type="float">
+ </argument>
+ <argument index="1" name="x" type="float">
+ </argument>
+ <description>
+ Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle of tangent [code]y/x[/code]. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant.
+ Important note: The Y coordinate comes first, by convention.
+ [codeblock]
+ a = atan2(0, -1) # a is 3.141593
+ [/codeblock]
+ </description>
+ </method>
+ <method name="bytes2var">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="bytes" type="PackedByteArray">
+ </argument>
+ <description>
+ Decodes a byte array back to a [Variant] value, without decoding objects.
+ [b]Note:[/b] If you need object deserialization, see [method bytes2var_with_objects].
+ </description>
+ </method>
+ <method name="bytes2var_with_objects">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="bytes" type="PackedByteArray">
+ </argument>
+ <description>
+ Decodes a byte array back to a [Variant] value. Decoding objects is allowed.
+ [b]WARNING:[/b] Deserialized object can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats (remote code execution).
+ </description>
+ </method>
+ <method name="cartesian2polar">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <description>
+ Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle).
+ </description>
+ </method>
+ <method name="ceil">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Rounds [code]x[/code] upward (towards positive infinity), returning the smallest whole number that is not less than [code]x[/code].
+ [codeblock]
+ i = ceil(1.45) # i is 2
+ i = ceil(1.001) # i is 2
+ [/codeblock]
+ See also [method floor], [method round], and [method stepify].
+ </description>
+ </method>
+ <method name="clamp">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="value" type="Variant">
+ </argument>
+ <argument index="1" name="min" type="Variant">
+ </argument>
+ <argument index="2" name="max" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="clampf">
+ <return type="float">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <argument index="1" name="min" type="float">
+ </argument>
+ <argument index="2" name="max" type="float">
+ </argument>
+ <description>
+ Clamps the float [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code].
+ [codeblock]
+ speed = 42.1
+ # a is 20.0
+ a = clampf(speed, 1.0, 20.0)
+
+ speed = -10.0
+ # a is -1.0
+ a = clampf(speed, -1.0, 1.0)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="clampi">
+ <return type="int">
+ </return>
+ <argument index="0" name="value" type="int">
+ </argument>
+ <argument index="1" name="min" type="int">
+ </argument>
+ <argument index="2" name="max" type="int">
+ </argument>
+ <description>
+ Clamps the integer [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code].
+ [codeblock]
+ speed = 42
+ # a is 20
+ a = clampi(speed, 1, 20)
+
+ speed = -10
+ # a is -1
+ a = clampi(speed, -1, 1)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="cos">
+ <return type="float">
+ </return>
+ <argument index="0" name="angle_rad" type="float">
+ </argument>
+ <description>
+ Returns the cosine of angle [code]angle_rad[/code] in radians.
+ [codeblock]
+ # Prints 1 then -1
+ print(cos(PI * 2))
+ print(cos(PI))
+ [/codeblock]
+ </description>
+ </method>
+ <method name="cosh">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the hyperbolic cosine of [code]x[/code] in radians.
+ [codeblock]
+ # Prints 1.543081
+ print(cosh(1))
+ [/codeblock]
+ </description>
+ </method>
+ <method name="db2linear">
+ <return type="float">
+ </return>
+ <argument index="0" name="db" type="float">
+ </argument>
+ <description>
+ Converts from decibels to linear energy (audio).
+ </description>
+ </method>
+ <method name="dectime">
+ <return type="float">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <argument index="1" name="amount" type="float">
+ </argument>
+ <argument index="2" name="step" type="float">
+ </argument>
+ <description>
+ Returns the result of [code]value[/code] decreased by [code]step[/code] * [code]amount[/code].
+ [codeblock]
+ # a = 59
+ a = dectime(60, 10, 0.1))
+ [/codeblock]
+ </description>
+ </method>
+ <method name="deg2rad">
+ <return type="float">
+ </return>
+ <argument index="0" name="deg" type="float">
+ </argument>
+ <description>
+ Converts an angle expressed in degrees to radians.
+ [codeblock]
+ # r is 3.141593
+ r = deg2rad(180)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="ease">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="curve" type="float">
+ </argument>
+ <description>
+ Easing function, based on exponent. The curve values are: 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in.
+ </description>
+ </method>
+ <method name="exp">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ The natural exponential function. It raises the mathematical constant [b]e[/b] to the power of [code]x[/code] and returns it.
+ [b]e[/b] has an approximate value of 2.71828, and can be obtained with [code]exp(1)[/code].
+ For exponents to other bases use the method [method pow].
+ [codeblock]
+ a = exp(2) # Approximately 7.39
+ [/codeblock]
+ </description>
+ </method>
+ <method name="floor">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Rounds [code]x[/code] downward (towards negative infinity), returning the largest whole number that is not more than [code]x[/code].
+ [codeblock]
+ # a is 2.0
+ a = floor(2.99)
+ # a is -3.0
+ a = floor(-2.99)
+ [/codeblock]
+ See also [method ceil], [method round], and [method stepify].
+ [b]Note:[/b] This method returns a float. If you need an integer, you can use [code]int(x)[/code] directly.
+ </description>
+ </method>
+ <method name="fmod">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <description>
+ Returns the floating-point remainder of [code]x/y[/code], keeping the sign of [code]x[/code].
+ [codeblock]
+ # Remainder is 1.5
+ var remainder = fmod(7, 5.5)
+ [/codeblock]
+ For the integer remainder operation, use the [code]%[/code] operator.
+ </description>
+ </method>
+ <method name="fposmod">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <description>
+ Returns the floating-point modulus of [code]x/y[/code] that wraps equally in positive and negative.
+ [codeblock]
+ for i in 7:
+ var x = 0.5 * i - 1.5
+ print("%4.1f %4.1f %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)])
+ [/codeblock]
+ Produces:
+ [codeblock]
+ -1.5 -0.0 0.0
+ -1.0 -1.0 0.5
+ -0.5 -0.5 1.0
+ 0.0 0.0 0.0
+ 0.5 0.5 0.5
+ 1.0 1.0 1.0
+ 1.5 0.0 0.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="hash">
+ <return type="int">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Returns the integer hash of the variable passed.
+ [codeblock]
+ print(hash("a")) # Prints 177670
+ [/codeblock]
+ </description>
+ </method>
+ <method name="instance_from_id">
+ <return type="Object">
+ </return>
+ <argument index="0" name="instance_id" type="int">
+ </argument>
+ <description>
+ Returns the Object that corresponds to [code]instance_id[/code]. All Objects have a unique instance ID.
+ [codeblock]
+ var foo = "bar"
+ func _ready():
+ var id = get_instance_id()
+ var inst = instance_from_id(id)
+ print(inst.foo) # Prints bar
+ [/codeblock]
+ </description>
+ </method>
+ <method name="inverse_lerp">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="weight" type="float">
+ </argument>
+ <description>
+ Returns a normalized value considering the given range. This is the opposite of [method lerp].
+ [codeblock]
+ var middle = lerp(20, 30, 0.75)
+ # `middle` is now 27.5.
+ # Now, we pretend to have forgotten the original ratio and want to get it back.
+ var ratio = inverse_lerp(20, 30, 27.5)
+ # `ratio` is now 0.75.
+ [/codeblock]
+ </description>
+ </method>
+ <method name="is_equal_approx">
+ <return type="bool">
+ </return>
+ <argument index="0" name="a" type="float">
+ </argument>
+ <argument index="1" name="b" type="float">
+ </argument>
+ <description>
+ Returns [code]true[/code] if [code]a[/code] and [code]b[/code] are approximately equal to each other.
+ Here, approximately equal means that [code]a[/code] and [code]b[/code] are within a small internal epsilon of each other, which scales with the magnitude of the numbers.
+ Infinity values of the same sign are considered equal.
+ </description>
+ </method>
+ <method name="is_inf">
+ <return type="bool">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns whether [code]x[/code] is an infinity value (either positive infinity or negative infinity).
+ </description>
+ </method>
+ <method name="is_instance_id_valid">
+ <return type="bool">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_instance_valid">
+ <return type="bool">
+ </return>
+ <argument index="0" name="instance" type="Variant">
+ </argument>
+ <description>
+ Returns whether [code]instance[/code] is a valid object (e.g. has not been deleted from memory).
+ </description>
+ </method>
+ <method name="is_nan">
+ <return type="bool">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns whether [code]x[/code] is a NaN ("Not a Number" or invalid) value.
+ </description>
+ </method>
+ <method name="is_zero_approx">
+ <return type="bool">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns [code]true[/code] if [code]x[/code] is zero or almost zero.
+ This method is faster than using [method is_equal_approx] with one value as zero.
+ </description>
+ </method>
+ <method name="lerp">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="weight" type="float">
+ </argument>
+ <description>
+ Linearly interpolates between two values by a normalized value. This is the opposite of [method inverse_lerp].
+ [codeblock]
+ lerp(0, 4, 0.75) # Returns 3.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="lerp_angle">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="weight" type="float">
+ </argument>
+ <description>
+ Linearly interpolates between two angles (in radians) by a normalized value.
+ Similar to [method lerp], but interpolates correctly when the angles wrap around [constant @GDScript.TAU].
+ [codeblock]
+ extends Sprite
+ var elapsed = 0.0
+ func _process(delta):
+ var min_angle = deg2rad(0.0)
+ var max_angle = deg2rad(90.0)
+ rotation = lerp_angle(min_angle, max_angle, elapsed)
+ elapsed += delta
+ [/codeblock]
+ </description>
+ </method>
+ <method name="linear2db">
+ <return type="float">
+ </return>
+ <argument index="0" name="lin" type="float">
+ </argument>
+ <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). Example:
+ [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"), linear2db($Slider.value))
+ [/codeblock]
+ </description>
+ </method>
+ <method name="log">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Natural logarithm. The amount of time needed to reach a certain level of continuous growth.
+ [b]Note:[/b] This is not the same as the "log" function on most calculators, which uses a base 10 logarithm.
+ [codeblock]
+ log(10) # Returns 2.302585
+ [/codeblock]
+ [b]Note:[/b] The logarithm of [code]0[/code] returns [code]-inf[/code], while negative values return [code]-nan[/code].
+ </description>
+ </method>
+ <method name="max" qualifiers="vararg">
+ <return type="Variant">
+ </return>
+ <description>
+ Returns the maximum of the given values. This method can take any number of arguments.
+ [codeblock]
+ max(1, 7, 3, -6, 5) # Returns 7
+ [/codeblock]
+ </description>
+ </method>
+ <method name="maxf">
+ <return type="float">
+ </return>
+ <argument index="0" name="a" type="float">
+ </argument>
+ <argument index="1" name="b" type="float">
+ </argument>
+ <description>
+ Returns the maximum of two float values.
+ [codeblock]
+ maxf(3.6, 24) # Returns 24.0
+ maxf(-3.99, -4) # Returns -3.99
+ [/codeblock]
+ </description>
+ </method>
+ <method name="maxi">
+ <return type="int">
+ </return>
+ <argument index="0" name="a" type="int">
+ </argument>
+ <argument index="1" name="b" type="int">
+ </argument>
+ <description>
+ Returns the maximum of two int values.
+ [codeblock]
+ maxi(1, 2) # Returns 2
+ maxi(-3, -4) # Returns -3
+ [/codeblock]
+ </description>
+ </method>
+ <method name="min" qualifiers="vararg">
+ <return type="Variant">
+ </return>
+ <description>
+ Returns the minimum of the given values. This method can take any number of arguments.
+ [codeblock]
+ min(1, 7, 3, -6, 5) # Returns -6
+ [/codeblock]
+ </description>
+ </method>
+ <method name="minf">
+ <return type="float">
+ </return>
+ <argument index="0" name="a" type="float">
+ </argument>
+ <argument index="1" name="b" type="float">
+ </argument>
+ <description>
+ Returns the minimum of two float values.
+ [codeblock]
+ minf(3.6, 24) # Returns 3.6
+ minf(-3.99, -4) # Returns -4.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="mini">
+ <return type="int">
+ </return>
+ <argument index="0" name="a" type="int">
+ </argument>
+ <argument index="1" name="b" type="int">
+ </argument>
+ <description>
+ Returns the minimum of two int values.
+ [codeblock]
+ mini(1, 2) # Returns 1
+ mini(-3, -4) # Returns -4
+ [/codeblock]
+ </description>
+ </method>
+ <method name="move_toward">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="delta" type="float">
+ </argument>
+ <description>
+ Moves [code]from[/code] toward [code]to[/code] by the [code]delta[/code] value.
+ Use a negative [code]delta[/code] value to move away.
+ [codeblock]
+ move_toward(5, 10, 4) # Returns 9
+ move_toward(10, 5, 4) # Returns 6
+ move_toward(10, 5, -1.5) # Returns 11.5
+ [/codeblock]
+ </description>
+ </method>
+ <method name="nearest_po2">
+ <return type="int">
+ </return>
+ <argument index="0" name="value" type="int">
+ </argument>
+ <description>
+ Returns the nearest equal or larger power of 2 for integer [code]value[/code].
+ In other words, returns the smallest value [code]a[/code] where [code]a = pow(2, n)[/code] such that [code]value &lt;= a[/code] for some non-negative integer [code]n[/code].
+ [codeblock]
+ nearest_po2(3) # Returns 4
+ nearest_po2(4) # Returns 4
+ nearest_po2(5) # Returns 8
+
+ nearest_po2(0) # Returns 0 (this may not be what you expect)
+ nearest_po2(-1) # Returns 0 (this may not be what you expect)
+ [/codeblock]
+ [b]WARNING:[/b] Due to the way it is implemented, this function returns [code]0[/code] rather than [code]1[/code] for non-positive values of [code]value[/code] (in reality, 1 is the smallest integer power of 2).
+ </description>
+ </method>
+ <method name="polar2cartesian">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="r" type="float">
+ </argument>
+ <argument index="1" name="th" type="float">
+ </argument>
+ <description>
+ Converts a 2D point expressed in the polar coordinate system (a distance from the origin [code]r[/code] and an angle [code]th[/code]) to the cartesian coordinate system (X and Y axis).
+ </description>
+ </method>
+ <method name="pow">
+ <return type="float">
+ </return>
+ <argument index="0" name="base" type="float">
+ </argument>
+ <argument index="1" name="exp" type="float">
+ </argument>
+ <description>
+ Returns the result of [code]base[/code] raised to the power of [code]exp[/code].
+ [codeblock]
+ pow(2, 5) # Returns 32
+ [/codeblock]
+ </description>
+ </method>
+ <method name="print" qualifiers="vararg">
+ <description>
+ Converts one or more arguments to strings in the best way possible and prints them to the console.
+ [codeblock]
+ a = [1, 2, 3]
+ print("a", "b", a) # Prints ab[1, 2, 3]
+ [/codeblock]
+ [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed.
+ </description>
+ </method>
+ <method name="printerr" qualifiers="vararg">
+ <description>
+ Prints one or more arguments to strings in the best way possible to standard error line.
+ [codeblock]
+ printerr("prints to stderr")
+ [/codeblock]
+ </description>
+ </method>
+ <method name="printraw" qualifiers="vararg">
+ <description>
+ Prints one or more arguments to strings in the best way possible to console. No newline is added at the end.
+ [codeblock]
+ printraw("A")
+ printraw("B")
+ # Prints AB
+ [/codeblock]
+ [b]Note:[/b] Due to limitations with Godot's built-in console, this only prints to the terminal. If you need to print in the editor, use another method, such as [method print].
+ </description>
+ </method>
+ <method name="prints" qualifiers="vararg">
+ <description>
+ Prints one or more arguments to the console with a space between each argument.
+ [codeblock]
+ prints("A", "B", "C") # Prints A B C
+ [/codeblock]
+ </description>
+ </method>
+ <method name="printt" qualifiers="vararg">
+ <description>
+ Prints one or more arguments to the console with a tab between each argument.
+ [codeblock]
+ printt("A", "B", "C") # Prints A B C
+ [/codeblock]
+ </description>
+ </method>
+ <method name="push_error" qualifiers="vararg">
+ <description>
+ Pushes an error message to Godot's built-in debugger and to the OS terminal.
+ [codeblock]
+ push_error("test error") # Prints "test error" to debugger and terminal as error call
+ [/codeblock]
+ [b]Note:[/b] Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use [code]assert(false, "test error")[/code] instead.
+ </description>
+ </method>
+ <method name="push_warning" qualifiers="vararg">
+ <description>
+ Pushes a warning message to Godot's built-in debugger and to the OS terminal.
+ [codeblock]
+ push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call
+ [/codeblock]
+ </description>
+ </method>
+ <method name="rad2deg">
+ <return type="float">
+ </return>
+ <argument index="0" name="rad" type="float">
+ </argument>
+ <description>
+ Converts an angle expressed in radians to degrees.
+ [codeblock]
+ rad2deg(0.523599) # Returns 30
+ [/codeblock]
+ </description>
+ </method>
+ <method name="rand_from_seed">
+ <return type="PackedInt64Array">
+ </return>
+ <argument index="0" name="seed" type="int">
+ </argument>
+ <description>
+ Random from seed: pass a [code]seed[/code], and an array with both number and new seed is returned. "Seed" here refers to the internal state of the pseudo random number generator. The internal state of the current implementation is 64 bits.
+ </description>
+ </method>
+ <method name="randf">
+ <return type="float">
+ </return>
+ <description>
+ Returns a random floating point value on the interval [code][0, 1][/code].
+ [codeblock]
+ randf() # Returns e.g. 0.375671
+ [/codeblock]
+ </description>
+ </method>
+ <method name="randf_range">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <description>
+ Random range, any floating point value between [code]from[/code] and [code]to[/code].
+ [codeblock]
+ prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315
+ [/codeblock]
+ </description>
+ </method>
+ <method name="randi">
+ <return type="int">
+ </return>
+ <description>
+ Returns a random unsigned 32 bit integer. Use remainder to obtain a random value in the interval [code][0, N - 1][/code] (where N is smaller than 2^32).
+ [codeblock]
+ randi() # Returns random integer between 0 and 2^32 - 1
+ randi() % 20 # Returns random integer between 0 and 19
+ randi() % 100 # Returns random integer between 0 and 99
+ randi() % 100 + 1 # Returns random integer between 1 and 100
+ [/codeblock]
+ </description>
+ </method>
+ <method name="randi_range">
+ <return type="int">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ Random range, any 32-bit integer value between [code]from[/code] and [code]to[/code] (inclusive). If [code]to[/code] is lesser than [code]from[/code] they are swapped.
+ [codeblock]
+ print(randi_range(0, 1)) # Prints 0 or 1
+ print(randi_range(-10, 1000)) # Prints any number from -10 to 1000
+ [/codeblock]
+ </description>
+ </method>
+ <method name="randomize">
+ <description>
+ Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time.
+ [codeblock]
+ func _ready():
+ randomize()
+ [/codeblock]
+ </description>
+ </method>
+ <method name="range_lerp">
+ <return type="float">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <argument index="1" name="istart" type="float">
+ </argument>
+ <argument index="2" name="istop" type="float">
+ </argument>
+ <argument index="3" name="ostart" type="float">
+ </argument>
+ <argument index="4" name="ostop" type="float">
+ </argument>
+ <description>
+ Maps a [code]value[/code] from range [code][istart, istop][/code] to [code][ostart, ostop][/code].
+ [codeblock]
+ range_lerp(75, 0, 100, -1, 1) # Returns 0.5
+ [/codeblock]
+ </description>
+ </method>
+ <method name="range_step_decimals">
+ <return type="int">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="round">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Rounds [code]x[/code] to the nearest whole number, with halfway cases rounded away from zero.
+ [codeblock]
+ round(2.6) # Returns 3
+ [/codeblock]
+ See also [method floor], [method ceil], and [method stepify].
+ </description>
+ </method>
+ <method name="seed">
+ <argument index="0" name="base" type="int">
+ </argument>
+ <description>
+ Sets seed for the random number generator.
+ [codeblock]
+ my_seed = "Godot Rocks"
+ seed(my_seed.hash())
+ [/codeblock]
+ </description>
+ </method>
+ <method name="sign">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="x" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="signf">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the sign of [code]x[/code] as a float: -1.0 or 1.0. Returns 0.0 if [code]x[/code] is 0.
+ [codeblock]
+ sign(-6.0) # Returns -1.0
+ sign(0.0) # Returns 0.0
+ sign(6.0) # Returns 1.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="signi">
+ <return type="int">
+ </return>
+ <argument index="0" name="x" type="int">
+ </argument>
+ <description>
+ Returns the sign of [code]x[/code] as an integer: -1 or 1. Returns 0 if [code]x[/code] is 0.
+ [codeblock]
+ sign(-6) # Returns -1
+ sign(0) # Returns 0
+ sign(6) # Returns 1
+ [/codeblock]
+ </description>
+ </method>
+ <method name="sin">
+ <return type="float">
+ </return>
+ <argument index="0" name="angle_rad" type="float">
+ </argument>
+ <description>
+ Returns the sine of angle [code]angle_rad[/code] in radians.
+ [codeblock]
+ sin(0.523599) # Returns 0.5
+ [/codeblock]
+ </description>
+ </method>
+ <method name="sinh">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the hyperbolic sine of [code]x[/code].
+ [codeblock]
+ a = log(2.0) # Returns 0.693147
+ sinh(a) # Returns 0.75
+ [/codeblock]
+ </description>
+ </method>
+ <method name="smoothstep">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="x" type="float">
+ </argument>
+ <description>
+ Returns the result of smoothly interpolating the value of [code]x[/code] between [code]0[/code] and [code]1[/code], based on the where [code]x[/code] lies with respect to the edges [code]from[/code] and [code]to[/code].
+ The return value is [code]0[/code] if [code]x &lt;= from[/code], and [code]1[/code] if [code]x &gt;= to[/code]. If [code]x[/code] lies between [code]from[/code] and [code]to[/code], the returned value follows an S-shaped curve that maps [code]x[/code] between [code]0[/code] and [code]1[/code].
+ This S-shaped curve is the cubic Hermite interpolator, given by [code]f(x) = 3*x^2 - 2*x^3[/code].
+ [codeblock]
+ smoothstep(0, 2, -5.0) # Returns 0.0
+ smoothstep(0, 2, 0.5) # Returns 0.15625
+ smoothstep(0, 2, 1.0) # Returns 0.5
+ smoothstep(0, 2, 2.0) # Returns 1.0
+ [/codeblock]
+ </description>
+ </method>
+ <method name="sqrt">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the square root of [code]x[/code], where [code]x[/code] is a non-negative number.
+ [codeblock]
+ sqrt(9) # Returns 3
+ [/codeblock]
+ [b]Note:[/b]Negative values of [code]x[/code] return NaN. If you need negative inputs, use [code]System.Numerics.Complex[/code] in C#.
+ </description>
+ </method>
+ <method name="step_decimals">
+ <return type="int">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation.
+ [codeblock]
+ # n is 0
+ n = step_decimals(5)
+ # n is 4
+ n = step_decimals(1.0005)
+ # n is 9
+ n = step_decimals(0.000000005)
+ [/codeblock]
+ </description>
+ </method>
+ <method name="stepify">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="step" type="float">
+ </argument>
+ <description>
+ Snaps float value [code]x[/code] to a given [code]step[/code]. This can also be used to round a floating point number to an arbitrary number of decimals.
+ [codeblock]
+ stepify(100, 32) # Returns 96
+ stepify(3.14159, 0.01) # Returns 3.14
+ [/codeblock]
+ See also [method ceil], [method floor], and [method round].
+ </description>
+ </method>
+ <method name="str" qualifiers="vararg">
+ <return type="String">
+ </return>
+ <description>
+ Converts one or more arguments to string in the best way possible.
+ </description>
+ </method>
+ <method name="str2var">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="string" type="String">
+ </argument>
+ <description>
+ Converts a formatted string that was returned by [method var2str] to the original value.
+ [codeblock]
+ a = '{ "a": 1, "b": 2 }'
+ b = str2var(a)
+ print(b["a"]) # Prints 1
+ [/codeblock]
+ </description>
+ </method>
+ <method name="tan">
+ <return type="float">
+ </return>
+ <argument index="0" name="angle_rad" type="float">
+ </argument>
+ <description>
+ Returns the tangent of angle [code]angle_rad[/code] in radians.
+ [codeblock]
+ tan(deg2rad(45)) # Returns 1
+ [/codeblock]
+ </description>
+ </method>
+ <method name="tanh">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the hyperbolic tangent of [code]x[/code].
+ [codeblock]
+ a = log(2.0) # Returns 0.693147
+ tanh(a) # Returns 0.6
+ [/codeblock]
+ </description>
+ </method>
+ <method name="typeof">
+ <return type="int">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Returns the internal type of the given Variant object, using the [enum Variant.Type] values.
+ [codeblock]
+ p = parse_json('["a", "b", "c"]')
+ if typeof(p) == TYPE_ARRAY:
+ print(p[0]) # Prints a
+ else:
+ print("unexpected results")
+ [/codeblock]
+ </description>
+ </method>
+ <method name="var2bytes">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Encodes a [Variant] value to a byte array, without encoding objects. Deserialization can be done with [method bytes2var].
+ [b]Note:[/b] If you need object serialization, see [method var2bytes_with_objects].
+ </description>
+ </method>
+ <method name="var2bytes_with_objects">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Encodes a [Variant] value to a byte array. Encoding objects is allowed (and can potentially include code). Deserialization can be done with [method bytes2var_with_objects].
+ </description>
+ </method>
+ <method name="var2str">
+ <return type="String">
+ </return>
+ <argument index="0" name="variable" type="Variant">
+ </argument>
+ <description>
+ Converts a Variant [code]variable[/code] to a formatted string that can later be parsed using [method str2var].
+ [codeblock]
+ a = { "a": 1, "b": 2 }
+ print(var2str(a))
+ [/codeblock]
+ prints
+ [codeblock]
+ {
+ "a": 1,
+ "b": 2
+ }
+ [/codeblock]
+ </description>
+ </method>
+ <method name="weakref">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="obj" type="Variant">
+ </argument>
+ <description>
+ Returns a weak reference to an object, or [code]null[/code] is the argument is invalid.
+ A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. However, until the object is actually destroyed the weak reference may return the object even if there are no strong references to it.
+ </description>
+ </method>
+ <method name="wrapf">
+ <return type="float">
+ </return>
+ <argument index="0" name="value" type="float">
+ </argument>
+ <argument index="1" name="min" type="float">
+ </argument>
+ <argument index="2" name="max" type="float">
+ </argument>
+ <description>
+ Wraps float [code]value[/code] between [code]min[/code] and [code]max[/code].
+ Usable for creating loop-alike behavior or infinite surfaces.
+ [codeblock]
+ # Infinite loop between 5.0 and 9.9
+ value = wrapf(value + 0.1, 5.0, 10.0)
+ [/codeblock]
+ [codeblock]
+ # Infinite rotation (in radians)
+ angle = wrapf(angle + 0.1, 0.0, TAU)
+ [/codeblock]
+ [codeblock]
+ # Infinite rotation (in radians)
+ angle = wrapf(angle + 0.1, -PI, PI)
+ [/codeblock]
+ [b]Note:[/b] If [code]min[/code] is [code]0[/code], this is equivalent to [method fposmod], so prefer using that instead.
+ [code]wrapf[/code] is more flexible than using the [method fposmod] approach by giving the user control over the minimum value.
+ </description>
+ </method>
+ <method name="wrapi">
+ <return type="int">
+ </return>
+ <argument index="0" name="value" type="int">
+ </argument>
+ <argument index="1" name="min" type="int">
+ </argument>
+ <argument index="2" name="max" type="int">
+ </argument>
+ <description>
+ Wraps integer [code]value[/code] between [code]min[/code] and [code]max[/code].
+ Usable for creating loop-alike behavior or infinite surfaces.
+ [codeblock]
+ # Infinite loop between 5 and 9
+ frame = wrapi(frame + 1, 5, 10)
+ [/codeblock]
+ [codeblock]
+ # result is -2
+ var result = wrapi(-6, -5, -1)
+ [/codeblock]
+ </description>
+ </method>
</methods>
<members>
<member name="AudioServer" type="AudioServer" setter="" getter="">
@@ -95,6 +1236,9 @@
<member name="ResourceSaver" type="ResourceSaver" setter="" getter="">
The [ResourceSaver] singleton.
</member>
+ <member name="TextServerManager" type="TextServerManager" setter="" getter="">
+ The [TextServerManager] singleton.
+ </member>
<member name="TranslationServer" type="TranslationServer" setter="" getter="">
The [TranslationServer] singleton.
</member>
@@ -145,6 +1289,9 @@
<constant name="HALIGN_RIGHT" value="2" enum="HAlign">
Horizontal right alignment, usually for text-derived classes.
</constant>
+ <constant name="HALIGN_FILL" value="3" enum="HAlign">
+ Expand row to fit width, usually for text-derived classes.
+ </constant>
<constant name="VALIGN_TOP" value="0" enum="VAlign">
Vertical top alignment, usually for text-derived classes.
</constant>
@@ -952,130 +2099,61 @@
<constant name="BUTTON_MASK_XBUTTON2" value="256" enum="ButtonList">
Extra mouse button 2 mask.
</constant>
- <constant name="JOY_INVALID_BUTTON" value="-1" enum="JoyButtonList">
+ <constant name="JOY_BUTTON_INVALID" value="-1" enum="JoyButtonList">
An invalid game controller button.
</constant>
<constant name="JOY_BUTTON_A" value="0" enum="JoyButtonList">
- Game controller SDL button A.
+ Game controller SDL button A. Corresponds to the bottom action button: Sony Cross, Xbox A, Nintendo B.
</constant>
<constant name="JOY_BUTTON_B" value="1" enum="JoyButtonList">
- Game controller SDL button B.
+ Game controller SDL button B. Corresponds to the right action button: Sony Circle, Xbox B, Nintendo A.
</constant>
<constant name="JOY_BUTTON_X" value="2" enum="JoyButtonList">
- Game controller SDL button X.
+ Game controller SDL button X. Corresponds to the left action button: Sony Square, Xbox X, Nintendo Y.
</constant>
<constant name="JOY_BUTTON_Y" value="3" enum="JoyButtonList">
- Game controller SDL button Y.
+ Game controller SDL button Y. Corresponds to the top action button: Sony Triangle, Xbox Y, Nintendo X.
</constant>
<constant name="JOY_BUTTON_BACK" value="4" enum="JoyButtonList">
- Game controller SDL back button.
+ Game controller SDL back button. Corresponds to the Sony Select, Xbox Back, Nintendo - button.
</constant>
<constant name="JOY_BUTTON_GUIDE" value="5" enum="JoyButtonList">
- Game controller SDL guide button.
+ Game controller SDL guide button. Corresponds to the Sony PS, Xbox Home button.
</constant>
<constant name="JOY_BUTTON_START" value="6" enum="JoyButtonList">
- Game controller SDL start button.
+ Game controller SDL start button. Corresponds to the Nintendo + button.
</constant>
<constant name="JOY_BUTTON_LEFT_STICK" value="7" enum="JoyButtonList">
- Game controller SDL left stick button.
+ Game controller SDL left stick button. Corresponds to the Sony L3, Xbox L/LS button.
</constant>
<constant name="JOY_BUTTON_RIGHT_STICK" value="8" enum="JoyButtonList">
- Game controller SDL right stick button.
+ Game controller SDL right stick button. Corresponds to the Sony R3, Xbox R/RS button.
</constant>
<constant name="JOY_BUTTON_LEFT_SHOULDER" value="9" enum="JoyButtonList">
- Game controller SDL left shoulder button.
+ Game controller SDL left shoulder button. Corresponds to the Sony L1, Xbox LB button.
</constant>
<constant name="JOY_BUTTON_RIGHT_SHOULDER" value="10" enum="JoyButtonList">
- Game controller SDL right shoulder button.
+ Game controller SDL right shoulder button. Corresponds to the Sony R1, Xbox RB button.
</constant>
<constant name="JOY_BUTTON_DPAD_UP" value="11" enum="JoyButtonList">
- Game controller SDL D-pad up button.
+ Game controller D-pad up button.
</constant>
<constant name="JOY_BUTTON_DPAD_DOWN" value="12" enum="JoyButtonList">
- Game controller SDL D-pad down button.
+ Game controller D-pad down button.
</constant>
<constant name="JOY_BUTTON_DPAD_LEFT" value="13" enum="JoyButtonList">
- Game controller SDL D-pad left button.
+ Game controller D-pad left button.
</constant>
<constant name="JOY_BUTTON_DPAD_RIGHT" value="14" enum="JoyButtonList">
- Game controller SDL D-pad right button.
+ Game controller D-pad right button.
</constant>
- <constant name="JOY_SDL_BUTTONS" value="15" enum="JoyButtonList">
+ <constant name="JOY_BUTTON_SDL_MAX" value="15" enum="JoyButtonList">
The number of SDL game controller buttons.
</constant>
- <constant name="JOY_SONY_X" value="0" enum="JoyButtonList">
- Sony DualShock controller X button maps to SDL button A.
- </constant>
- <constant name="JOY_SONY_CROSS" value="0" enum="JoyButtonList">
- Sony DualShock controller cross button maps to SDL button A.
- </constant>
- <constant name="JOY_SONY_CIRCLE" value="1" enum="JoyButtonList">
- Sony DualShock controller circle button maps to SDL button B.
- </constant>
- <constant name="JOY_SONY_SQUARE" value="2" enum="JoyButtonList">
- Sony DualShock controller square button maps to SDL button X.
- </constant>
- <constant name="JOY_SONY_TRIANGLE" value="3" enum="JoyButtonList">
- Sony DualShock controller triangle button maps to SDL button Y.
- </constant>
- <constant name="JOY_SONY_SELECT" value="4" enum="JoyButtonList">
- Sony DualShock controller select button maps to SDL back button.
- </constant>
- <constant name="JOY_SONY_START" value="6" enum="JoyButtonList">
- Sony DualShock controller start button maps to SDL start button.
- </constant>
- <constant name="JOY_SONY_PS" value="5" enum="JoyButtonList">
- Sony DualShock controller PS button maps to SDL guide button.
- </constant>
- <constant name="JOY_SONY_L1" value="9" enum="JoyButtonList">
- Sony DualShock controller L1 button maps to SDL left shoulder button.
- </constant>
- <constant name="JOY_SONY_R1" value="10" enum="JoyButtonList">
- Sony DualShock controller R1 button maps to SDL right shoulder button.
- </constant>
- <constant name="JOY_SONY_L3" value="7" enum="JoyButtonList">
- Sony DualShock controller L3 button maps to SDL left stick button.
- </constant>
- <constant name="JOY_SONY_R3" value="8" enum="JoyButtonList">
- Sony DualShock controller R3 button maps to SDL right stick button.
- </constant>
- <constant name="JOY_XBOX_A" value="0" enum="JoyButtonList">
- Xbox game controller A button maps to SDL button A.
- </constant>
- <constant name="JOY_XBOX_B" value="1" enum="JoyButtonList">
- Xbox game controller B button maps to SDL button B.
- </constant>
- <constant name="JOY_XBOX_X" value="2" enum="JoyButtonList">
- Xbox game controller X button maps to SDL button X.
- </constant>
- <constant name="JOY_XBOX_Y" value="3" enum="JoyButtonList">
- Xbox game controller Y button maps to SDL button Y.
- </constant>
- <constant name="JOY_XBOX_BACK" value="4" enum="JoyButtonList">
- Xbox game controller back button maps to SDL back button.
- </constant>
- <constant name="JOY_XBOX_START" value="6" enum="JoyButtonList">
- Xbox game controller start button maps to SDL start button.
- </constant>
- <constant name="JOY_XBOX_HOME" value="5" enum="JoyButtonList">
- Xbox game controller home button maps to SDL guide button.
- </constant>
- <constant name="JOY_XBOX_LS" value="7" enum="JoyButtonList">
- Xbox game controller left stick button maps to SDL left stick button.
- </constant>
- <constant name="JOY_XBOX_RS" value="8" enum="JoyButtonList">
- Xbox game controller right stick button maps to SDL right stick button.
- </constant>
- <constant name="JOY_XBOX_LB" value="9" enum="JoyButtonList">
- Xbox game controller left bumper button maps to SDL left shoulder button.
- </constant>
- <constant name="JOY_XBOX_RB" value="10" enum="JoyButtonList">
- Xbox game controller right bumper button maps to SDL right shoulder button.
- </constant>
<constant name="JOY_BUTTON_MAX" value="36" enum="JoyButtonList">
- The maximum number of game controller buttons.
+ The maximum number of game controller buttons: Android supports up to 36 buttons.
</constant>
- <constant name="JOY_INVALID_AXIS" value="-1" enum="JoyAxisList">
+ <constant name="JOY_AXIS_INVALID" value="-1" enum="JoyAxisList">
An invalid game controller axis.
</constant>
<constant name="JOY_AXIS_LEFT_X" value="0" enum="JoyAxisList">
@@ -1096,41 +2174,11 @@
<constant name="JOY_AXIS_TRIGGER_RIGHT" value="5" enum="JoyAxisList">
Game controller right trigger axis.
</constant>
- <constant name="JOY_SDL_AXES" value="6" enum="JoyAxisList">
+ <constant name="JOY_AXIS_SDL_MAX" value="6" enum="JoyAxisList">
The number of SDL game controller axes.
</constant>
- <constant name="JOY_AXIS_0_X" value="0" enum="JoyAxisList">
- Game controller joystick 0 x-axis.
- </constant>
- <constant name="JOY_AXIS_0_Y" value="1" enum="JoyAxisList">
- Game controller joystick 0 y-axis.
- </constant>
- <constant name="JOY_AXIS_1_X" value="2" enum="JoyAxisList">
- Game controller joystick 1 x-axis.
- </constant>
- <constant name="JOY_AXIS_1_Y" value="3" enum="JoyAxisList">
- Game controller joystick 1 y-axis.
- </constant>
- <constant name="JOY_AXIS_2_X" value="4" enum="JoyAxisList">
- Game controller joystick 2 x-axis.
- </constant>
- <constant name="JOY_AXIS_2_Y" value="5" enum="JoyAxisList">
- Game controller joystick 2 y-axis.
- </constant>
- <constant name="JOY_AXIS_3_X" value="6" enum="JoyAxisList">
- Game controller joystick 3 x-axis.
- </constant>
- <constant name="JOY_AXIS_3_Y" value="7" enum="JoyAxisList">
- Game controller joystick 3 y-axis.
- </constant>
- <constant name="JOY_AXIS_4_X" value="8" enum="JoyAxisList">
- Game controller joystick 4 x-axis.
- </constant>
- <constant name="JOY_AXIS_4_Y" value="9" enum="JoyAxisList">
- Game controller joystick 4 y-axis.
- </constant>
<constant name="JOY_AXIS_MAX" value="10" enum="JoyAxisList">
- The maximum number of game controller axes.
+ The maximum number of game controller axes: OpenVR supports up to 5 Joysticks making a total of 10 axes.
</constant>
<constant name="MIDI_MESSAGE_NOTE_OFF" value="8" enum="MidiMessageList">
MIDI note OFF message.
@@ -1456,7 +2504,7 @@
<constant name="TYPE_INT" value="2" enum="Variant.Type">
Variable is of type [int].
</constant>
- <constant name="TYPE_REAL" value="3" enum="Variant.Type">
+ <constant name="TYPE_FLOAT" value="3" enum="Variant.Type">
Variable is of type [float] (real).
</constant>
<constant name="TYPE_STRING" value="4" enum="Variant.Type">
@@ -1594,43 +2642,40 @@
<constant name="OP_MODULE" value="12" enum="Variant.Operator">
Remainder/modulo operator ([code]%[/code]).
</constant>
- <constant name="OP_STRING_CONCAT" value="13" enum="Variant.Operator">
- String concatenation operator ([code]+[/code]).
- </constant>
- <constant name="OP_SHIFT_LEFT" value="14" enum="Variant.Operator">
+ <constant name="OP_SHIFT_LEFT" value="13" enum="Variant.Operator">
Left shift operator ([code]&lt;&lt;[/code]).
</constant>
- <constant name="OP_SHIFT_RIGHT" value="15" enum="Variant.Operator">
+ <constant name="OP_SHIFT_RIGHT" value="14" enum="Variant.Operator">
Right shift operator ([code]&gt;&gt;[/code]).
</constant>
- <constant name="OP_BIT_AND" value="16" enum="Variant.Operator">
+ <constant name="OP_BIT_AND" value="15" enum="Variant.Operator">
Bitwise AND operator ([code]&amp;[/code]).
</constant>
- <constant name="OP_BIT_OR" value="17" enum="Variant.Operator">
+ <constant name="OP_BIT_OR" value="16" enum="Variant.Operator">
Bitwise OR operator ([code]|[/code]).
</constant>
- <constant name="OP_BIT_XOR" value="18" enum="Variant.Operator">
+ <constant name="OP_BIT_XOR" value="17" enum="Variant.Operator">
Bitwise XOR operator ([code]^[/code]).
</constant>
- <constant name="OP_BIT_NEGATE" value="19" enum="Variant.Operator">
+ <constant name="OP_BIT_NEGATE" value="18" enum="Variant.Operator">
Bitwise NOT operator ([code]~[/code]).
</constant>
- <constant name="OP_AND" value="20" enum="Variant.Operator">
+ <constant name="OP_AND" value="19" enum="Variant.Operator">
Logical AND operator ([code]and[/code] or [code]&amp;&amp;[/code]).
</constant>
- <constant name="OP_OR" value="21" enum="Variant.Operator">
+ <constant name="OP_OR" value="20" enum="Variant.Operator">
Logical OR operator ([code]or[/code] or [code]||[/code]).
</constant>
- <constant name="OP_XOR" value="22" enum="Variant.Operator">
+ <constant name="OP_XOR" value="21" enum="Variant.Operator">
Logical XOR operator (not implemented in GDScript).
</constant>
- <constant name="OP_NOT" value="23" enum="Variant.Operator">
+ <constant name="OP_NOT" value="22" enum="Variant.Operator">
Logical NOT operator ([code]not[/code] or [code]![/code]).
</constant>
- <constant name="OP_IN" value="24" enum="Variant.Operator">
+ <constant name="OP_IN" value="23" enum="Variant.Operator">
Logical IN operator ([code]in[/code]).
</constant>
- <constant name="OP_MAX" value="25" enum="Variant.Operator">
+ <constant name="OP_MAX" value="24" enum="Variant.Operator">
Represents the size of the [enum Variant.Operator] enum.
</constant>
</constants>
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index cbc04ca672..baea84df65 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -4,13 +4,33 @@
Axis-Aligned Bounding Box.
</brief_description>
<description>
- AABB consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
+ [AABB] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
+ It uses floating-point coordinates. The 2D counterpart to [AABB] is [Rect2].
+ [b]Note:[/b] Unlike [Rect2], [AABB] does not have a variant that uses integer coordinates.
</description>
<tutorials>
<link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link>
</tutorials>
<methods>
- <method name="AABB">
+ <method name="AABB" qualifiers="constructor">
+ <return type="AABB">
+ </return>
+ <description>
+ Constructs a default-initialized [AABB] with default (zero) values of [member position] and [member size].
+ </description>
+ </method>
+ <method name="AABB" qualifiers="constructor">
+ <return type="AABB">
+ </return>
+ <argument index="0" name="from" type="AABB">
+ </argument>
+ <description>
+ Constructs an [AABB] as a copy of the given [AABB].
+ </description>
+ </method>
+ <method name="AABB" qualifiers="constructor">
<return type="AABB">
</return>
<argument index="0" name="position" type="Vector3">
@@ -172,8 +192,18 @@
Returns [code]true[/code] if the [AABB] is on both sides of a plane.
</description>
</method>
+ <method name="intersects_ray">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <argument index="1" name="dir" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="intersects_segment">
- <return type="bool">
+ <return type="Variant">
</return>
<argument index="0" name="from" type="Vector3">
</argument>
@@ -201,6 +231,30 @@
Returns a larger [AABB] that contains both this [AABB] and [code]with[/code].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="AABB">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="AABB">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="AABB">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="end" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
diff --git a/doc/classes/AESContext.xml b/doc/classes/AESContext.xml
index ff433370bd..f577bab992 100644
--- a/doc/classes/AESContext.xml
+++ b/doc/classes/AESContext.xml
@@ -5,7 +5,8 @@
</brief_description>
<description>
This class provides access to AES encryption/decryption of raw data. Both AES-ECB and AES-CBC mode are supported.
- [codeblock]
+ [codeblocks]
+ [gdscript]
extends Node
var aes = AESContext.new()
@@ -35,7 +36,45 @@
aes.finish()
# Check CBC
assert(decrypted == data.to_utf8())
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+ using System.Diagnostics;
+
+ public class Example : Node
+ {
+ public AESContext Aes = new AESContext();
+ public override void _Ready()
+ {
+ string key = "My secret key!!!"; // Key must be either 16 or 32 bytes.
+ string data = "My secret text!!"; // Data size must be multiple of 16 bytes, apply padding if needed.
+ // Encrypt ECB
+ Aes.Start(AESContext.Mode.EcbEncrypt, key.ToUTF8());
+ byte[] encrypted = Aes.Update(data.ToUTF8());
+ Aes.Finish();
+ // Decrypt ECB
+ Aes.Start(AESContext.Mode.EcbDecrypt, key.ToUTF8());
+ byte[] decrypted = Aes.Update(encrypted);
+ Aes.Finish();
+ // Check ECB
+ Debug.Assert(decrypted == data.ToUTF8());
+
+ string iv = "My secret iv!!!!"; // IV must be of exactly 16 bytes.
+ // Encrypt CBC
+ Aes.Start(AESContext.Mode.EcbEncrypt, key.ToUTF8(), iv.ToUTF8());
+ encrypted = Aes.Update(data.ToUTF8());
+ Aes.Finish();
+ // Decrypt CBC
+ Aes.Start(AESContext.Mode.EcbDecrypt, key.ToUTF8(), iv.ToUTF8());
+ decrypted = Aes.Update(encrypted);
+ Aes.Finish();
+ // Check CBC
+ Debug.Assert(decrypted == data.ToUTF8());
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml
index 2695e86f47..0cd7d3dc25 100644
--- a/doc/classes/AStar.xml
+++ b/doc/classes/AStar.xml
@@ -7,7 +7,8 @@
A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in three-dimensional space and Euclidean distances by default.
You must add points manually with [method add_point] and create segments manually with [method connect_points]. Then you can test if there is a path between two points with the [method are_points_connected] function, get a path containing indices by [method get_id_path], or one containing actual coordinates with [method get_point_path].
It is also possible to use non-Euclidean distances. To do so, create a class that extends [code]AStar[/code] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example.
- [codeblock]
+ [codeblocks]
+ [gdscript]
class MyAStar:
extends AStar
@@ -16,7 +17,21 @@
func _estimate_cost(u, v):
return min(0, abs(u - v) - 1)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public class MyAStar : AStar
+ {
+ public override float _ComputeCost(int u, int v)
+ {
+ return Mathf.Abs(u - v);
+ }
+ public override float _EstimateCost(int u, int v)
+ {
+ return Mathf.Min(0, Mathf.Abs(u - v) - 1);
+ }
+ }
+ [/csharp]
+ [/codeblocks]
[method _estimate_cost] should return a lower bound of the distance, i.e. [code]_estimate_cost(u, v) &lt;= _compute_cost(u, v)[/code]. This serves as a hint to the algorithm because the custom [code]_compute_cost[/code] might be computation-heavy. If this is not the case, make [method _estimate_cost] return the same value as [method _compute_cost] to provide the algorithm with the most accurate information.
</description>
<tutorials>
@@ -57,10 +72,16 @@
</argument>
<description>
Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(1, 0, 0), 4); // Adds the point (1, 0, 0) with weight_scale 4 and id 1
+ [/csharp]
+ [/codeblocks]
If there already exists a point for the given [code]id[/code], its position and weight scale are updated to the given values.
</description>
</method>
@@ -95,12 +116,20 @@
</argument>
<description>
Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(1, 1, 0))
astar.add_point(2, Vector3(0, 5, 0))
astar.connect_points(1, 2, false)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(1, 1, 0));
+ astar.AddPoint(2, new Vector3(0, 5, 0));
+ astar.ConnectPoints(1, 2, false);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="disconnect_points">
@@ -142,13 +171,22 @@
</argument>
<description>
Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(0, 0, 0))
astar.add_point(2, Vector3(0, 5, 0))
astar.connect_points(1, 2)
var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(0, 0, 0));
+ astar.AddPoint(2, new Vector3(0, 5, 0));
+ astar.ConnectPoints(1, 2);
+ Vector3 res = astar.GetClosestPositionInSegment(new Vector3(3, 3, 0)); // Returns (0, 3, 0)
+ [/csharp]
+ [/codeblocks]
The result is in the segment that goes from [code]y = 0[/code] to [code]y = 5[/code]. It's the closest position in the segment to the given point.
</description>
</method>
@@ -161,7 +199,8 @@
</argument>
<description>
Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(0, 0, 0))
astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1
@@ -174,7 +213,20 @@
astar.connect_points(1, 4, false)
var res = astar.get_id_path(1, 3) # Returns [1, 2, 3]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(0, 0, 0));
+ astar.AddPoint(2, new Vector3(0, 1, 0), 1); // Default weight is 1
+ astar.AddPoint(3, new Vector3(1, 1, 0));
+ astar.AddPoint(4, new Vector3(2, 0, 0));
+ astar.ConnectPoints(1, 2, false);
+ 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]
+ [/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.
</description>
</method>
@@ -192,7 +244,8 @@
</argument>
<description>
Returns an array with the IDs of the points that form the connection with the given point.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar.new()
astar.add_point(1, Vector3(0, 0, 0))
astar.add_point(2, Vector3(0, 1, 0))
@@ -203,7 +256,19 @@
astar.connect_points(1, 3, true)
var neighbors = astar.get_point_connections(1) # Returns [2, 3]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar();
+ astar.AddPoint(1, new Vector3(0, 0, 0));
+ astar.AddPoint(2, new Vector3(0, 1, 0));
+ astar.AddPoint(3, new Vector3(1, 1, 0));
+ astar.AddPoint(4, new Vector3(2, 0, 0));
+ astar.ConnectPoints(1, 2, true);
+ astar.ConnectPoints(1, 3, true);
+
+ int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3]
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_point_count" qualifiers="const">
diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml
index 622d336ef6..1540d8dacc 100644
--- a/doc/classes/AStar2D.xml
+++ b/doc/classes/AStar2D.xml
@@ -44,10 +44,16 @@
</argument>
<description>
Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(1, 0), 4); // Adds the point (1, 0) with weight_scale 4 and id 1
+ [/csharp]
+ [/codeblocks]
If there already exists a point for the given [code]id[/code], its position and weight scale are updated to the given values.
</description>
</method>
@@ -80,12 +86,20 @@
</argument>
<description>
Creates a segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is allowed, not the reverse direction.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(1, 1))
astar.add_point(2, Vector2(0, 5))
astar.connect_points(1, 2, false)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(1, 1));
+ astar.AddPoint(2, new Vector2(0, 5));
+ astar.ConnectPoints(1, 2, false);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="disconnect_points">
@@ -125,13 +139,22 @@
</argument>
<description>
Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(0, 0))
astar.add_point(2, Vector2(0, 5))
astar.connect_points(1, 2)
var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(0, 0));
+ astar.AddPoint(2, new Vector2(0, 5));
+ astar.ConnectPoints(1, 2);
+ Vector2 res = astar.GetClosestPositionInSegment(new Vector2(3, 3)); // Returns (0, 3)
+ [/csharp]
+ [/codeblocks]
The result is in the segment that goes from [code]y = 0[/code] to [code]y = 5[/code]. It's the closest position in the segment to the given point.
</description>
</method>
@@ -144,7 +167,8 @@
</argument>
<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.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(0, 0))
astar.add_point(2, Vector2(0, 1), 1) # Default weight is 1
@@ -157,7 +181,21 @@
astar.connect_points(1, 4, false)
var res = astar.get_id_path(1, 3) # Returns [1, 2, 3]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(0, 0));
+ astar.AddPoint(2, new Vector2(0, 1), 1); // Default weight is 1
+ astar.AddPoint(3, new Vector2(1, 1));
+ astar.AddPoint(4, new Vector2(2, 0));
+
+ astar.ConnectPoints(1, 2, false);
+ 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]
+ [/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.
</description>
</method>
@@ -175,7 +213,8 @@
</argument>
<description>
Returns an array with the IDs of the points that form the connection with the given point.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var astar = AStar2D.new()
astar.add_point(1, Vector2(0, 0))
astar.add_point(2, Vector2(0, 1))
@@ -186,7 +225,20 @@
astar.connect_points(1, 3, true)
var neighbors = astar.get_point_connections(1) # Returns [2, 3]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var astar = new AStar2D();
+ astar.AddPoint(1, new Vector2(0, 0));
+ astar.AddPoint(2, new Vector2(0, 1));
+ astar.AddPoint(3, new Vector2(1, 1));
+ astar.AddPoint(4, new Vector2(2, 0));
+
+ astar.ConnectPoints(1, 2, true);
+ astar.ConnectPoints(1, 3, true);
+
+ int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3]
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_point_count" qualifiers="const">
diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml
index 6b1864b679..f4cf246713 100644
--- a/doc/classes/AcceptDialog.xml
+++ b/doc/classes/AcceptDialog.xml
@@ -23,7 +23,7 @@
If [code]true[/code], [code]right[/code] will place the button to the right of any sibling buttons.
</description>
</method>
- <method name="add_cancel">
+ <method name="add_cancel_button">
<return type="Button">
</return>
<argument index="0" name="name" type="String">
@@ -39,7 +39,7 @@
Returns the label used for built-in text.
</description>
</method>
- <method name="get_ok">
+ <method name="get_ok_button">
<return type="Button">
</return>
<description>
@@ -76,6 +76,7 @@
<signals>
<signal name="cancelled">
<description>
+ Emitted when the dialog is closed or the button created with [method add_cancel_button] is pressed.
</description>
</signal>
<signal name="confirmed">
diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml
index e23a4fe9f8..969e9cc85b 100644
--- a/doc/classes/AnimatedSprite2D.xml
+++ b/doc/classes/AnimatedSprite2D.xml
@@ -9,6 +9,7 @@
</description>
<tutorials>
<link title="2D Sprite animation">https://docs.godotengine.org/en/latest/tutorials/2d/2d_sprite_animation.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="is_playing" qualifiers="const">
@@ -62,12 +63,6 @@
<member name="playing" type="bool" setter="_set_playing" getter="_is_playing" default="false">
If [code]true[/code], the [member animation] is currently playing.
</member>
- <member name="shininess" type="float" setter="set_shininess" getter="get_shininess" default="1.0">
- Strength of the specular light effect of this [AnimatedSprite2D].
- </member>
- <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )">
- The color of the specular light effect.
- </member>
<member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
The animation speed is multiplied by this value.
</member>
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml
index 0a2925e6d5..3e33a879b3 100644
--- a/doc/classes/Animation.xml
+++ b/doc/classes/Animation.xml
@@ -5,7 +5,8 @@
</brief_description>
<description>
An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.
- [codeblock]
+ [codeblocks]
+ [gdscript]
# This creates an animation that makes the node "Enemy" move to the right by
# 100 pixels in 0.5 seconds.
var animation = Animation.new()
@@ -13,7 +14,17 @@
animation.track_set_path(track_index, "Enemy:position:x")
animation.track_insert_key(track_index, 0.0, 0)
animation.track_insert_key(track_index, 0.5, 100)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // This creates an animation that makes the node "Enemy" move to the right by
+ // 100 pixels in 0.5 seconds.
+ var animation = new Animation();
+ int trackIndex = animation.AddTrack(Animation.TrackType.Value);
+ animation.TrackSetPath(trackIndex, "Enemy:position:x");
+ animation.TrackInsertKey(trackIndex, 0.0f, 0);
+ animation.TrackInsertKey(trackIndex, 0.5f, 100);
+ [/csharp]
+ [/codeblocks]
Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check [enum TrackType] to see available types.
</description>
<tutorials>
@@ -503,15 +514,15 @@
Removes a key by index in a given track.
</description>
</method>
- <method name="track_remove_key_at_position">
+ <method name="track_remove_key_at_time">
<return type="void">
</return>
<argument index="0" name="track_idx" type="int">
</argument>
- <argument index="1" name="position" type="float">
+ <argument index="1" name="time" type="float">
</argument>
<description>
- Removes a key by position (seconds) in a given track.
+ Removes a key at [code]time[/code] in a given track.
</description>
</method>
<method name="track_set_enabled">
@@ -670,6 +681,17 @@
Returns the update mode of a value track.
</description>
</method>
+ <method name="value_track_interpolate" qualifiers="const">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="track_idx" type="int">
+ </argument>
+ <argument index="1" name="time_sec" type="float">
+ </argument>
+ <description>
+ Returns the interpolated value at the given time (in seconds). The [code]track_idx[/code] must be the index of a value track.
+ </description>
+ </method>
<method name="value_track_set_update_mode">
<return type="void">
</return>
diff --git a/doc/classes/AnimationNodeAdd3.xml b/doc/classes/AnimationNodeAdd3.xml
index 94a6ae4221..0e49ac7bbf 100644
--- a/doc/classes/AnimationNodeAdd3.xml
+++ b/doc/classes/AnimationNodeAdd3.xml
@@ -12,6 +12,7 @@
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml
index d8ac5413fd..3f0843c112 100644
--- a/doc/classes/AnimationNodeAnimation.xml
+++ b/doc/classes/AnimationNodeAnimation.xml
@@ -8,6 +8,8 @@
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeBlend2.xml b/doc/classes/AnimationNodeBlend2.xml
index e2cd12e685..e509a2df6c 100644
--- a/doc/classes/AnimationNodeBlend2.xml
+++ b/doc/classes/AnimationNodeBlend2.xml
@@ -8,6 +8,8 @@
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml
index 460c11cc5e..abbc8cb2e6 100644
--- a/doc/classes/AnimationNodeBlendSpace2D.xml
+++ b/doc/classes/AnimationNodeBlendSpace2D.xml
@@ -10,6 +10,7 @@
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="add_blend_point">
diff --git a/doc/classes/AnimationNodeOneShot.xml b/doc/classes/AnimationNodeOneShot.xml
index d5793e5839..65ab363e1f 100644
--- a/doc/classes/AnimationNodeOneShot.xml
+++ b/doc/classes/AnimationNodeOneShot.xml
@@ -8,6 +8,7 @@
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="get_mix_mode" qualifiers="const">
diff --git a/doc/classes/AnimationNodeOutput.xml b/doc/classes/AnimationNodeOutput.xml
index 7640f4dcfa..c4150d7e82 100644
--- a/doc/classes/AnimationNodeOutput.xml
+++ b/doc/classes/AnimationNodeOutput.xml
@@ -7,6 +7,8 @@
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeStateMachine.xml b/doc/classes/AnimationNodeStateMachine.xml
index 9ea83d2c5e..e08e288c59 100644
--- a/doc/classes/AnimationNodeStateMachine.xml
+++ b/doc/classes/AnimationNodeStateMachine.xml
@@ -6,10 +6,16 @@
<description>
Contains multiple nodes representing animation states, connected in a graph. Node 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]
- [codeblock]
+ [codeblocks]
+ [gdscript]
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var stateMachine = GetNode&lt;AnimationTree&gt;("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
+ stateMachine.Travel("some_state");
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
diff --git a/doc/classes/AnimationNodeStateMachinePlayback.xml b/doc/classes/AnimationNodeStateMachinePlayback.xml
index fec68d5b74..60ff425cdb 100644
--- a/doc/classes/AnimationNodeStateMachinePlayback.xml
+++ b/doc/classes/AnimationNodeStateMachinePlayback.xml
@@ -6,10 +6,16 @@
<description>
Allows control of [AnimationTree] state machines created with [AnimationNodeStateMachine]. Retrieve with [code]$AnimationTree.get("parameters/playback")[/code].
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var stateMachine = GetNode&lt;AnimationTree&gt;("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
+ stateMachine.Travel("some_state");
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml
index fe0154acad..2f0ebd7de6 100644
--- a/doc/classes/AnimationNodeStateMachineTransition.xml
+++ b/doc/classes/AnimationNodeStateMachineTransition.xml
@@ -12,9 +12,14 @@
<members>
<member name="advance_condition" type="StringName" setter="set_advance_condition" getter="get_advance_condition" default="@&quot;&quot;">
Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [AnimationTree] that can be controlled from code (see [url=https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#controlling-from-code][/url]). For example, if [member AnimationTree.tree_root] is an [AnimationNodeStateMachine] and [member advance_condition] is set to [code]"idle"[/code]:
- [codeblock]
- $animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0)
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0))
+ [/gdscript]
+ [csharp]
+ GetNode&lt;AnimationTree&gt;("animation_tree").Set("parameters/conditions/idle", IsOnFloor &amp;&amp; (LinearVelocity.x == 0));
+ [/csharp]
+ [/codeblocks]
</member>
<member name="auto_advance" type="bool" setter="set_auto_advance" getter="has_auto_advance" default="false">
Turn on the transition automatically when this state is reached. This works best with [constant SWITCH_MODE_AT_END].
diff --git a/doc/classes/AnimationNodeTimeScale.xml b/doc/classes/AnimationNodeTimeScale.xml
index 334fdb0b95..2ce8309418 100644
--- a/doc/classes/AnimationNodeTimeScale.xml
+++ b/doc/classes/AnimationNodeTimeScale.xml
@@ -8,6 +8,7 @@
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml
index 8338f0d39a..73c7006768 100644
--- a/doc/classes/AnimationNodeTransition.xml
+++ b/doc/classes/AnimationNodeTransition.xml
@@ -8,6 +8,8 @@
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="get_input_caption" qualifiers="const">
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml
index 8396cdb6cf..bebff61671 100644
--- a/doc/classes/AnimationPlayer.xml
+++ b/doc/classes/AnimationPlayer.xml
@@ -9,9 +9,9 @@
Updating the target properties of animations occurs at process time.
</description>
<tutorials>
- <link title="Animations">https://docs.godotengine.org/en/latest/getting_started/step_by_step/animations.html</link>
<link title="2D Sprite animation">https://docs.godotengine.org/en/latest/tutorials/2d/2d_sprite_animation.html</link>
<link title="Animation tutorial index">https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="add_animation">
@@ -260,6 +260,10 @@
<member name="playback_speed" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
The speed scaling ratio. For instance, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed.
</member>
+ <member name="reset_on_save" type="bool" setter="set_reset_on_save_enabled" getter="is_reset_on_save_enabled" default="true">
+ This is used by the editor. If set to [code]true[/code], the scene will be saved with the effects of the reset animation applied (as if it had been seeked to time 0), then reverted after saving.
+ In other words, the saved scene file will contain the "default pose", as defined by the reset animation, if any, with the editor keeping the values that the nodes had before saving.
+ </member>
<member name="root_node" type="NodePath" setter="set_root" getter="get_root" default="NodePath(&quot;..&quot;)">
The node from which node path references will travel.
</member>
diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml
index cc8e83f509..262b5addb7 100644
--- a/doc/classes/AnimationTree.xml
+++ b/doc/classes/AnimationTree.xml
@@ -8,7 +8,7 @@
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
- <link title="Third-person shooter demo code repository">https://github.com/godotengine/tps-demo</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="advance">
diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml
index e98c0af0d9..72c40478bb 100644
--- a/doc/classes/Area2D.xml
+++ b/doc/classes/Area2D.xml
@@ -8,6 +8,9 @@
</description>
<tutorials>
<link title="Using Area2D">https://docs.godotengine.org/en/latest/tutorials/physics/using_area_2d.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
</tutorials>
<methods>
<method name="get_collision_layer_bit" qualifiers="const">
@@ -88,7 +91,8 @@
</methods>
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="1.0">
- The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
+ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
+ See [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping.
</member>
<member name="audio_bus_name" type="StringName" setter="set_audio_bus_name" getter="get_audio_bus_name" default="@&quot;Master&quot;">
The name of the area's audio bus.
@@ -115,7 +119,8 @@
The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction.
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.1">
- The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
+ The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
+ See [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping.
</member>
<member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" default="true">
If [code]true[/code], other monitoring areas can detect this area.
diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml
index ad9eff3a64..2f8042bb1e 100644
--- a/doc/classes/Area3D.xml
+++ b/doc/classes/Area3D.xml
@@ -7,6 +7,8 @@
3D area that detects [CollisionObject3D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
</description>
<tutorials>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
</tutorials>
<methods>
<method name="get_collision_layer_bit" qualifiers="const">
@@ -87,9 +89,10 @@
</methods>
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="0.1">
- The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
+ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
+ See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping.
</member>
- <member name="audio_bus_name" type="StringName" setter="set_audio_bus" getter="get_audio_bus" default="@&quot;Master&quot;">
+ <member name="audio_bus_name" type="StringName" setter="set_audio_bus_name" getter="get_audio_bus_name" default="@&quot;Master&quot;">
The name of the area's audio bus.
</member>
<member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" default="false">
@@ -114,7 +117,8 @@
The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction.
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.1">
- The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
+ The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
+ See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping.
</member>
<member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" default="true">
If [code]true[/code], other monitoring areas can detect this area.
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index 20579e0159..6a9eb89602 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -6,62 +6,89 @@
<description>
Generic array which can contain several elements of any type, accessible by a numerical index starting at 0. Negative indices can be used to count from the back, like in Python (-1 is the last element, -2 the second to last, etc.).
[b]Example:[/b]
- [codeblock]
+ [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.
- [/codeblock]
+ [/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:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var array1 = ["One", 2]
var array2 = [3, "Four"]
print(array1 + array2) # ["One", 2, 3, "Four"]
- [/codeblock]
+ [/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]
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] Concatenating with the [code]+=[/code] operator will create a new array, which has a cost. If you want to append another array to an existing array, [method append_array] is more efficient.
[b]Note:[/b] Arrays are always passed by reference. To get a copy of an array which can be modified independently of the original array, use [method duplicate].
+ [b]Note:[/b] When declaring an array with [code]const[/code], the array itself can still be mutated by defining the values at individual indices or pushing/removing elements. Using [code]const[/code] will only prevent assigning the constant with another value after it was initialized.
</description>
<tutorials>
</tutorials>
<methods>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedColorArray">
+ <description>
+ Constructs an empty [Array].
+ </description>
+ </method>
+ <method name="Array" qualifiers="constructor">
+ <return type="Array">
+ </return>
+ <argument index="0" name="from" type="Array">
</argument>
<description>
- Constructs an array from a [PackedColorArray].
+ Constructs an [Array] as a copy of the given [Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedVector3Array">
+ <argument index="0" name="from" type="PackedByteArray">
</argument>
<description>
- Constructs an array from a [PackedVector3Array].
+ Constructs an array from a [PackedByteArray].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedVector2Array">
+ <argument index="0" name="from" type="PackedColorArray">
</argument>
<description>
- Constructs an array from a [PackedVector2Array].
+ Constructs an array from a [PackedColorArray].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedStringArray">
+ <argument index="0" name="from" type="PackedFloat32Array">
</argument>
<description>
- Constructs an array from a [PackedStringArray].
+ Constructs an array from a [PackedFloat32Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
<argument index="0" name="from" type="PackedFloat64Array">
@@ -70,16 +97,16 @@
Constructs an array from a [PackedFloat64Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedFloat32Array">
+ <argument index="0" name="from" type="PackedInt32Array">
</argument>
<description>
- Constructs an array from a [PackedFloat32Array].
+ Constructs an array from a [PackedInt32Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
<argument index="0" name="from" type="PackedInt64Array">
@@ -88,22 +115,31 @@
Constructs an array from a [PackedInt64Array].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedInt32Array">
+ <argument index="0" name="from" type="PackedStringArray">
</argument>
<description>
- Constructs an array from a [PackedInt32Array].
+ Constructs an array from a [PackedStringArray].
</description>
</method>
- <method name="Array">
+ <method name="Array" qualifiers="constructor">
<return type="Array">
</return>
- <argument index="0" name="from" type="PackedByteArray">
+ <argument index="0" name="from" type="PackedVector2Array">
</argument>
<description>
- Constructs an array from a [PackedByteArray].
+ Constructs an array from a [PackedVector2Array].
+ </description>
+ </method>
+ <method name="Array" qualifiers="constructor">
+ <return type="Array">
+ </return>
+ <argument index="0" name="from" type="PackedVector3Array">
+ </argument>
+ <description>
+ Constructs an array from a [PackedVector3Array].
</description>
</method>
<method name="append">
@@ -115,6 +151,21 @@
Appends an element at the end of the array (alias of [method push_back]).
</description>
</method>
+ <method name="append_array">
+ <return type="void">
+ </return>
+ <argument index="0" name="array" type="Array">
+ </argument>
+ <description>
+ Appends another 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].
+ [/codeblock]
+ </description>
+ </method>
<method name="back">
<return type="Variant">
</return>
@@ -142,7 +193,7 @@
</argument>
<argument index="1" name="obj" type="Object">
</argument>
- <argument index="2" name="func" type="String">
+ <argument index="2" name="func" type="StringName">
</argument>
<argument index="3" name="before" type="bool" default="true">
</argument>
@@ -228,18 +279,39 @@
</argument>
<description>
Returns [code]true[/code] if the array contains the given value.
- [codeblock]
+ [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
- [/codeblock]
+ [/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:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Will evaluate to `true`.
if 2 in [2, 4, 6, 8]:
- pass
- [/codeblock]
+ print("Containes!")
+ [/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("Containes!");
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="hash">
@@ -281,6 +353,70 @@
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.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Array">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="void">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="pop_back">
<return type="Variant">
</return>
@@ -292,7 +428,7 @@
<return type="Variant">
</return>
<description>
- Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty, wwithout printing an error message.
+ Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty, without printing an error message.
</description>
</method>
<method name="push_back">
@@ -323,7 +459,7 @@
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
<argument index="0" name="size" type="int">
</argument>
@@ -377,11 +513,16 @@
<description>
Sorts the array.
[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:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var strings = ["string1", "string2", "string10", "string11"]
strings.sort()
print(strings) # Prints [string1, string10, string11, string2]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // There is no sort support for Godot.Collections.Array
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="sort_custom">
@@ -389,12 +530,13 @@
</return>
<argument index="0" name="obj" type="Object">
</argument>
- <argument index="1" name="func" type="String">
+ <argument index="1" name="func" type="StringName">
</argument>
<description>
Sorts the array using a custom method. The arguments are an object that holds the method and the name of such 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].
[b]Note:[/b] you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior.
- [codeblock]
+ [codeblocks]
+ [gdscript]
class MyCustomSorter:
static func sort_ascending(a, b):
if a[0] &lt; b[0]:
@@ -404,7 +546,11 @@
var my_items = [[5, "Potato"], [9, "Rice"], [4, "Tomato"]]
my_items.sort_custom(MyCustomSorter, "sort_ascending")
print(my_items) # Prints [[4, Tomato], [5, Potato], [9, Rice]].
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // There is no custom sort support for Godot.Collections.Array
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index 4ec39ecc2f..ef33d7ea77 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -6,21 +6,42 @@
<description>
The [ArrayMesh] is used to construct a [Mesh] by specifying the attributes as arrays.
The most basic example is the creation of a single triangle:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var vertices = PackedVector3Array()
vertices.push_back(Vector3(0, 1, 0))
vertices.push_back(Vector3(1, 0, 0))
vertices.push_back(Vector3(0, 0, 1))
+
# Initialize the ArrayMesh.
var arr_mesh = ArrayMesh.new()
var arrays = []
- arrays.resize(ArrayMesh.ARRAY_MAX)
- arrays[ArrayMesh.ARRAY_VERTEX] = vertices
+ arrays.resize(Mesh.ARRAY_MAX)
+ arrays[Mesh.ARRAY_VERTEX] = vertices
+
# Create the Mesh.
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
var m = MeshInstance3D.new()
m.mesh = arr_mesh
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var vertices = new Godot.Collections.Array&lt;Vector3&gt;();
+ vertices.Add(new Vector3(0, 1, 0));
+ vertices.Add(new Vector3(1, 0, 0));
+ vertices.Add(new Vector3(0, 0, 1));
+
+ // Initialize the ArrayMesh.
+ var arrMesh = new ArrayMesh();
+ var arrays = new Godot.Collections.Array();
+ arrays.Resize((int)Mesh.ArrayType.Max);
+ arrays[(int)Mesh.ArrayType.Vertex] = vertices;
+
+ // Create the Mesh.
+ arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays);
+ var m = new MeshInstance();
+ m.Mesh = arrMesh;
+ [/csharp]
+ [/codeblocks]
The [MeshInstance3D] is ready to be added to the [SceneTree] to be shown.
See also [ImmediateGeometry3D], [MeshDataTool] and [SurfaceTool] for procedural geometry generation.
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
@@ -48,15 +69,14 @@
<argument index="2" name="blend_shapes" type="Array" default="[ ]">
</argument>
<argument index="3" name="lods" type="Dictionary" default="{
-
}">
</argument>
- <argument index="4" name="compress_flags" type="int" default="31744">
+ <argument index="4" name="compress_flags" type="int" default="0">
</argument>
<description>
Creates a new surface.
Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
- The [code]arrays[/code] argument is an array of arrays. See [enum ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant ARRAY_INDEX] if it is used.
+ The [code]arrays[/code] argument is an array of arrays. See [enum Mesh.ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant Mesh.ARRAY_INDEX] if it is used.
Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices.
</description>
</method>
@@ -189,77 +209,19 @@
</method>
</methods>
<members>
- <member name="blend_shape_mode" type="int" setter="set_blend_shape_mode" getter="get_blend_shape_mode" enum="Mesh.BlendShapeMode" default="1">
- Sets the blend shape mode to one of [enum Mesh.BlendShapeMode].
+ <member name="blend_shape_mode" type="int" setter="set_blend_shape_mode" getter="get_blend_shape_mode" enum="ArrayMesh.BlendShapeMode" default="1">
+ Sets the blend shape mode to one of [enum ArrayMesh.BlendShapeMode].
</member>
<member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB( 0, 0, 0, 0, 0, 0 )">
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>
</members>
<constants>
- <constant name="NO_INDEX_ARRAY" value="-1">
- Default value used for index_array_len when no indices are present.
- </constant>
- <constant name="ARRAY_WEIGHTS_SIZE" value="4">
- Amount of weights/bone indices per vertex (always 4).
- </constant>
- <constant name="ARRAY_VERTEX" value="0" enum="ArrayType">
- [PackedVector3Array], [PackedVector2Array], or [Array] of vertex positions.
- </constant>
- <constant name="ARRAY_NORMAL" value="1" enum="ArrayType">
- [PackedVector3Array] of vertex normals.
- </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.
- </constant>
- <constant name="ARRAY_COLOR" value="3" enum="ArrayType">
- [PackedColorArray] of vertex colors.
- </constant>
- <constant name="ARRAY_TEX_UV" value="4" enum="ArrayType">
- [PackedVector2Array] for UV coordinates.
- </constant>
- <constant name="ARRAY_TEX_UV2" value="5" enum="ArrayType">
- [PackedVector2Array] for second UV coordinates.
- </constant>
- <constant name="ARRAY_BONES" value="6" enum="ArrayType">
- [PackedFloat32Array] or [PackedInt32Array] of bone indices. Each element in groups of 4 floats.
- </constant>
- <constant name="ARRAY_WEIGHTS" value="7" enum="ArrayType">
- [PackedFloat32Array] of bone weights. Each element in groups of 4 floats.
- </constant>
- <constant name="ARRAY_INDEX" value="8" enum="ArrayType">
- [PackedInt32Array] of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices.
- For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line.
- </constant>
- <constant name="ARRAY_MAX" value="9" enum="ArrayType">
- Represents the size of the [enum ArrayType] enum.
- </constant>
- <constant name="ARRAY_FORMAT_VERTEX" value="1" enum="ArrayFormat">
- Array format will include vertices (mandatory).
- </constant>
- <constant name="ARRAY_FORMAT_NORMAL" value="2" enum="ArrayFormat">
- Array format will include normals.
- </constant>
- <constant name="ARRAY_FORMAT_TANGENT" value="4" enum="ArrayFormat">
- Array format will include tangents.
- </constant>
- <constant name="ARRAY_FORMAT_COLOR" value="8" enum="ArrayFormat">
- Array format will include a color array.
- </constant>
- <constant name="ARRAY_FORMAT_TEX_UV" value="16" enum="ArrayFormat">
- Array format will include UVs.
- </constant>
- <constant name="ARRAY_FORMAT_TEX_UV2" value="32" enum="ArrayFormat">
- Array format will include another set of UVs.
- </constant>
- <constant name="ARRAY_FORMAT_BONES" value="64" enum="ArrayFormat">
- Array format will include bone indices.
- </constant>
- <constant name="ARRAY_FORMAT_WEIGHTS" value="128" enum="ArrayFormat">
- Array format will include bone weights.
+ <constant name="BLEND_SHAPE_MODE_NORMALIZED" value="0" enum="BlendShapeMode">
+ Blend shapes are normalized.
</constant>
- <constant name="ARRAY_FORMAT_INDEX" value="256" enum="ArrayFormat">
- Index array will be used.
+ <constant name="BLEND_SHAPE_MODE_RELATIVE" value="1" enum="BlendShapeMode">
+ Blend shapes are relative to base weight.
</constant>
</constants>
</class>
diff --git a/doc/classes/AspectRatioContainer.xml b/doc/classes/AspectRatioContainer.xml
new file mode 100644
index 0000000000..7b41133139
--- /dev/null
+++ b/doc/classes/AspectRatioContainer.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="AspectRatioContainer" inherits="Container" version="4.0">
+ <brief_description>
+ Container that preserves its child controls' aspect ratio.
+ </brief_description>
+ <description>
+ Arranges child controls in a way to preserve their aspect ratio automatically whenever the container is resized. Solves the problem where the container size is dynamic and the contents' size needs to adjust accordingly without losing proportions.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="alignment_horizontal" type="int" setter="set_alignment_horizontal" getter="get_alignment_horizontal" enum="AspectRatioContainer.AlignMode" default="1">
+ Specifies the horizontal relative position of child controls.
+ </member>
+ <member name="alignment_vertical" type="int" setter="set_alignment_vertical" getter="get_alignment_vertical" enum="AspectRatioContainer.AlignMode" default="1">
+ Specifies the vertical relative position of child controls.
+ </member>
+ <member name="ratio" type="float" setter="set_ratio" getter="get_ratio" default="1.0">
+ The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the [member stretch_mode].
+ </member>
+ <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="AspectRatioContainer.StretchMode" default="2">
+ The stretch mode used to align child controls.
+ </member>
+ </members>
+ <constants>
+ <constant name="STRETCH_WIDTH_CONTROLS_HEIGHT" value="0" enum="StretchMode">
+ The height of child controls is automatically adjusted based on the width of the container.
+ </constant>
+ <constant name="STRETCH_HEIGHT_CONTROLS_WIDTH" value="1" enum="StretchMode">
+ The width of child controls is automatically adjusted based on the height of the container.
+ </constant>
+ <constant name="STRETCH_FIT" value="2" enum="StretchMode">
+ The bounding rectangle of child controls is automatically adjusted to fit inside the container while keeping the aspect ratio.
+ </constant>
+ <constant name="STRETCH_COVER" value="3" enum="StretchMode">
+ The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio.
+ When the bounding rectangle of child controls exceed the container's size and [member Control.rect_clip_content] is enabled, this allows to show only the container's area restricted by its own bounding rectangle.
+ </constant>
+ <constant name="ALIGN_BEGIN" value="0" enum="AlignMode">
+ Aligns child controls with the beginning (left or top) of the container.
+ </constant>
+ <constant name="ALIGN_CENTER" value="1" enum="AlignMode">
+ Aligns child controls with the center of the container.
+ </constant>
+ <constant name="ALIGN_END" value="2" enum="AlignMode">
+ Aligns child controls with the end (right or bottom) of the container.
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/AudioEffect.xml b/doc/classes/AudioEffect.xml
index 60bf15ce57..955285bd2e 100644
--- a/doc/classes/AudioEffect.xml
+++ b/doc/classes/AudioEffect.xml
@@ -7,6 +7,7 @@
Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on.
</description>
<tutorials>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioEffectHighShelfFilter.xml b/doc/classes/AudioEffectHighShelfFilter.xml
index cf620e4417..4ba31f9fc8 100644
--- a/doc/classes/AudioEffectHighShelfFilter.xml
+++ b/doc/classes/AudioEffectHighShelfFilter.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectHighShelfFilter" inherits="AudioEffectFilter" version="4.0">
<brief_description>
+ Reduces all frequencies above the [member AudioEffectFilter.cutoff_hz].
</brief_description>
<description>
</description>
<tutorials>
+ <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioEffectLowShelfFilter.xml b/doc/classes/AudioEffectLowShelfFilter.xml
index 7cf09b0f05..078e7bf1a1 100644
--- a/doc/classes/AudioEffectLowShelfFilter.xml
+++ b/doc/classes/AudioEffectLowShelfFilter.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectLowShelfFilter" inherits="AudioEffectFilter" version="4.0">
<brief_description>
+ Reduces all frequencies below the [member AudioEffectFilter.cutoff_hz].
</brief_description>
<description>
</description>
<tutorials>
+ <link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioEffectRecord.xml b/doc/classes/AudioEffectRecord.xml
index 6617d16290..872ddf3b0f 100644
--- a/doc/classes/AudioEffectRecord.xml
+++ b/doc/classes/AudioEffectRecord.xml
@@ -8,6 +8,7 @@
</description>
<tutorials>
<link title="Recording with microphone">https://docs.godotengine.org/en/latest/tutorials/audio/recording_with_microphone.html</link>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
</tutorials>
<methods>
<method name="get_recording" qualifiers="const">
diff --git a/doc/classes/AudioEffectReverb.xml b/doc/classes/AudioEffectReverb.xml
index 26eb2be753..fbe68cde0e 100644
--- a/doc/classes/AudioEffectReverb.xml
+++ b/doc/classes/AudioEffectReverb.xml
@@ -8,6 +8,7 @@
Simulates rooms of different sizes. Its parameters can be adjusted to simulate the sound of a specific room.
</description>
<tutorials>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml
index d5fd5d8f00..dafc0065f6 100644
--- a/doc/classes/AudioServer.xml
+++ b/doc/classes/AudioServer.xml
@@ -8,6 +8,9 @@
</description>
<tutorials>
<link title="Audio buses">https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
+ <link title="Audio Device Changer Demo">https://godotengine.org/asset-library/asset/525</link>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
+ <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
</tutorials>
<methods>
<method name="add_bus">
diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml
index 58768dc008..bbfec579bb 100644
--- a/doc/classes/AudioStream.xml
+++ b/doc/classes/AudioStream.xml
@@ -8,6 +8,9 @@
</description>
<tutorials>
<link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
+ <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
+ <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
</tutorials>
<methods>
<method name="get_length" qualifiers="const">
diff --git a/doc/classes/AudioStreamGenerator.xml b/doc/classes/AudioStreamGenerator.xml
index 51254f9305..a273beb5af 100644
--- a/doc/classes/AudioStreamGenerator.xml
+++ b/doc/classes/AudioStreamGenerator.xml
@@ -5,7 +5,7 @@
<description>
</description>
<tutorials>
- <link title="Audio generator demo project">https://github.com/godotengine/godot-demo-projects/tree/master/audio/generator</link>
+ <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioStreamPlayback.xml b/doc/classes/AudioStreamPlayback.xml
index f928d54526..da75ff206c 100644
--- a/doc/classes/AudioStreamPlayback.xml
+++ b/doc/classes/AudioStreamPlayback.xml
@@ -7,6 +7,7 @@
Can play, loop, pause a scroll through audio. See [AudioStream] and [AudioStreamOGGVorbis] for usage.
</description>
<tutorials>
+ <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml
index 86048ca8c1..55190c5f9f 100644
--- a/doc/classes/AudioStreamPlayer.xml
+++ b/doc/classes/AudioStreamPlayer.xml
@@ -8,6 +8,11 @@
</description>
<tutorials>
<link title="Audio streams">https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="Audio Device Changer Demo">https://godotengine.org/asset-library/asset/525</link>
+ <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
+ <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
+ <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
</tutorials>
<methods>
<method name="get_playback_position">
diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml
index aadbc865bb..7a8c4b2cc7 100644
--- a/doc/classes/AudioStreamPlayer3D.xml
+++ b/doc/classes/AudioStreamPlayer3D.xml
@@ -4,7 +4,7 @@
Plays 3D sound in 3D space.
</brief_description>
<description>
- Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space.
+ Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. For greater realism, a low-pass filter is automatically applied to distant sounds. This can be disabled by setting [member attenuation_filter_cutoff_hz] to [code]20500[/code].
By default, audio is heard from the camera position. This can be changed by adding a [Listener3D] node to the scene and enabling it by calling [method Listener3D.make_current] on it.
</description>
<tutorials>
@@ -56,19 +56,19 @@
Areas in which this sound plays.
</member>
<member name="attenuation_filter_cutoff_hz" type="float" setter="set_attenuation_filter_cutoff_hz" getter="get_attenuation_filter_cutoff_hz" default="5000.0">
- Dampens audio above this frequency, in Hz.
+ Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to [code]20500[/code] as this frequency is above the human hearing limit.
</member>
<member name="attenuation_filter_db" type="float" setter="set_attenuation_filter_db" getter="get_attenuation_filter_db" default="-24.0">
- Amount how much the filter affects the loudness, in dB.
+ Amount how much the filter affects the loudness, in decibels.
</member>
<member name="attenuation_model" type="int" setter="set_attenuation_model" getter="get_attenuation_model" enum="AudioStreamPlayer3D.AttenuationModel" default="0">
Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
</member>
<member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" default="false">
- If [code]true[/code], audio plays when added to scene tree.
+ If [code]true[/code], audio plays when the AudioStreamPlayer3D node is added to scene tree.
</member>
<member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="@&quot;Master&quot;">
- Bus on which this audio is playing.
+ The bus on which this audio is playing.
</member>
<member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="AudioStreamPlayer3D.DopplerTracking" default="0">
Decides in which step the Doppler effect should be calculated.
@@ -80,10 +80,10 @@
If [code]true[/code], the audio should be dampened according to the direction of the sound.
</member>
<member name="emission_angle_filter_attenuation_db" type="float" setter="set_emission_angle_filter_attenuation_db" getter="get_emission_angle_filter_attenuation_db" default="-12.0">
- Dampens audio if camera is outside of [member emission_angle_degrees] and [member emission_angle_enabled] is set by this factor, in dB.
+ Dampens audio if camera is outside of [member emission_angle_degrees] and [member emission_angle_enabled] is set by this factor, in decibels.
</member>
<member name="max_db" type="float" setter="set_max_db" getter="get_max_db" default="3.0">
- Sets the absolute maximum of the soundlevel, in dB.
+ Sets the absolute maximum of the soundlevel, in decibels.
</member>
<member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="0.0">
Sets the distance from which the [member out_of_range_mode] takes effect. Has no effect if set to 0.
@@ -98,16 +98,16 @@
If [code]true[/code], audio is playing.
</member>
<member name="stream" type="AudioStream" setter="set_stream" getter="get_stream">
- The [AudioStream] object to be played.
+ The [AudioStream] resource to be played.
</member>
<member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused" default="false">
- If [code]true[/code], the playback is paused. You can resume it by setting [code]stream_paused[/code] to [code]false[/code].
+ If [code]true[/code], the playback is paused. You can resume it by setting [member stream_paused] to [code]false[/code].
</member>
<member name="unit_db" type="float" setter="set_unit_db" getter="get_unit_db" default="0.0">
- Base sound level unaffected by dampening, in dB.
+ The base sound level unaffected by dampening, in decibels.
</member>
<member name="unit_size" type="float" setter="set_unit_size" getter="get_unit_size" default="1.0">
- Factor for the attenuation effect.
+ The factor for the attenuation effect. Higher values make the sound audible over a larger distance.
</member>
</members>
<signals>
@@ -128,13 +128,13 @@
Logarithmic dampening of loudness according to distance.
</constant>
<constant name="ATTENUATION_DISABLED" value="3" enum="AttenuationModel">
- No dampening of loudness according to distance.
+ No dampening of loudness according to distance. The sound will still be heard positionally, unlike an [AudioStreamPlayer].
</constant>
<constant name="OUT_OF_RANGE_MIX" value="0" enum="OutOfRangeMode">
- Mix this audio in, even when it's out of range.
+ Mix this audio in, even when it's out of range. This increases CPU usage, but keeps the sound playing at the correct position if the camera leaves and enters the [AudioStreamPlayer3D]'s [member max_distance] radius.
</constant>
<constant name="OUT_OF_RANGE_PAUSE" value="1" enum="OutOfRangeMode">
- Pause this audio when it gets out of range.
+ Pause this audio when it gets out of range. This decreases CPU usage, but will cause the sound to restart if the camera leaves and enters the [AudioStreamPlayer3D]'s [member max_distance] radius.
</constant>
<constant name="DOPPLER_TRACKING_DISABLED" value="0" enum="DopplerTracking">
Disables doppler tracking.
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml
index bf4d9383ac..45ef4cb14c 100644
--- a/doc/classes/BaseButton.xml
+++ b/doc/classes/BaseButton.xml
@@ -44,6 +44,9 @@
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="BaseButton.ActionMode" default="1">
Determines when the button is considered clicked, one of the [enum ActionMode] constants.
</member>
+ <member name="button_group" type="ButtonGroup" setter="set_button_group" getter="get_button_group">
+ The [ButtonGroup] associated with the button. Not to be confused with node groups.
+ </member>
<member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" default="1">
Binary mask to choose which mouse buttons this button will respond to.
To allow both left-click and right-click, use [code]BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT[/code].
@@ -51,13 +54,7 @@
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false">
If [code]true[/code], the button is in disabled state and can't be clicked or toggled.
</member>
- <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" enum="Control.FocusMode" default="2">
- Focus access mode to use when switching between enabled/disabled (see [member Control.focus_mode] and [member disabled]).
- </member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" />
- <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group">
- [ButtonGroup] associated to the button.
- </member>
<member name="keep_pressed_outside" type="bool" setter="set_keep_pressed_outside" getter="is_keep_pressed_outside" default="false">
If [code]true[/code], the button stays pressed when moving the cursor outside the button while pressing it.
[b]Note:[/b] This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value.
@@ -68,6 +65,9 @@
<member name="shortcut" type="Shortcut" setter="set_shortcut" getter="get_shortcut">
[Shortcut] associated to the button.
</member>
+ <member name="shortcut_context" type="Node" setter="set_shortcut_context" getter="get_shortcut_context">
+ The [Node] which must be a parent of the focused GUI [Control] for the shortcut to be activated. If [code]null[/code], the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused.
+ </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.
</member>
diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml
index 0cb0b7e57e..31e6ea5e54 100644
--- a/doc/classes/BaseMaterial3D.xml
+++ b/doc/classes/BaseMaterial3D.xml
@@ -81,6 +81,15 @@
<member name="albedo_texture" type="Texture2D" setter="set_texture" getter="get_texture">
Texture to multiply by [member albedo_color]. Used for basic texturing of objects.
</member>
+ <member name="alpha_antialiasing_edge" type="float" setter="set_alpha_antialiasing_edge" getter="get_alpha_antialiasing_edge">
+ Threshold at which antialiasing will by applied on the alpha channel.
+ </member>
+ <member name="alpha_antialiasing_mode" type="int" setter="set_alpha_antialiasing" getter="get_alpha_antialiasing" enum="BaseMaterial3D.AlphaAntiAliasing">
+ The type of alpha antialiasing to apply. See [enum AlphaAntiAliasing].
+ </member>
+ <member name="alpha_hash_scale" type="float" setter="set_alpha_hash_scale" getter="get_alpha_hash_scale">
+ The hashing scale for Alpha Hash. Recommended values between [code]0[/code] and [code]2[/code].
+ </member>
<member name="alpha_scissor_threshold" type="float" setter="set_alpha_scissor_threshold" getter="get_alpha_scissor_threshold">
Threshold at which the alpha scissor will discard values.
</member>
@@ -122,6 +131,7 @@
</member>
<member name="billboard_mode" type="int" setter="set_billboard_mode" getter="get_billboard_mode" enum="BaseMaterial3D.BillboardMode" default="0">
Controls how the object faces the camera. See [enum BillboardMode].
+ [b]Note:[/b] Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See [url=https://github.com/godotengine/godot/issues/41567]GitHub issue #41567[/url] for details.
</member>
<member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="BaseMaterial3D.BlendMode" default="0">
The material's blend mode.
@@ -174,10 +184,12 @@
If [code]true[/code], the object receives no shadow that would otherwise be cast onto it.
</member>
<member name="distance_fade_max_distance" type="float" setter="set_distance_fade_max_distance" getter="get_distance_fade_max_distance">
- Distance at which the object fades fully and is no longer visible.
+ Distance at which the object appears fully opaque.
+ [b]Note:[/b] If [code]distance_fade_max_distance[/code] is less than [code]distance_fade_min_distance[/code], the behavior will be reversed. The object will start to fade away at [code]distance_fade_max_distance[/code] and will fully disappear once it reaches [code]distance_fade_min_distance[/code].
</member>
<member name="distance_fade_min_distance" type="float" setter="set_distance_fade_min_distance" getter="get_distance_fade_min_distance">
- Distance at which the object starts to fade. If the object is less than this distance away it will appear normal.
+ Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible.
+ [b]Note:[/b] If [code]distance_fade_min_distance[/code] is greater than [code]distance_fade_max_distance[/code], the behavior will be reversed. The object will start to fade away at [code]distance_fade_max_distance[/code] and will fully disappear once it reaches [code]distance_fade_min_distance[/code].
</member>
<member name="distance_fade_mode" type="int" setter="set_distance_fade" getter="get_distance_fade" enum="BaseMaterial3D.DistanceFadeMode" default="0">
Specifies which type of fade to use. Can be any of the [enum DistanceFadeMode]s.
@@ -483,10 +495,13 @@
<constant name="TRANSPARENCY_ALPHA_SCISSOR" value="2" enum="Transparency">
The material will cut off all values below a threshold, the rest will remain opaque.
</constant>
- <constant name="TRANSPARENCY_ALPHA_DEPTH_PRE_PASS" value="3" enum="Transparency">
+ <constant name="TRANSPARENCY_ALPHA_HASH" value="3" enum="Transparency">
+ The material will cut off all values below a spatially-deterministic threshold, the rest will remain opaque.
+ </constant>
+ <constant name="TRANSPARENCY_ALPHA_DEPTH_PRE_PASS" value="4" enum="Transparency">
The material will use the texture's alpha value for transparency, but will still be rendered in the pre-pass.
</constant>
- <constant name="TRANSPARENCY_MAX" value="4" enum="Transparency">
+ <constant name="TRANSPARENCY_MAX" value="5" enum="Transparency">
Represents the size of the [enum Transparency] enum.
</constant>
<constant name="SHADING_MODE_UNSHADED" value="0" enum="ShadingMode">
@@ -552,6 +567,15 @@
<constant name="BLEND_MODE_MUL" value="3" enum="BlendMode">
The color of the object is multiplied by the background.
</constant>
+ <constant name="ALPHA_ANTIALIASING_OFF" value="0" enum="AlphaAntiAliasing">
+ Disables Alpha AntiAliasing for the material.
+ </constant>
+ <constant name="ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE" value="1" enum="AlphaAntiAliasing">
+ Enables AlphaToCoverage. Alpha values in the material are passed to the AntiAliasing sample mask.
+ </constant>
+ <constant name="ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE" value="2" enum="AlphaAntiAliasing">
+ Enables AlphaToCoverage and forces all non-zero alpha values to [code]1[/code]. Alpha values in the material are passed to the AntiAliasing sample mask.
+ </constant>
<constant name="DEPTH_DRAW_OPAQUE_ONLY" value="0" enum="DepthDrawMode">
Default depth draw mode. Depth is drawn only for opaque objects.
</constant>
diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml
index c614a281ae..4c9cd5702e 100644
--- a/doc/classes/Basis.xml
+++ b/doc/classes/Basis.xml
@@ -10,30 +10,32 @@
For more information, read the "Matrices and transforms" documentation article.
</description>
<tutorials>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
<link title="Matrices and transforms">https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link>
<link title="Using 3D transforms">https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
+ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link>
</tutorials>
<methods>
- <method name="Basis">
+ <method name="Basis" qualifiers="constructor">
<return type="Basis">
</return>
- <argument index="0" name="from" type="Quat">
- </argument>
<description>
- Constructs a pure rotation basis matrix from the given quaternion.
+ Constructs a default-initialized [Basis] set to [constant IDENTITY].
</description>
</method>
- <method name="Basis">
+ <method name="Basis" qualifiers="constructor">
<return type="Basis">
</return>
- <argument index="0" name="from" type="Vector3">
+ <argument index="0" name="from" type="Basis">
</argument>
<description>
- Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when *composing*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle).
- Consider using the [Quat] constructor instead, which uses a quaternion instead of Euler angles.
+ Constructs a [Basis] as a copy of the given [Basis].
</description>
</method>
- <method name="Basis">
+ <method name="Basis" qualifiers="constructor">
<return type="Basis">
</return>
<argument index="0" name="axis" type="Vector3">
@@ -44,7 +46,26 @@
Constructs a pure rotation basis matrix, rotated around the given [code]axis[/code] by [code]phi[/code], in radians. The axis must be a normalized vector.
</description>
</method>
- <method name="Basis">
+ <method name="Basis" qualifiers="constructor">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="euler" type="Vector3">
+ </argument>
+ <description>
+ Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when *composing*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle).
+ Consider using the [Quat] constructor instead, which uses a quaternion instead of Euler angles.
+ </description>
+ </method>
+ <method name="Basis" qualifiers="constructor">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="from" type="Quat">
+ </argument>
+ <description>
+ Constructs a pure rotation basis matrix from the given quaternion.
+ </description>
+ </method>
+ <method name="Basis" qualifiers="constructor">
<return type="Basis">
</return>
<argument index="0" name="x_axis" type="Vector3">
@@ -106,12 +127,50 @@
</return>
<argument index="0" name="b" type="Basis">
</argument>
- <argument index="1" name="epsilon" type="float" default="1e-05">
- </argument>
<description>
Returns [code]true[/code] if this basis and [code]b[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Basis">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Basis">
+ </return>
+ <argument index="0" name="right" type="Basis">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Basis">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="orthonormalized">
<return type="Basis">
</return>
@@ -142,9 +201,9 @@
<method name="slerp">
<return type="Basis">
</return>
- <argument index="0" name="b" type="Basis">
+ <argument index="0" name="to" type="Basis">
</argument>
- <argument index="1" name="t" type="float">
+ <argument index="1" name="weight" type="float">
</argument>
<description>
Assuming that the matrix is a proper rotation matrix, slerp performs a spherical-linear interpolation with another rotation matrix.
@@ -184,25 +243,6 @@
Returns the transposed version of the matrix.
</description>
</method>
- <method name="xform">
- <return type="Vector3">
- </return>
- <argument index="0" name="v" type="Vector3">
- </argument>
- <description>
- Returns a vector transformed (multiplied) by the matrix.
- </description>
- </method>
- <method name="xform_inv">
- <return type="Vector3">
- </return>
- <argument index="0" name="v" type="Vector3">
- </argument>
- <description>
- Returns a vector transformed (multiplied) by the transposed basis matrix.
- [b]Note:[/b] This results in a multiplication by the inverse of the matrix only if it represents a rotation-reflection.
- </description>
- </method>
</methods>
<members>
<member name="x" type="Vector3" setter="" getter="" default="Vector3( 1, 0, 0 )">
diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml
deleted file mode 100644
index 87cffdaca0..0000000000
--- a/doc/classes/BitmapFont.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="BitmapFont" inherits="Font" version="4.0">
- <brief_description>
- Renders text using fonts under the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format.
- Handles files with the [code].fnt[/code] extension.
- </brief_description>
- <description>
- Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont].
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="add_char">
- <return type="void">
- </return>
- <argument index="0" name="character" type="int">
- </argument>
- <argument index="1" name="texture" type="int">
- </argument>
- <argument index="2" name="rect" type="Rect2">
- </argument>
- <argument index="3" name="align" type="Vector2" default="Vector2( 0, 0 )">
- </argument>
- <argument index="4" name="advance" type="float" default="-1">
- </argument>
- <description>
- Adds a character to the font, where [code]character[/code] is the Unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance.
- </description>
- </method>
- <method name="add_kerning_pair">
- <return type="void">
- </return>
- <argument index="0" name="char_a" type="int">
- </argument>
- <argument index="1" name="char_b" type="int">
- </argument>
- <argument index="2" name="kerning" type="int">
- </argument>
- <description>
- Adds a kerning pair to the [BitmapFont] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
- </description>
- </method>
- <method name="add_texture">
- <return type="void">
- </return>
- <argument index="0" name="texture" type="Texture2D">
- </argument>
- <description>
- Adds a texture to the [BitmapFont].
- </description>
- </method>
- <method name="clear">
- <return type="void">
- </return>
- <description>
- Clears all the font data and settings.
- </description>
- </method>
- <method name="create_from_fnt">
- <return type="int" enum="Error">
- </return>
- <argument index="0" name="path" type="String">
- </argument>
- <description>
- Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
- </description>
- </method>
- <method name="get_kerning_pair" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="char_a" type="int">
- </argument>
- <argument index="1" name="char_b" type="int">
- </argument>
- <description>
- Returns a kerning pair as a difference.
- </description>
- </method>
- <method name="get_texture" qualifiers="const">
- <return type="Texture2D">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the font atlas texture at index [code]idx[/code].
- </description>
- </method>
- <method name="get_texture_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the number of textures in the BitmapFont atlas.
- </description>
- </method>
- </methods>
- <members>
- <member name="ascent" type="float" setter="set_ascent" getter="get_ascent" default="0.0">
- Ascent (number of pixels above the baseline).
- </member>
- <member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint" default="false">
- If [code]true[/code], distance field hint is enabled.
- </member>
- <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback">
- The fallback font.
- </member>
- <member name="height" type="float" setter="set_height" getter="get_height" default="1.0">
- Total font height (ascent plus descent) in pixels.
- </member>
- </members>
- <constants>
- </constants>
-</class>
diff --git a/doc/classes/CubeMesh.xml b/doc/classes/BoxMesh.xml
index 1f64b4a21f..88d22ac899 100644
--- a/doc/classes/CubeMesh.xml
+++ b/doc/classes/BoxMesh.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="CubeMesh" inherits="PrimitiveMesh" version="4.0">
+<class name="BoxMesh" inherits="PrimitiveMesh" version="4.0">
<brief_description>
- Generate an axis-aligned cuboid [PrimitiveMesh].
+ Generate an axis-aligned box [PrimitiveMesh].
</brief_description>
<description>
- Generate an axis-aligned cuboid [PrimitiveMesh].
- The cube's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to [code]Vector3(3, 2, 1)[/code].
+ Generate an axis-aligned box [PrimitiveMesh].
+ The box's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to [code]Vector3(3, 2, 1)[/code].
</description>
<tutorials>
</tutorials>
@@ -13,7 +13,7 @@
</methods>
<members>
<member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3( 2, 2, 2 )">
- Size of the cuboid mesh.
+ Size of the box mesh.
</member>
<member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" default="0">
Number of extra edge loops inserted along the Z axis.
diff --git a/doc/classes/BoxShape3D.xml b/doc/classes/BoxShape3D.xml
index fd08da148d..d8cbd8b980 100644
--- a/doc/classes/BoxShape3D.xml
+++ b/doc/classes/BoxShape3D.xml
@@ -7,6 +7,9 @@
3D box shape that can be a child of a [PhysicsBody3D] or [Area3D].
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml
index de05cfcd13..e47198a381 100644
--- a/doc/classes/Button.xml
+++ b/doc/classes/Button.xml
@@ -6,7 +6,8 @@
<description>
Button is the standard themed button. It can contain text and an icon, and will display them according to the current [Theme].
[b]Example of creating a button and assigning an action when pressed by code:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
func _ready():
var button = Button.new()
button.text = "Click me"
@@ -15,12 +16,57 @@
func _button_pressed():
print("Hello world!")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ var button = new Button();
+ button.Text = "Click me";
+ button.Connect("pressed", this, nameof(ButtonPressed));
+ AddChild(button);
+ }
+
+ private void ButtonPressed()
+ {
+ GD.Print("Hello world!");
+ }
+ [/csharp]
+ [/codeblocks]
Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
+ <method name="clear_opentype_features">
+ <return type="void">
+ </return>
+ <description>
+ Removes all OpenType features.
+ </description>
+ </method>
+ <method name="get_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code].
+ </description>
+ </method>
+ <method name="set_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <argument index="1" name="value" type="int">
+ </argument>
+ <description>
+ Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+ </description>
+ </method>
</methods>
<members>
<member name="align" type="int" setter="set_text_align" getter="get_text_align" enum="Button.TextAlign" default="1">
@@ -38,9 +84,15 @@
<member name="icon" type="Texture2D" setter="set_button_icon" getter="get_button_icon">
Button's icon, if text is present the icon will be placed before the text.
</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="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
The button's text that will be displayed inside the button's area.
</member>
+ <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
+ Base text writing direction.
+ </member>
</members>
<constants>
<constant name="ALIGN_LEFT" value="0" enum="TextAlign">
@@ -75,6 +127,12 @@
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
Text [Color] used when the [Button] is being pressed.
</theme_item>
+ <theme_item name="font_outline_modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ Text oubline [Color] of the [Button].
+ </theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [Button]'s text.
+ </theme_item>
<theme_item name="hover" type="StyleBox">
[StyleBox] used when the [Button] is being hovered.
</theme_item>
@@ -84,6 +142,9 @@
<theme_item name="normal" type="StyleBox">
Default [StyleBox] for the [Button].
</theme_item>
+ <theme_item name="outline_size" type="int" default="0">
+ Size of the [Button]'s text outline.
+ </theme_item>
<theme_item name="pressed" type="StyleBox">
[StyleBox] used when the [Button] is being pressed.
</theme_item>
diff --git a/doc/classes/ButtonGroup.xml b/doc/classes/ButtonGroup.xml
index b7f3234b36..5aa2d699a8 100644
--- a/doc/classes/ButtonGroup.xml
+++ b/doc/classes/ButtonGroup.xml
@@ -14,7 +14,7 @@
<return type="Array">
</return>
<description>
- Returns an [Array] of [Button]s who have this as their [ButtonGroup] (see [member BaseButton.group]).
+ Returns an [Array] of [Button]s who have this as their [ButtonGroup] (see [member BaseButton.button_group]).
</description>
</method>
<method name="get_pressed_button">
diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml
index 7244da56ca..aa9f99a31e 100644
--- a/doc/classes/CPUParticles2D.xml
+++ b/doc/classes/CPUParticles2D.xml
@@ -50,10 +50,10 @@
<method name="get_particle_flag" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="flag" type="int" enum="CPUParticles2D.Flags">
+ <argument index="0" name="particle_flag" type="int" enum="CPUParticles2D.ParticleFlags">
</argument>
<description>
- Returns the enabled state of the given flag (see [enum Flags] for options).
+ Returns the enabled state of the given flag (see [enum ParticleFlags] for options).
</description>
</method>
<method name="restart">
@@ -99,12 +99,12 @@
<method name="set_particle_flag">
<return type="void">
</return>
- <argument index="0" name="flag" type="int" enum="CPUParticles2D.Flags">
+ <argument index="0" name="particle_flag" type="int" enum="CPUParticles2D.ParticleFlags">
</argument>
<argument index="1" name="enable" type="bool">
</argument>
<description>
- Enables or disables the given flag (see [enum Flags] for options).
+ Enables or disables the given flag (see [enum ParticleFlags] for options).
</description>
</method>
</methods>
@@ -196,9 +196,6 @@
<member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps" default="0">
The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself.
</member>
- <member name="flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
- Align Y axis of particle with the direction of its velocity.
- </member>
<member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" default="true">
If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect.
</member>
@@ -238,10 +235,6 @@
<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
</member>
- <member name="normalmap" type="Texture2D" setter="set_normalmap" getter="get_normalmap">
- Normal map to be used for the [member texture] property.
- [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
- </member>
<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end.
</member>
@@ -254,6 +247,9 @@
<member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
Orbital velocity randomness ratio.
</member>
+ <member name="particle_flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
+ Align Y axis of particle with the direction of its velocity.
+ </member>
<member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0">
Particle system starts as if it had already run for this many seconds.
</member>
@@ -343,17 +339,17 @@
<constant name="PARAM_MAX" value="12" enum="Parameter">
Represents the size of the [enum Parameter] enum.
</constant>
- <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags">
- Use with [method set_particle_flag] to set [member flag_align_y].
+ <constant name="PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="ParticleFlags">
+ Use with [method set_particle_flag] to set [member particle_flag_align_y].
</constant>
- <constant name="FLAG_ROTATE_Y" value="1" enum="Flags">
+ <constant name="PARTICLE_FLAG_ROTATE_Y" value="1" enum="ParticleFlags">
Present for consistency with 3D particle nodes, not used in 2D.
</constant>
- <constant name="FLAG_DISABLE_Z" value="2" enum="Flags">
+ <constant name="PARTICLE_FLAG_DISABLE_Z" value="2" enum="ParticleFlags">
Present for consistency with 3D particle nodes, not used in 2D.
</constant>
- <constant name="FLAG_MAX" value="3" enum="Flags">
- Represents the size of the [enum Flags] enum.
+ <constant name="PARTICLE_FLAG_MAX" value="3" enum="ParticleFlags">
+ Represents the size of the [enum ParticleFlags] enum.
</constant>
<constant name="EMISSION_SHAPE_POINT" value="0" enum="EmissionShape">
All particles will be emitted from a single point.
diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml
index 07da066bd9..0512efa8c2 100644
--- a/doc/classes/CPUParticles3D.xml
+++ b/doc/classes/CPUParticles3D.xml
@@ -49,10 +49,10 @@
<method name="get_particle_flag" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="flag" type="int" enum="CPUParticles3D.Flags">
+ <argument index="0" name="particle_flag" type="int" enum="CPUParticles3D.ParticleFlags">
</argument>
<description>
- Returns the enabled state of the given flag (see [enum Flags] for options).
+ Returns the enabled state of the given particle flag (see [enum ParticleFlags] for options).
</description>
</method>
<method name="restart">
@@ -98,12 +98,12 @@
<method name="set_particle_flag">
<return type="void">
</return>
- <argument index="0" name="flag" type="int" enum="CPUParticles3D.Flags">
+ <argument index="0" name="particle_flag" type="int" enum="CPUParticles3D.ParticleFlags">
</argument>
<argument index="1" name="enable" type="bool">
</argument>
<description>
- Enables or disables the given flag (see [enum Flags] for options).
+ Enables or disables the given particle flag (see [enum ParticleFlags] for options).
</description>
</method>
</methods>
@@ -195,15 +195,6 @@
<member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps" default="0">
The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself.
</member>
- <member name="flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
- Align Y axis of particle with the direction of its velocity.
- </member>
- <member name="flag_disable_z" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
- If [code]true[/code], particles will not move on the z axis.
- </member>
- <member name="flag_rotate_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
- If [code]true[/code], particles rotate around Y axis by [member angle].
- </member>
<member name="flatness" type="float" setter="set_flatness" getter="get_flatness" default="0.0">
Amount of [member spread] in Y/Z plane. A value of [code]1[/code] restricts particles to X/Z plane.
</member>
@@ -254,7 +245,7 @@
</member>
<member name="orbit_velocity" type="float" setter="set_param" getter="get_param">
Orbital velocity applied to each particle. Makes the particles circle around origin in the local XY plane. Specified in number of full rotations around origin per second.
- This property is only available when [member flag_disable_z] is [code]true[/code].
+ This property is only available when [member particle_flag_disable_z] is [code]true[/code].
</member>
<member name="orbit_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's orbital velocity will vary along this [Curve].
@@ -262,6 +253,15 @@
<member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
Orbital velocity randomness ratio.
</member>
+ <member name="particle_flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
+ Align Y axis of particle with the direction of its velocity.
+ </member>
+ <member name="particle_flag_disable_z" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
+ If [code]true[/code], particles will not move on the Z axis.
+ </member>
+ <member name="particle_flag_rotate_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
+ If [code]true[/code], particles rotate around Y axis by [member angle].
+ </member>
<member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0">
Particle system starts as if it had already run for this many seconds.
</member>
@@ -351,17 +351,17 @@
<constant name="PARAM_MAX" value="12" enum="Parameter">
Represents the size of the [enum Parameter] enum.
</constant>
- <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags">
- Use with [method set_particle_flag] to set [member flag_align_y].
+ <constant name="PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="ParticleFlags">
+ Use with [method set_particle_flag] to set [member particle_flag_align_y].
</constant>
- <constant name="FLAG_ROTATE_Y" value="1" enum="Flags">
- Use with [method set_particle_flag] to set [member flag_rotate_y].
+ <constant name="PARTICLE_FLAG_ROTATE_Y" value="1" enum="ParticleFlags">
+ Use with [method set_particle_flag] to set [member particle_flag_rotate_y].
</constant>
- <constant name="FLAG_DISABLE_Z" value="2" enum="Flags">
- Use with [method set_particle_flag] to set [member flag_disable_z].
+ <constant name="PARTICLE_FLAG_DISABLE_Z" value="2" enum="ParticleFlags">
+ Use with [method set_particle_flag] to set [member particle_flag_disable_z].
</constant>
- <constant name="FLAG_MAX" value="3" enum="Flags">
- Represents the size of the [enum Flags] enum.
+ <constant name="PARTICLE_FLAG_MAX" value="3" enum="ParticleFlags">
+ Represents the size of the [enum ParticleFlags] enum.
</constant>
<constant name="EMISSION_SHAPE_POINT" value="0" enum="EmissionShape">
All particles will be emitted from a single point.
diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml
index 3cc74beb58..f137ede90f 100644
--- a/doc/classes/Callable.xml
+++ b/doc/classes/Callable.xml
@@ -6,28 +6,67 @@
<description>
[Callable] is a first class object which can be held in variables and passed to functions. It represents a given method in an [Object], and is typically used for signal callbacks.
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
var callable = Callable(self, "print_args")
func print_args(arg1, arg2, arg3 = ""):
prints(arg1, arg2, arg3)
+
func test():
callable.call("hello", "world") # Prints "hello world".
callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(Node.gd)::print_args".
callable.call("invalid") # Invalid call, should have at least 2 arguments.
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ Callable callable = new Callable(this, "print_args");
+ public void PrintArgs(object arg1, object arg2, object arg3 = "")
+ {
+ GD.PrintS(arg1, arg2, arg3);
+ }
+
+ public void Test()
+ {
+ callable.Call("hello", "world"); // Prints "hello world".
+ callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.gd)::print_args".
+ callable.Call("invalid"); // Invalid call, should have at least 2 arguments.
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
<methods>
- <method name="Callable">
+ <method name="Callable" qualifiers="constructor">
+ <return type="Callable">
+ </return>
+ <description>
+ Constructs a null [Callable] with no object nor method bound.
+ </description>
+ </method>
+ <method name="Callable" qualifiers="constructor">
+ <return type="Callable">
+ </return>
+ <argument index="0" name="from" type="Callable">
+ </argument>
+ <description>
+ Constructs a [Callable] as a copy of the given [Callable].
+ </description>
+ </method>
+ <method name="Callable" qualifiers="constructor">
<return type="Callable">
</return>
<argument index="0" name="object" type="Object">
</argument>
- <argument index="1" name="method_name" type="StringName">
+ <argument index="1" name="method" type="StringName">
</argument>
<description>
- Creates a new [Callable] for the method called [code]method_name[/code] in the specified [code]object[/code].
+ Creates a new [Callable] for the method called [code]method[/code] in the specified [code]object[/code].
+ </description>
+ </method>
+ <method name="bind" qualifiers="vararg">
+ <return type="Callable">
+ </return>
+ <description>
</description>
</method>
<method name="call" qualifiers="vararg">
@@ -89,6 +128,30 @@
<description>
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Callable">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Callable">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="unbind">
+ <return type="Callable">
+ </return>
+ <argument index="0" name="argcount" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml
index ad49216b34..c7ee915109 100644
--- a/doc/classes/Camera2D.xml
+++ b/doc/classes/Camera2D.xml
@@ -9,6 +9,9 @@
Note that the [Camera2D] node's [code]position[/code] doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [method get_camera_screen_center] to get the real position.
</description>
<tutorials>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
+ <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link>
+ <link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link>
</tutorials>
<methods>
<method name="align">
diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml
index 598b4bd685..052b23a7ab 100644
--- a/doc/classes/Camera3D.xml
+++ b/doc/classes/Camera3D.xml
@@ -7,6 +7,7 @@
[Camera3D] is a special node that displays what is visible from its current location. Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. In other words, a camera just provides 3D display capabilities to a [Viewport], and, without one, a scene registered in that [Viewport] (or higher viewports) can't be displayed.
</description>
<tutorials>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="clear_current">
@@ -162,6 +163,13 @@
</argument>
<description>
Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in worldspace.
+ [b]Note:[/b] When using this to position GUI elements over a 3D viewport, use [method is_position_behind] to prevent them from appearing if the 3D point is behind the camera:
+ [codeblock]
+ # This code block is part of a script that inherits from Node3D.
+ # `control` is a reference to a node inheriting from Control.
+ control.visible = not get_viewport().get_camera().is_position_behind(global_transform.origin)
+ control.rect_position = get_viewport().get_camera().unproject_position(global_transform.origin)
+ [/codeblock]
</description>
</method>
</methods>
@@ -181,7 +189,7 @@
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
The [Environment] to use for this camera.
</member>
- <member name="far" type="float" setter="set_zfar" getter="get_zfar" default="100.0">
+ <member name="far" type="float" setter="set_zfar" getter="get_zfar" default="4000.0">
The distance to the far culling boundary for this camera relative to its local Z axis.
</member>
<member name="fov" type="float" setter="set_fov" getter="get_fov" default="75.0">
diff --git a/doc/classes/CanvasGroup.xml b/doc/classes/CanvasGroup.xml
new file mode 100644
index 0000000000..ceeda6c3f5
--- /dev/null
+++ b/doc/classes/CanvasGroup.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CanvasGroup" inherits="Node2D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="clear_margin" type="float" setter="set_clear_margin" getter="get_clear_margin" default="10.0">
+ </member>
+ <member name="fit_margin" type="float" setter="set_fit_margin" getter="get_fit_margin" default="10.0">
+ </member>
+ <member name="use_mipmaps" type="bool" setter="set_use_mipmaps" getter="is_using_mipmaps" default="false">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 0eecada4fe..fcdd072c80 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -14,6 +14,7 @@
<tutorials>
<link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
<link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
+ <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
</tutorials>
<methods>
<method name="_draw" qualifiers="virtual">
@@ -40,22 +41,30 @@
</argument>
<argument index="6" name="width" type="float" default="1.0">
</argument>
+ <argument index="7" name="antialiased" type="bool" default="false">
+ </argument>
<description>
Draws an arc between the given angles. The larger the value of [code]point_count[/code], the smoother the curve.
</description>
</method>
- <method name="draw_char">
+ <method name="draw_char" qualifiers="const">
<return type="float">
</return>
<argument index="0" name="font" type="Font">
</argument>
- <argument index="1" name="position" type="Vector2">
+ <argument index="1" name="pos" type="Vector2">
</argument>
<argument index="2" name="char" type="String">
</argument>
- <argument index="3" name="next" type="String">
+ <argument index="3" name="next" type="String" default="&quot;&quot;">
+ </argument>
+ <argument index="4" name="size" type="int" default="-1">
</argument>
- <argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ <argument index="5" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <argument index="6" name="outline_size" type="int" default="0">
+ </argument>
+ <argument index="7" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
</argument>
<description>
Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character.
@@ -85,16 +94,6 @@
</argument>
<argument index="3" name="texture" type="Texture2D" default="null">
</argument>
- <argument index="4" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="5" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="7" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="8" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a colored polygon of any amount of points, convex or concave.
</description>
@@ -121,19 +120,9 @@
</argument>
<argument index="1" name="texture" type="Texture2D">
</argument>
- <argument index="2" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="3" name="specular_map" type="Texture2D" default="null">
+ <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
</argument>
- <argument index="4" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="5" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
- </argument>
- <argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="7" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="8" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
+ <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
</argument>
<description>
Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation.
@@ -165,22 +154,41 @@
Draws multiple, parallel lines with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
</description>
</method>
- <method name="draw_multimesh">
+ <method name="draw_multiline_string" qualifiers="const">
<return type="void">
</return>
- <argument index="0" name="multimesh" type="MultiMesh">
+ <argument index="0" name="font" type="Font">
</argument>
- <argument index="1" name="texture" type="Texture2D">
+ <argument index="1" name="pos" type="Vector2">
</argument>
- <argument index="2" name="normal_map" type="Texture2D" default="null">
+ <argument index="2" name="text" type="String">
</argument>
- <argument index="3" name="specular_map" type="Texture2D" default="null">
+ <argument index="3" name="align" type="int" enum="HAlign" default="0">
</argument>
- <argument index="4" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
+ <argument index="4" name="width" type="float" default="-1">
</argument>
- <argument index="5" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
+ <argument index="5" name="max_lines" type="int" default="-1">
</argument>
- <argument index="6" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
+ <argument index="6" name="size" type="int" default="-1">
+ </argument>
+ <argument index="7" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <argument index="8" name="outline_size" type="int" default="0">
+ </argument>
+ <argument index="9" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
+ </argument>
+ <argument index="10" name="flags" type="int" default="51">
+ </argument>
+ <description>
+ Breaks [code]text[/code] to the lines and draws it using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width.
+ </description>
+ </method>
+ <method name="draw_multimesh">
+ <return type="void">
+ </return>
+ <argument index="0" name="multimesh" type="MultiMesh">
+ </argument>
+ <argument index="1" name="texture" type="Texture2D">
</argument>
<description>
Draws a [MultiMesh] in 2D with the provided texture. See [MultiMeshInstance2D] for related documentation.
@@ -197,16 +205,6 @@
</argument>
<argument index="3" name="texture" type="Texture2D" default="null">
</argument>
- <argument index="4" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="5" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="7" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="8" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a polygon of any amount of points, convex or concave.
</description>
@@ -220,6 +218,8 @@
</argument>
<argument index="2" name="width" type="float" default="1.0">
</argument>
+ <argument index="3" name="antialiased" type="bool" default="false">
+ </argument>
<description>
Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code].
</description>
@@ -233,6 +233,8 @@
</argument>
<argument index="2" name="width" type="float" default="1.0">
</argument>
+ <argument index="3" name="antialiased" type="bool" default="false">
+ </argument>
<description>
Draws interconnected line segments with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
</description>
@@ -250,16 +252,6 @@
</argument>
<argument index="4" name="width" type="float" default="1.0">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="9" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad.
</description>
@@ -302,30 +294,51 @@
Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this.
</description>
</method>
- <method name="draw_string">
+ <method name="draw_string" qualifiers="const">
<return type="void">
</return>
<argument index="0" name="font" type="Font">
</argument>
- <argument index="1" name="position" type="Vector2">
+ <argument index="1" name="pos" type="Vector2">
</argument>
<argument index="2" name="text" type="String">
</argument>
- <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ <argument index="3" name="align" type="int" enum="HAlign" default="0">
+ </argument>
+ <argument index="4" name="width" type="float" default="-1">
+ </argument>
+ <argument index="5" name="size" type="int" default="-1">
+ </argument>
+ <argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
</argument>
- <argument index="4" name="clip_w" type="int" default="-1">
+ <argument index="7" name="outline_size" type="int" default="0">
+ </argument>
+ <argument index="8" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
+ </argument>
+ <argument index="9" name="flags" type="int" default="3">
</argument>
<description>
Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] 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]
- [codeblock]
+ [codeblocks]
+ [gdscript]
# If using this method in a script that redraws constantly, move the
# `default_font` declaration to a member variable assigned in `_ready()`
# so the Control is only created once.
var default_font = Control.new().get_font("font")
- draw_string(default_font, Vector2(64, 64), "Hello world")
- [/codeblock]
- See also [method Font.draw].
+ var default_font_size = Control.new().get_font_size("font_size")
+ draw_string(default_font, Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, font_size)
+ [/gdscript]
+ [csharp]
+ // If using this method in a script that redraws constantly, move the
+ // `default_font` declaration to a member variable assigned in `_ready()`
+ // so the Control is only created once.
+ Font defaultFont = new Control().GetFont("font");
+ int defaultFontSize = new Control().GetFontSize("font_size");
+ DrawString(defaultFont, new Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, defaultFontSize);
+ [/csharp]
+ [/codeblocks]
+ See also [method Font.draw_string].
</description>
</method>
<method name="draw_style_box">
@@ -348,16 +361,6 @@
</argument>
<argument index="2" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
</argument>
- <argument index="3" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="4" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="5" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="6" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="7" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a texture at a given position.
</description>
@@ -375,16 +378,6 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="9" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
- </argument>
<description>
Draws a textured rectangle at a given position, optionally modulated by a color. If [code]transpose[/code] is [code]true[/code], the texture will have its X and Y coordinates swapped.
</description>
@@ -402,17 +395,7 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="clip_uv" type="bool" default="true">
- </argument>
- <argument index="9" name="texture_filter" type="int" enum="CanvasItem.TextureFilter" default="0">
- </argument>
- <argument index="10" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0">
+ <argument index="5" name="clip_uv" type="bool" default="true">
</argument>
<description>
Draws a textured rectangle region at a given position, optionally modulated by a color. If [code]transpose[/code] is [code]true[/code], the texture will have its X and Y coordinates swapped.
@@ -516,13 +499,6 @@
Returns [code]true[/code] if local transform notifications are communicated to children.
</description>
</method>
- <method name="is_set_as_toplevel" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Returns [code]true[/code] if the node is set as top-level. See [method set_as_toplevel].
- </description>
- </method>
<method name="is_transform_notification_enabled" qualifiers="const">
<return type="bool">
</return>
@@ -555,15 +531,6 @@
Transformations issued by [code]event[/code]'s inputs are applied in local space instead of global space.
</description>
</method>
- <method name="set_as_toplevel">
- <return type="void">
- </return>
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- If [code]enable[/code] is [code]true[/code], the node won't inherit its transform from parent canvas items.
- </description>
- </method>
<method name="set_notify_local_transform">
<return type="void">
</return>
@@ -598,6 +565,8 @@
</method>
</methods>
<members>
+ <member name="clip_children" type="bool" setter="set_clip_children" getter="is_clipping_children" default="false">
+ </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.
</member>
@@ -622,6 +591,9 @@
<member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="CanvasItem.TextureRepeat" default="0">
The texture repeating mode to use on this [CanvasItem].
</member>
+ <member name="top_level" type="bool" setter="set_as_top_level" getter="is_set_as_top_level" default="false">
+ If [code]true[/code], the node will not inherit its transform from parent [CanvasItem]s.
+ </member>
<member name="use_parent_material" type="bool" setter="set_use_parent_material" getter="get_use_parent_material" default="false">
If [code]true[/code], the parent [CanvasItem]'s [member material] property is used as this one's material.
</member>
@@ -636,14 +608,14 @@
Emitted when the [CanvasItem] must redraw. This can only be connected realtime, as deferred will not allow drawing.
</description>
</signal>
- <signal name="hide">
+ <signal name="hidden">
<description>
Emitted when becoming hidden.
</description>
</signal>
<signal name="item_rect_changed">
<description>
- Emitted when the item rect has changed.
+ 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]).
</description>
</signal>
<signal name="visibility_changed">
diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml
index 89cd28b617..9d952cdba3 100644
--- a/doc/classes/CanvasLayer.xml
+++ b/doc/classes/CanvasLayer.xml
@@ -9,6 +9,7 @@
<tutorials>
<link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
<link title="Canvas layers">https://docs.godotengine.org/en/latest/tutorials/2d/canvas_layers.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="get_canvas" qualifiers="const">
diff --git a/doc/classes/CanvasTexture.xml b/doc/classes/CanvasTexture.xml
new file mode 100644
index 0000000000..0ca132746b
--- /dev/null
+++ b/doc/classes/CanvasTexture.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CanvasTexture" inherits="Texture2D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="diffuse_texture" type="Texture2D" setter="set_diffuse_texture" getter="get_diffuse_texture">
+ </member>
+ <member name="normal_texture" type="Texture2D" setter="set_normal_texture" getter="get_normal_texture">
+ </member>
+ <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )">
+ </member>
+ <member name="specular_shininess" type="float" setter="set_specular_shininess" getter="get_specular_shininess" default="1.0">
+ </member>
+ <member name="specular_texture" type="Texture2D" setter="set_specular_texture" getter="get_specular_texture">
+ </member>
+ <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="CanvasItem.TextureFilter" default="0">
+ </member>
+ <member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="CanvasItem.TextureRepeat" default="0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/CapsuleShape3D.xml b/doc/classes/CapsuleShape3D.xml
index f56d94dc63..27a6242bc9 100644
--- a/doc/classes/CapsuleShape3D.xml
+++ b/doc/classes/CapsuleShape3D.xml
@@ -7,6 +7,7 @@
Capsule shape for collisions.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml
index a988035c36..b4cb110337 100644
--- a/doc/classes/CharFXTransform.xml
+++ b/doc/classes/CharFXTransform.xml
@@ -13,17 +13,6 @@
<methods>
</methods>
<members>
- <member name="absolute_index" type="int" setter="set_absolute_index" getter="get_absolute_index" default="0">
- The index of the current character (starting from 0). Setting this property won't affect drawing.
- </member>
- <member name="character" type="int" setter="set_character" getter="get_character" default="0">
- The Unicode codepoint the character will use. This only affects non-whitespace characters. [method @GDScript.ord] can be useful here. For example, the following will replace all characters with asterisks:
- [codeblock]
- # `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`.
- # See the RichTextEffect documentation for details.
- char_fx.character = ord("*")
- [/codeblock]
- </member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )">
The color the character will be drawn with.
</member>
@@ -38,11 +27,20 @@
{"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)}
[/codeblock]
</member>
+ <member name="font" type="RID" setter="set_font" getter="get_font">
+ Font resource used to render glyph.
+ </member>
+ <member name="glyph_index" type="int" setter="set_glyph_index" getter="get_glyph_index" default="0">
+ Font specific glyph index.
+ </member>
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
The position offset the character will be drawn with (in pixels).
</member>
- <member name="relative_index" type="int" setter="set_relative_index" getter="get_relative_index" default="0">
- The index of the current character (starting from 0). Setting this property won't affect drawing.
+ <member name="outline" type="bool" setter="set_outline" getter="is_outline" default="false">
+ If [code]ture[/code], FX transform is called for outline drawing. Setting this property won't affect drawing.
+ </member>
+ <member name="range" type="Vector2i" setter="set_range" getter="get_range" default="Vector2i( 0, 0 )">
+ Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing.
</member>
<member name="visible" type="bool" setter="set_visibility" getter="is_visible" default="true">
If [code]true[/code], the character will be drawn. If [code]false[/code], the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their [member color] to [code]Color(1, 1, 1, 0)[/code] instead.
diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml
index 9c42091eb8..89fb960e88 100644
--- a/doc/classes/CheckBox.xml
+++ b/doc/classes/CheckBox.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to [CheckButton] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has [b]no[/b] immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
@@ -47,6 +48,9 @@
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
The [CheckBox] text's font color when it's pressed.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [CheckBox]'s text.
+ </theme_item>
<theme_item name="hover" type="StyleBox">
The [StyleBox] to display as a background when the [CheckBox] is hovered.
</theme_item>
diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml
index 514ff9a691..882f1c69f3 100644
--- a/doc/classes/CheckButton.xml
+++ b/doc/classes/CheckButton.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
CheckButton is a toggle button displayed as a check field. It's similar to [CheckBox] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an [b]immediate[/b] effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
@@ -44,6 +45,9 @@
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
The [CheckButton] text's font color when it's pressed.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [CheckButton]'s text.
+ </theme_item>
<theme_item name="hover" type="StyleBox">
The [StyleBox] to display as a background when the [CheckButton] is hovered.
</theme_item>
@@ -57,16 +61,28 @@
The [StyleBox] to display as a background.
</theme_item>
<theme_item name="off" type="Texture2D">
- The icon to display when the [CheckButton] is unchecked.
+ The icon to display when the [CheckButton] is unchecked (for left-to-right layouts).
</theme_item>
<theme_item name="off_disabled" type="Texture2D">
- The icon to display when the [CheckButton] is unchecked and disabled.
+ The icon to display when the [CheckButton] is unchecked and disabled (for left-to-right layouts).
+ </theme_item>
+ <theme_item name="off_disabled_mirrored" type="Texture2D">
+ The icon to display when the [CheckButton] is unchecked and disabled (for right-to-left layouts).
+ </theme_item>
+ <theme_item name="off_mirrored" type="Texture2D">
+ The icon to display when the [CheckButton] is unchecked (for right-to-left layouts).
</theme_item>
<theme_item name="on" type="Texture2D">
- The icon to display when the [CheckButton] is checked.
+ The icon to display when the [CheckButton] is checked (for left-to-right layouts).
</theme_item>
<theme_item name="on_disabled" type="Texture2D">
- The icon to display when the [CheckButton] is checked and disabled.
+ The icon to display when the [CheckButton] is checked and disabled (for left-to-right layouts).
+ </theme_item>
+ <theme_item name="on_disabled_mirrored" type="Texture2D">
+ The icon to display when the [CheckButton] is checked and disabled (for right-to-left layouts).
+ </theme_item>
+ <theme_item name="on_mirrored" type="Texture2D">
+ The icon to display when the [CheckButton] is checked (for right-to-left layouts).
</theme_item>
<theme_item name="pressed" type="StyleBox">
The [StyleBox] to display as a background when the [CheckButton] is pressed.
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml
index f6bc9e2cca..8834ff82c6 100644
--- a/doc/classes/CodeEdit.xml
+++ b/doc/classes/CodeEdit.xml
@@ -3,6 +3,7 @@
<brief_description>
</brief_description>
<description>
+ [b]Note[/b]: By default [CodeEdit] always use left-to-right text direction to correcly display source code.
</description>
<tutorials>
</tutorials>
@@ -109,6 +110,9 @@
</member>
<member name="draw_line_numbers" type="bool" setter="set_draw_line_numbers" getter="is_draw_line_numbers_enabled" default="false">
</member>
+ <member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" override="true" enum="Control.LayoutDirection" default="2" />
+ <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" override="true" default="[ ]" />
+ <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" override="true" enum="Control.TextDirection" default="1" />
<member name="zero_pad_line_numbers" type="bool" setter="set_line_numbers_zero_padded" getter="is_line_numbers_zero_padded" default="false">
</member>
</members>
@@ -179,6 +183,9 @@
</theme_item>
<theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )">
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [CodeEdit]'s text.
+ </theme_item>
<theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )">
</theme_item>
<theme_item name="line_spacing" type="int" default="4">
diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml
index b4fcf9cd88..c03eba82ff 100644
--- a/doc/classes/CollisionShape2D.xml
+++ b/doc/classes/CollisionShape2D.xml
@@ -8,6 +8,9 @@
</description>
<tutorials>
<link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/CollisionShape3D.xml b/doc/classes/CollisionShape3D.xml
index 177900dd4f..5590947a4f 100644
--- a/doc/classes/CollisionShape3D.xml
+++ b/doc/classes/CollisionShape3D.xml
@@ -8,6 +8,9 @@
</description>
<tutorials>
<link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="make_convex_from_siblings">
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index fcaba99eb7..755fd7eea2 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -8,61 +8,50 @@
You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url].
If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8].
[b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code].
+ [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png]Color constants cheatsheet[/url]
</description>
<tutorials>
+ <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/517</link>
+ <link title="Tween Demo">https://godotengine.org/asset-library/asset/146</link>
+ <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/133</link>
</tutorials>
<methods>
- <method name="Color">
+ <method name="Color" qualifiers="constructor">
<return type="Color">
</return>
- <argument index="0" name="from" type="String">
- </argument>
<description>
- Constructs a color from an HTML hexadecimal color string in RGB or RGBA format. See also [method @GDScript.ColorN].
- [codeblock]
- # Each of the following creates the same color RGBA(178, 217, 10, 255).
- var c3 = Color("#b2d90a") # RGB format with "#".
- var c4 = Color("b2d90a") # RGB format.
- var c1 = Color("#b2d90aff") # RGBA format with "#".
- var c2 = Color("b2d90aff") # RGBA format.
- [/codeblock]
- You can also use the "web color" short-hand form by only using 3 or 4 digits.
- [codeblock]
- # Each of the following creates the same color RGBA(17, 34, 51, 255).
- var c3 = Color("#123") # RGB format with "#".
- var c4 = Color("123") # RGB format.
- var c1 = Color("#123f") # RGBA format with "#".
- var c2 = Color("123f") # RGBA format.
- [/codeblock]
+ Constructs a default-initialized [Color] with all components set to [code]0[/code].
</description>
</method>
- <method name="Color">
+ <method name="Color" qualifiers="constructor">
<return type="Color">
</return>
- <argument index="0" name="from" type="int">
+ <argument index="0" name="from" type="Color">
</argument>
<description>
- Constructs a color from a 32-bit integer (each byte represents a component of the RGBA profile).
- [codeblock]
- var c = Color(274) # Equivalent to RGBA(0, 0, 1, 18)
- [/codeblock]
+ Constructs a [Color] as a copy of the given [Color].
</description>
</method>
- <method name="Color">
+ <method name="Color" qualifiers="constructor">
<return type="Color">
</return>
- <argument index="0" name="c" type="Color">
+ <argument index="0" name="from" type="Color">
</argument>
- <argument index="1" name="a" type="float">
+ <argument index="1" name="alpha" type="float">
</argument>
<description>
- Constructs a color from an existing color, but with a custom alpha value.
- [codeblock]
+ Constructs a [Color] from an existing color, but with a custom alpha value.
+ [codeblocks]
+ [gdscript]
var red = Color(Color.red, 0.5) # 50% transparent red.
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var red = new Color(Colors.Red, 0.5f); // 50% transparent red.
+ [/csharp]
+ [/codeblocks]
</description>
</method>
- <method name="Color">
+ <method name="Color" qualifiers="constructor">
<return type="Color">
</return>
<argument index="0" name="r" type="float">
@@ -71,14 +60,21 @@
</argument>
<argument index="2" name="b" type="float">
</argument>
+ <argument index="3" name="a" type="float">
+ </argument>
<description>
- Constructs a color from an RGB profile using values between 0 and 1. Alpha will always be 1.
- [codeblock]
- var c = Color(0.2, 1.0, 0.7) # Equivalent to RGBA(51, 255, 178, 255)
- [/codeblock]
+ Constructs a [Color] from RGBA values, typically between 0 and 1.
+ [codeblocks]
+ [gdscript]
+ var color = Color(0.2, 1.0, 0.7, 0.8) # Similar to `Color8(51, 255, 178, 204)`
+ [/gdscript]
+ [csharp]
+ var color = new Color(0.2f, 1.0f, 0.7f, 0.8f); // Similar to `Color.Color8(51, 255, 178, 255, 204)`
+ [/csharp]
+ [/codeblocks]
</description>
</method>
- <method name="Color">
+ <method name="Color" qualifiers="constructor">
<return type="Color">
</return>
<argument index="0" name="r" type="float">
@@ -87,13 +83,16 @@
</argument>
<argument index="2" name="b" type="float">
</argument>
- <argument index="3" name="a" type="float">
- </argument>
<description>
- Constructs a color from an RGBA profile using values between 0 and 1.
- [codeblock]
- var c = Color(0.2, 1.0, 0.7, 0.8) # Equivalent to RGBA(51, 255, 178, 204)
- [/codeblock]
+ Constructs a [Color] from RGB values, typically between 0 and 1. Alpha will be 1.
+ [codeblocks]
+ [gdscript]
+ var color = Color(0.2, 1.0, 0.7) # Similar to `Color8(51, 255, 178, 255)`
+ [/gdscript]
+ [csharp]
+ var color = new Color(0.2f, 1.0f, 0.7f); // Similar to `Color.Color8(51, 255, 178, 255)`
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="blend">
@@ -103,22 +102,18 @@
</argument>
<description>
Returns a new color resulting from blending this color over another. If the color is opaque, the result is also opaque. The second color may have a range of alpha values.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50%
var fg = Color(1.0, 0.0, 0.0, 0.5) # Red with alpha of 50%
var blended_color = bg.blend(fg) # Brown with alpha of 75%
- [/codeblock]
- </description>
- </method>
- <method name="contrasted">
- <return type="Color">
- </return>
- <description>
- Returns the most contrasting color.
- [codeblock]
- var c = Color(0.3, 0.4, 0.9)
- var contrasted_color = c.contrasted() # Equivalent to RGBA(204, 229, 102, 255)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var bg = new Color(0.0f, 1.0f, 0.0f, 0.5f); // Green with alpha of 50%
+ var fg = new Color(1.0f, 0.0f, 0.0f, 0.5f); // Red with alpha of 50%
+ Color blendedColor = bg.Blend(fg); // Brown with alpha of 75%
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="darkened">
@@ -128,28 +123,16 @@
</argument>
<description>
Returns a new color resulting from making this color darker by the specified percentage (ratio from 0 to 1).
- [codeblock]
+ [codeblocks]
+ [gdscript]
var green = Color(0.0, 1.0, 0.0)
var darkgreen = green.darkened(0.2) # 20% darker than regular green
- [/codeblock]
- </description>
- </method>
- <method name="from_hsv">
- <return type="Color">
- </return>
- <argument index="0" name="h" type="float">
- </argument>
- <argument index="1" name="s" type="float">
- </argument>
- <argument index="2" name="v" type="float">
- </argument>
- <argument index="3" name="a" type="float" default="1.0">
- </argument>
- <description>
- Constructs a color from an HSV profile. [code]h[/code], [code]s[/code], and [code]v[/code] are values between 0 and 1.
- [codeblock]
- var c = Color.from_hsv(0.58, 0.5, 0.79, 0.8) # Equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var green = new Color(0.0f, 1.0f, 0.0f);
+ Color darkgreen = green.Darkened(0.2f); // 20% darker than regular green
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="inverted">
@@ -157,16 +140,22 @@
</return>
<description>
Returns the inverted color [code](1 - r, 1 - g, 1 - b, a)[/code].
- [codeblock]
- var c = Color(0.3, 0.4, 0.9)
- var inverted_color = c.inverted() # A color of an RGBA(178, 153, 26, 255)
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ var color = Color(0.3, 0.4, 0.9)
+ var inverted_color = color.inverted() # Equivalent to `Color(0.7, 0.6, 0.1)`
+ [/gdscript]
+ [csharp]
+ var color = new Color(0.3f, 0.4f, 0.9f);
+ Color invertedColor = color.Inverted(); // Equivalent to `new Color(0.7f, 0.6f, 0.1f)`
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="color" type="Color">
+ <argument index="0" name="to" type="Color">
</argument>
<description>
Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
@@ -175,17 +164,24 @@
<method name="lerp">
<return type="Color">
</return>
- <argument index="0" name="b" type="Color">
+ <argument index="0" name="to" type="Color">
</argument>
- <argument index="1" name="t" type="float">
+ <argument index="1" name="weight" type="float">
</argument>
<description>
Returns the linear interpolation with another color. The interpolation factor [code]t[/code] is between 0 and 1.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var c1 = Color(1.0, 0.0, 0.0)
var c2 = Color(0.0, 1.0, 0.0)
- var li_c = c1.lerp(c2, 0.5) # A color of an RGBA(128, 128, 0, 255)
- [/codeblock]
+ var lerp_color = c1.lerp(c2, 0.5) # Equivalent to `Color(0.5, 0.5, 0.0)`
+ [/gdscript]
+ [csharp]
+ var c1 = new Color(1.0f, 0.0f, 0.0f);
+ var c2 = new Color(0.0f, 1.0f, 0.0f);
+ Color lerpColor = c1.Lerp(c2, 0.5f); // Equivalent to `new Color(0.5f, 0.5f, 0.0f)`
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="lightened">
@@ -195,54 +191,184 @@
</argument>
<description>
Returns a new color resulting from making this color lighter by the specified percentage (ratio from 0 to 1).
- [codeblock]
+ [codeblocks]
+ [gdscript]
var green = Color(0.0, 1.0, 0.0)
var lightgreen = green.lightened(0.2) # 20% lighter than regular green
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var green = new Color(0.0f, 1.0f, 0.0f);
+ Color lightgreen = green.Lightened(0.2f); // 20% lighter than regular green
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
</description>
</method>
<method name="to_abgr32">
<return type="int">
</return>
<description>
- Returns the color's 32-bit integer in ABGR format (each byte represents a component of the ABGR profile). ABGR is the reversed version of the default format.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_abgr32()) # Prints 4281565439
- [/codeblock]
+ Returns the color converted to a 32-bit integer in ABGR format (each byte represents a color channel). ABGR is the reversed version of the default format.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_abgr32()) # Prints 4281565439
+ [/gdscript]
+ [csharp]
+ var color = new Color(1.0f, 0.5f, 0.2f);
+ GD.Print(color.ToAbgr32()); // Prints 4281565439
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_abgr64">
<return type="int">
</return>
<description>
- Returns the color's 64-bit integer in ABGR format (each word represents a component of the ABGR profile). ABGR is the reversed version of the default format.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_abgr64()) # Prints -225178692812801
- [/codeblock]
+ Returns the color converted to a 64-bit integer in ABGR format (each word represents a color channel). ABGR is the reversed version of the default format.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_abgr64()) # Prints -225178692812801
+ [/gdscript]
+ [csharp]
+ var color = new Color(1.0f, 0.5f, 0.2f);
+ GD.Print(color.ToAbgr64()); // Prints -225178692812801
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_argb32">
<return type="int">
</return>
<description>
- Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). ARGB is more compatible with DirectX.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_argb32()) # Prints 4294934323
- [/codeblock]
+ Returns the color converted to a 32-bit integer in ARGB format (each byte represents a color channel). ARGB is more compatible with DirectX.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_argb32()) # Prints 4294934323
+ [/gdscript]
+ [csharp]
+ var color = new Color(1.0f, 0.5f, 0.2f);
+ GD.Print(color.ToArgb32()); // Prints 4294934323
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_argb64">
<return type="int">
</return>
<description>
- Returns the color's 64-bit integer in ARGB format (each word represents a component of the ARGB profile). ARGB is more compatible with DirectX.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_argb64()) # Prints -2147470541
- [/codeblock]
+ Returns the color converted to a 64-bit integer in ARGB format (each word represents a color channel). ARGB is more compatible with DirectX.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_argb64()) # Prints -2147470541
+ [/gdscript]
+ [csharp]
+ var color = new Color(1.0f, 0.5f, 0.2f);
+ GD.Print(color.ToArgb64()); // Prints -2147470541
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_html">
@@ -251,35 +377,54 @@
<argument index="0" name="with_alpha" type="bool" default="true">
</argument>
<description>
- Returns the color's HTML hexadecimal color string in RGBA format (ex: [code]ff34f822[/code]).
+ Returns the color converted to an HTML hexadecimal color string in RGBA format (ex: [code]ff34f822[/code]).
Setting [code]with_alpha[/code] to [code]false[/code] excludes alpha from the hexadecimal string (and uses RGB instead of RGBA format).
- [codeblock]
- var c = Color(1, 1, 1, 0.5)
- var s1 = c.to_html() # Returns "ffffff7f"
- var s2 = c.to_html(false) # Returns "ffffff"
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 1, 1, 0.5)
+ var with_alpha = color.to_html() # Returns "ffffff7f"
+ var without_alpha = color.to_html(false) # Returns "ffffff"
+ [/gdscript]
+ [csharp]
+ var color = new Color(1, 1, 1, 0.5f);
+ String withAlpha = color.ToHtml(); // Returns "ffffff7f"
+ String withoutAlpha = color.ToHtml(false); // Returns "ffffff"
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_rgba32">
<return type="int">
</return>
<description>
- Returns the color's 32-bit integer in RGBA format (each byte represents a component of the RGBA profile). RGBA is Godot's default format.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_rgba32()) # Prints 4286526463
- [/codeblock]
+ Returns the color converted to a 32-bit integer in RGBA format (each byte represents a color channel). RGBA is Godot's default format.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_rgba32()) # Prints 4286526463
+ [/gdscript]
+ [csharp]
+ var color = new Color(1, 0.5f, 0.2f);
+ GD.Print(color.ToRgba32()); // Prints 4286526463
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="to_rgba64">
<return type="int">
</return>
<description>
- Returns the color's 64-bit integer in RGBA format (each word represents a component of the RGBA profile). RGBA is Godot's default format.
- [codeblock]
- var c = Color(1, 0.5, 0.2)
- print(c.to_rgba64()) # Prints -140736629309441
- [/codeblock]
+ Returns the color converted to a 64-bit integer in RGBA format (each word represents a color channel). RGBA is Godot's default format.
+ [codeblocks]
+ [gdscript]
+ var color = Color(1, 0.5, 0.2)
+ print(color.to_rgba64()) # Prints -140736629309441
+ [/gdscript]
+ [csharp]
+ var color = new Color(1, 0.5f, 0.2f);
+ GD.Print(color.ToRgba64()); // Prints -140736629309441
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml
index d8b4a8f76c..aea3542867 100644
--- a/doc/classes/ColorPicker.xml
+++ b/doc/classes/ColorPicker.xml
@@ -7,6 +7,7 @@
Displays a color picker widget. Useful for selecting a color from an RGB/RGBA colorspace.
</description>
<tutorials>
+ <link title="Tween Demo">https://godotengine.org/asset-library/asset/146</link>
</tutorials>
<methods>
<method name="add_preset">
diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml
index 67f64c8a66..c04e8b9ea0 100644
--- a/doc/classes/ColorPickerButton.xml
+++ b/doc/classes/ColorPickerButton.xml
@@ -5,8 +5,11 @@
</brief_description>
<description>
Encapsulates a [ColorPicker] making it accessible by pressing a button. Pressing the button will toggle the [ColorPicker] visibility.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
+ <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/133</link>
+ <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/517</link>
</tutorials>
<methods>
<method name="get_picker">
@@ -79,6 +82,9 @@
<theme_item name="font_color_pressed" type="Color" default="Color( 0.8, 0.8, 0.8, 1 )">
Text [Color] used when the [ColorPickerButton] is being pressed.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [ColorPickerButton]'s text.
+ </theme_item>
<theme_item name="hover" type="StyleBox">
[StyleBox] used when the [ColorPickerButton] is being hovered.
</theme_item>
diff --git a/doc/classes/ColorRect.xml b/doc/classes/ColorRect.xml
index 92f42b6dd3..09ba4c8b26 100644
--- a/doc/classes/ColorRect.xml
+++ b/doc/classes/ColorRect.xml
@@ -4,18 +4,24 @@
Colored rectangle.
</brief_description>
<description>
- Displays a colored rectangle.
+ Displays a rectangle filled with a solid [member color]. If you need to display the border alone, consider using [ReferenceRect] instead.
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
</methods>
<members>
- <member name="color" type="Color" setter="set_frame_color" getter="get_frame_color" default="Color( 1, 1, 1, 1 )">
+ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
The fill color.
- [codeblock]
+ [codeblocks]
+ [gdscript]
$ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red.
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GetNode&lt;ColorRect&gt;("ColorRect").Color = new Color(1, 0, 0, 1); // Set ColorRect's color to red.
+ [/csharp]
+ [/codeblocks]
</member>
</members>
<constants>
diff --git a/doc/classes/ConcavePolygonShape3D.xml b/doc/classes/ConcavePolygonShape3D.xml
index 20402d350a..3e83202472 100644
--- a/doc/classes/ConcavePolygonShape3D.xml
+++ b/doc/classes/ConcavePolygonShape3D.xml
@@ -8,6 +8,7 @@
Note: when used for collision, [ConcavePolygonShape3D] is intended to work with static [PhysicsBody3D] nodes like [StaticBody3D] and will not work with [KinematicBody3D] or [RigidBody3D] with a mode other than Static.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
<method name="get_faces" qualifiers="const">
diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml
index 522d484131..da17d993e3 100644
--- a/doc/classes/ConfigFile.xml
+++ b/doc/classes/ConfigFile.xml
@@ -13,7 +13,8 @@
[/codeblock]
The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly without accessing the filesystem.
The following example shows how to parse an INI-style file from the system, read its contents and store new values in it:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var config = ConfigFile.new()
var err = config.load("user://settings.cfg")
if err == OK: # If not, something went wrong with the file loading
@@ -24,7 +25,24 @@
config.set_value("audio", "mute", false)
# Save the changes by overwriting the previous file
config.save("user://settings.cfg")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var config = new ConfigFile();
+ Error err = config.Load("user://settings.cfg");
+ if (err == Error.Ok) // If not, something went wrong with the file loading
+ {
+ // Look for the display/width pair, and default to 1024 if missing
+ int screenWidth = (int)config.GetValue("display", "width", 1024);
+ // Store a variable if and only if it hasn't been defined yet
+ if (!config.HasSectionKey("audio", "mute"))
+ {
+ config.SetValue("audio", "mute", false);
+ }
+ // Save the changes by overwriting the previous file
+ config.Save("user://settings.cfg");
+ }
+ [/csharp]
+ [/codeblocks]
Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load.
ConfigFiles can also contain manually written comment lines starting with a semicolon ([code];[/code]). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action.
</description>
diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml
index 6d5871508b..9d8977cef1 100644
--- a/doc/classes/ConfirmationDialog.xml
+++ b/doc/classes/ConfirmationDialog.xml
@@ -6,14 +6,19 @@
<description>
Dialog for confirmation of actions. This dialog inherits from [AcceptDialog], but has by default an OK and Cancel button (in host OS order).
To get cancel action, you can use:
- [codeblock]
+ [codeblocks]
+ [gdscript]
get_cancel().connect("pressed", self, "cancelled")
- [/codeblock].
+ [/gdscript]
+ [csharp]
+ GetCancel().Connect("pressed", this, nameof(Cancelled));
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
<methods>
- <method name="get_cancel">
+ <method name="get_cancel_button">
<return type="Button">
</return>
<description>
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index c8e37d7d7b..14d44a2fbe 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -18,6 +18,7 @@
<tutorials>
<link title="GUI tutorial index">https://docs.godotengine.org/en/latest/tutorials/gui/index.html</link>
<link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
+ <link title="All GUI Demos">https://github.com/godotengine/godot-demo-projects/tree/master/gui</link>
</tutorials>
<methods>
<method name="_clips_input" qualifiers="virtual">
@@ -44,12 +45,27 @@
<description>
Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event].
Example: clicking a control.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func _gui_input(event):
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
print("I've been clicked D:")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _GuiInput(InputEvent @event)
+ {
+ if (@event is InputEventMouseButton)
+ {
+ var mb = @event as InputEventMouseButton;
+ if (mb.ButtonIndex == (int)ButtonList.Left &amp;&amp; mb.Pressed)
+ {
+ GD.Print("I've been clicked D:");
+ }
+ }
+ }
+ [/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];
@@ -59,28 +75,62 @@
</description>
</method>
<method name="_make_custom_tooltip" qualifiers="virtual">
- <return type="Object">
+ <return type="Control">
</return>
<argument index="0" name="for_text" type="String">
</argument>
<description>
- Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. Use [code]for_text[/code] parameter to determine what text the tooltip should contain (likely the contents of [member hint_tooltip]).
- The returned node must be of type [Control] or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When [code]null[/code] or non-Control node is returned, the default tooltip will be used instead.
+ Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [code]for_text[/code] includes the contents of the [member hint_tooltip] property.
+ 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 hint_tooltip] 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 rect_min_size] to some non-zero value.
- Example of usage with custom-constructed node:
- [codeblock]
+ [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.
+ Example of usage with a custom-constructed node:
+ [codeblocks]
+ [gdscript]
func _make_custom_tooltip(for_text):
var label = Label.new()
label.text = for_text
return label
- [/codeblock]
- Example of usage with custom scene instance:
- [codeblock]
+ [/gdscript]
+ [csharp]
+ public override Godot.Control _MakeCustomTooltip(String forText)
+ {
+ var label = new Label();
+ label.Text = forText;
+ return label;
+ }
+ [/csharp]
+ [/codeblocks]
+ Example of usage with a custom scene instance:
+ [codeblocks]
+ [gdscript]
func _make_custom_tooltip(for_text):
- var tooltip = preload("SomeTooltipScene.tscn").instance()
+ var tooltip = preload("res://SomeTooltipScene.tscn").instance()
tooltip.get_node("Label").text = for_text
return tooltip
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override Godot.Control _MakeCustomTooltip(String forText)
+ {
+ Node tooltip = ResourceLoader.Load&lt;PackedScene&gt;("res://SomeTooltipScene.tscn").Instance();
+ tooltip.GetNode&lt;Label&gt;("Label").Text = forText;
+ return tooltip;
+ }
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="_structured_text_parser" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="args" type="Array">
+ </argument>
+ <argument index="1" name="text" type="String">
+ </argument>
+ <description>
+ User defined BiDi algorithm override function.
+ Return [code]Array[/code] of [code]Vector2i[/code] text ranges, in the left-to-right order. Ranges should cover full source [code]text[/code] without overlaps. BiDi algorithm will be used on each range separately.
</description>
</method>
<method name="accept_event">
@@ -101,14 +151,22 @@
Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses.
[b]Note:[/b] Unlike other theme overrides, there is no way to undo a color override without manually assigning the previous color.
[b]Example of overriding a label's color and resetting it later:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Override the child node "MyLabel"'s font color to orange.
$MyLabel.add_theme_color_override("font_color", Color(1, 0.5, 0))
-
# Reset the color by creating a new node to get the default value:
var default_label_color = Label.new().get_theme_color("font_color")
$MyLabel.add_theme_color_override("font_color", default_label_color)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // Override the child node "MyLabel"'s font color to orange.
+ GetNode&lt;Label&gt;("MyLabel").AddThemeColorOverride("font_color", new Color(1, 0.5f, 0));
+ // Reset the color by creating a new node to get the default value:
+ var defaultLabelColor = new Label().GetThemeColor("font_color");
+ GetNode&lt;Label&gt;("MyLabel").AddThemeColorOverride("font_color", defaultLabelColor);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="add_theme_constant_override">
@@ -133,6 +191,17 @@
Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is [code]null[/code] or invalid, the override is cleared and the font from assigned [Theme] is used.
</description>
</method>
+ <method name="add_theme_font_size_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="font_size" type="int">
+ </argument>
+ <description>
+ Overrides the font size with given [code]name[/code] in the [member theme] resource the control uses. If [code]font_size[/code] is [code]-1[/code], the override is cleared and the font size from assigned [Theme] is used.
+ </description>
+ </method>
<method name="add_theme_icon_override">
<return type="void">
</return>
@@ -165,7 +234,8 @@
<description>
Overrides the [StyleBox] with given [code]name[/code] in the [member theme] resource the control uses. If [code]stylebox[/code] is empty or invalid, the override is cleared and the [StyleBox] from assigned [Theme] is used.
[b]Example of modifying a property in a StyleBox by duplicating it:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
# 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.
@@ -173,10 +243,21 @@
new_stylebox_normal.border_width_top = 3
new_stylebox_normal.border_color = Color(0, 1, 0.5)
$MyButton.add_theme_stylebox_override("normal", new_stylebox_normal)
-
# Remove the stylebox override:
$MyButton.add_theme_stylebox_override("normal", null)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // 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;
+ newStyleboxNormal.BorderWidthTop = 3;
+ newStyleboxNormal.BorderColor = new Color(0, 1, 0.5f);
+ GetNode&lt;Button&gt;("MyButton").AddThemeStyleboxOverride("normal", newStyleboxNormal);
+ // Remove the stylebox override:
+ GetNode&lt;Button&gt;("MyButton").AddThemeStyleboxOverride("normal", null);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="can_drop_data" qualifiers="virtual">
@@ -189,12 +270,22 @@
<description>
Godot calls this method to test if [code]data[/code] from a control's [method get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control.
This method should only be used to test the data. Process the data in [method drop_data].
- [codeblock]
+ [codeblocks]
+ [gdscript]
func can_drop_data(position, data):
# Check position if it is relevant to you
# Otherwise, just check data
return typeof(data) == TYPE_DICTIONARY and data.has("expected")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override bool CanDropData(Vector2 position, object data)
+ {
+ // Check position if it is relevant to you
+ // Otherwise, just check data
+ return data is Godot.Collections.Dictionary &amp;&amp; (data as Godot.Collections.Dictionary).Contains("expected");
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="drop_data" qualifiers="virtual">
@@ -206,13 +297,24 @@
</argument>
<description>
Godot calls this method to pass you the [code]data[/code] from a control's [method get_drag_data] result. Godot first calls [method can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func can_drop_data(position, data):
return typeof(data) == TYPE_DICTIONARY and data.has("color")
-
func drop_data(position, data):
- color = data["color"]
- [/codeblock]
+ var color = data["color"]
+ [/gdscript]
+ [csharp]
+ public override bool CanDropData(Vector2 position, object data)
+ {
+ return data is Godot.Collections.Dictionary &amp;&amp; (data as Godot.Collections.Dictionary).Contains("color");
+ }
+ public override void DropData(Vector2 position, object data)
+ {
+ Color color = (Color)(data as Godot.Collections.Dictionary)["color"];
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="force_drag">
@@ -267,12 +369,22 @@
<description>
Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method can_drop_data] and [method drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag].
A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func get_drag_data(position):
- var mydata = make_data()
- set_drag_preview(make_preview(mydata))
+ var mydata = make_data() # This is your custom method generating the drag data.
+ set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data.
return mydata
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override object GetDragData(Vector2 position)
+ {
+ object mydata = MakeData(); // This is your custom method generating the drag data.
+ SetDragPreview(MakePreview(mydata)); // This is your custom method generating the preview of the drag data.
+ return mydata;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_end" qualifiers="const">
@@ -282,13 +394,13 @@
Returns [member margin_right] and [member margin_bottom].
</description>
</method>
- <method name="get_focus_neighbour" qualifiers="const">
+ <method name="get_focus_neighbor" qualifiers="const">
<return type="NodePath">
</return>
<argument index="0" name="margin" type="int" enum="Margin">
</argument>
<description>
- Returns the focus neighbour identified by [code]margin[/code] constant from [enum Margin] enum. A getter method for [member focus_neighbour_bottom], [member focus_neighbour_left], [member focus_neighbour_right] and [member focus_neighbour_top].
+ Returns the focus neighbor identified by [code]margin[/code] constant from [enum Margin] enum. A getter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
</description>
</method>
<method name="get_focus_owner" qualifiers="const">
@@ -354,14 +466,22 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
- [codeblock]
+ Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
+ [codeblocks]
+ [gdscript]
func _ready():
modulate = get_theme_color("font_color", "Button") #get the color defined for button fonts
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ Modulate = GetThemeColor("font_color", "Button"); //get the color defined for button fonts
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_theme_constant" qualifiers="const">
@@ -369,10 +489,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
+ Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
</description>
</method>
<method name="get_theme_font" qualifiers="const">
@@ -380,10 +500,21 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
+ Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
+ </description>
+ </method>
+ <method name="get_theme_font_size" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
+ </argument>
+ <description>
+ Returns a font size from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
</description>
</method>
<method name="get_theme_icon" qualifiers="const">
@@ -391,10 +522,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
+ Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
</description>
</method>
<method name="get_theme_stylebox" qualifiers="const">
@@ -402,10 +533,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
+ Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
</description>
</method>
<method name="get_tooltip" qualifiers="const">
@@ -422,10 +553,18 @@
</return>
<description>
Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control acquires focus.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func _process(delta):
grab_click_focus() #when clicking another Control node, this node will be clicked instead
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _Process(float delta)
+ {
+ GrabClickFocus(); //when clicking another Control node, this node will be clicked instead
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="grab_focus">
@@ -458,10 +597,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_color_override" qualifiers="const">
@@ -478,10 +617,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_constant_override" qualifiers="const">
@@ -498,10 +637,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_font_override" qualifiers="const">
@@ -513,15 +652,35 @@
Returns [code]true[/code] if font with given [code]name[/code] has a valid override in this [Control] node.
</description>
</method>
+ <method name="has_theme_font_size" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
+ </argument>
+ <description>
+ Returns [code]true[/code] if font size with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ </description>
+ </method>
+ <method name="has_theme_font_size_override" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <description>
+ Returns [code]true[/code] if font size with given [code]name[/code] has a valid override in this [Control] node.
+ </description>
+ </method>
<method name="has_theme_icon" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_icon_override" qualifiers="const">
@@ -547,10 +706,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ <argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
- Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+ Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_stylebox_override" qualifiers="const">
@@ -562,11 +721,18 @@
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] has a valid override in this [Control] node.
</description>
</method>
+ <method name="is_layout_rtl" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if layout is right-to-left.
+ </description>
+ </method>
<method name="minimum_size_changed">
<return type="void">
</return>
<description>
- Invalidates the size cache in this node and in parent nodes up to toplevel. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member rect_min_size] directly calls this method automatically.
+ Invalidates the size cache in this node and in parent nodes up to top_level. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member rect_min_size] directly calls this method automatically.
</description>
</method>
<method name="release_focus">
@@ -652,24 +818,61 @@
Forwarding can be implemented in the target control similar to the methods [method get_drag_data], [method can_drop_data], and [method drop_data] but with two differences:
1. The function name must be suffixed with [b]_fw[/b]
2. The function must take an extra argument that is the control doing the forwarding
- [codeblock]
+ [codeblocks]
+ [gdscript]
# ThisControl.gd
extends Control
+ export(Control) var target_control
+
func _ready():
set_drag_forwarding(target_control)
# TargetControl.gd
extends Control
+
func can_drop_data_fw(position, data, from_control):
return true
func drop_data_fw(position, data, from_control):
- my_handle_data(data)
+ my_handle_data(data) # Your handler method.
func get_drag_data_fw(position, from_control):
set_drag_preview(my_preview)
return my_data()
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // ThisControl.cs
+ public class ThisControl : Control
+ {
+ [Export]
+ public Control TargetControl { get; set; }
+ public override void _Ready()
+ {
+ SetDragForwarding(TargetControl);
+ }
+ }
+
+ // TargetControl.cs
+ public class TargetControl : Control
+ {
+ public void CanDropDataFw(Vector2 position, object data, Control fromControl)
+ {
+ return true;
+ }
+
+ public void DropDataFw(Vector2 position, object data, Control fromControl)
+ {
+ MyHandleData(data); // Your handler method.
+ }
+
+ public void GetDragDataFw(Vector2 position, Control fromControl)
+ {
+ SetDragPreview(MyPreview);
+ return MyData();
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_drag_preview">
@@ -679,7 +882,8 @@
</argument>
<description>
Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree.
- [codeblock]
+ [codeblocks]
+ [gdscript]
export (Color, RGBA) var color = Color(1, 0, 0, 1)
func get_drag_data(position):
@@ -689,7 +893,22 @@
cpb.rect_size = Vector2(50, 50)
set_drag_preview(cpb)
return color
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ [Export]
+ public Color Color = new Color(1, 0, 0, 1);
+
+ public override object GetDragData(Vector2 position)
+ {
+ // Use a control that is not in the tree
+ var cpb = new ColorPickerButton();
+ cpb.Color = Color;
+ cpb.RectSize = new Vector2(50, 50);
+ SetDragPreview(cpb);
+ return Color;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_end">
@@ -701,15 +920,15 @@
Sets [member margin_right] and [member margin_bottom] at the same time.
</description>
</method>
- <method name="set_focus_neighbour">
+ <method name="set_focus_neighbor">
<return type="void">
</return>
<argument index="0" name="margin" type="int" enum="Margin">
</argument>
- <argument index="1" name="neighbour" type="NodePath">
+ <argument index="1" name="neighbor" type="NodePath">
</argument>
<description>
- Sets the anchor identified by [code]margin[/code] constant from [enum Margin] enum to [Control] at [code]neighbor[/code] node path. A setter method for [member focus_neighbour_bottom], [member focus_neighbour_left], [member focus_neighbour_right] and [member focus_neighbour_top].
+ Sets the anchor identified by [code]margin[/code] constant from [enum Margin] enum to [Control] at [code]neighbor[/code] node path. A setter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
</description>
</method>
<method name="set_global_position">
@@ -809,16 +1028,16 @@
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0">
The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals.
</member>
- <member name="focus_neighbour_bottom" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" default="NodePath(&quot;&quot;)">
+ <member name="focus_neighbor_bottom" type="NodePath" setter="set_focus_neighbor" getter="get_focus_neighbor" default="NodePath(&quot;&quot;)">
Tells Godot which node it should give keyboard focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the [code]ui_down[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
</member>
- <member name="focus_neighbour_left" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" default="NodePath(&quot;&quot;)">
+ <member name="focus_neighbor_left" type="NodePath" setter="set_focus_neighbor" getter="get_focus_neighbor" default="NodePath(&quot;&quot;)">
Tells Godot which node it should give keyboard focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the [code]ui_left[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the left of this one.
</member>
- <member name="focus_neighbour_right" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" default="NodePath(&quot;&quot;)">
+ <member name="focus_neighbor_right" type="NodePath" setter="set_focus_neighbor" getter="get_focus_neighbor" default="NodePath(&quot;&quot;)">
Tells Godot which node it should give keyboard focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [code]ui_right[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
</member>
- <member name="focus_neighbour_top" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" default="NodePath(&quot;&quot;)">
+ <member name="focus_neighbor_top" type="NodePath" setter="set_focus_neighbor" getter="get_focus_neighbor" default="NodePath(&quot;&quot;)">
Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [code]ui_top[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
</member>
<member name="focus_next" type="NodePath" setter="set_focus_next" getter="get_focus_next" default="NodePath(&quot;&quot;)">
@@ -837,6 +1056,28 @@
</member>
<member name="hint_tooltip" type="String" setter="set_tooltip" getter="_get_tooltip" default="&quot;&quot;">
Changes the 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]. You can change the time required for the tooltip to appear with [code]gui/timers/tooltip_delay_sec[/code] option in Project Settings.
+ 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:
+ [codeblocks]
+ [gdscript]
+ var style_box = StyleBoxFlat.new()
+ style_box.set_bg_color(Color(1, 1, 0))
+ style_box.set_border_width_all(2)
+ # We assume here that the `theme` property has been assigned a custom Theme beforehand.
+ theme.set_stylebox("panel", "TooltipPanel", style_box)
+ theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1))
+ [/gdscript]
+ [csharp]
+ var styleBox = new StyleBoxFlat();
+ styleBox.SetBgColor(new Color(1, 1, 0));
+ styleBox.SetBorderWidthAll(2);
+ // We assume here that the `Theme` property has been assigned a custom Theme beforehand.
+ Theme.SetStyleBox("panel", "TooltipPanel", styleBox);
+ Theme.SetColor("font_color", "TooltipLabel", new Color(0, 1, 1));
+ [/csharp]
+ [/codeblocks]
+ </member>
+ <member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" enum="Control.LayoutDirection" default="0">
+ Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
</member>
<member name="margin_bottom" type="float" setter="set_margin" getter="get_margin" default="0.0">
Distance between the node's bottom edge and its parent control, based on [member anchor_bottom].
@@ -891,7 +1132,7 @@
Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
</member>
<member name="size_flags_stretch_ratio" type="float" setter="set_stretch_ratio" getter="get_stretch_ratio" default="1.0">
- If the node and at least one of its neighbours uses the [constant SIZE_EXPAND] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space.
+ If the node and at least one of its neighbors uses the [constant SIZE_EXPAND] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space.
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" default="1">
Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
@@ -982,6 +1223,9 @@
<constant name="NOTIFICATION_SCROLL_END" value="48">
Sent when this node is inside a [ScrollContainer] which has stopped being scrolled.
</constant>
+ <constant name="NOTIFICATION_LAYOUT_DIRECTION_CHANGED" value="49">
+ Sent when control layout direction is changed.
+ </constant>
<constant name="CURSOR_ARROW" value="0" enum="CursorShape">
Show the system's arrow mouse cursor when the user hovers the node. Use with [member mouse_default_cursor_shape].
</constant>
@@ -1132,5 +1376,51 @@
<constant name="ANCHOR_END" value="1" enum="Anchor">
Snaps one of the 4 anchor's sides to the end of the node's [code]Rect[/code], in the bottom right. Use it with one of the [code]anchor_*[/code] member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset].
</constant>
+ <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">
+ Automatic layout direction, determined from the current locale.
+ </constant>
+ <constant name="LAYOUT_DIRECTION_LTR" value="2" enum="LayoutDirection">
+ Left-to-right layout direction.
+ </constant>
+ <constant name="LAYOUT_DIRECTION_RTL" value="3" enum="LayoutDirection">
+ Right-to-left layout direction.
+ </constant>
+ <constant name="TEXT_DIRECTION_INHERITED" value="3" enum="TextDirection">
+ Text writing direction is the same as layout direction.
+ </constant>
+ <constant name="TEXT_DIRECTION_AUTO" value="0" enum="TextDirection">
+ Automatic text writing direction, determined from the current locale and text content.
+ </constant>
+ <constant name="TEXT_DIRECTION_LTR" value="1" enum="TextDirection">
+ Left-to-right text writing direction.
+ </constant>
+ <constant name="TEXT_DIRECTION_RTL" value="2" enum="TextDirection">
+ Right-to-left text writing direction.
+ </constant>
+ <constant name="STRUCTURED_TEXT_DEFAULT" value="0" enum="StructuredTextParser">
+ Use default behavior. Same as [code]STRUCTURED_TEXT_NONE[/code] unless specified otherwise in the control description.
+ </constant>
+ <constant name="STRUCTURED_TEXT_URI" value="1" enum="StructuredTextParser">
+ BiDi override for URI.
+ </constant>
+ <constant name="STRUCTURED_TEXT_FILE" value="2" enum="StructuredTextParser">
+ BiDi override for file path.
+ </constant>
+ <constant name="STRUCTURED_TEXT_EMAIL" value="3" enum="StructuredTextParser">
+ BiDi override for email.
+ </constant>
+ <constant name="STRUCTURED_TEXT_LIST" value="4" enum="StructuredTextParser">
+ BiDi override for lists.
+ Structured text options: list separator [code]String[/code].
+ </constant>
+ <constant name="STRUCTURED_TEXT_NONE" value="5" enum="StructuredTextParser">
+ Use default Unicode BiDi algorithm.
+ </constant>
+ <constant name="STRUCTURED_TEXT_CUSTOM" value="6" enum="StructuredTextParser">
+ User defined structured text BiDi override function.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/ConvexPolygonShape3D.xml b/doc/classes/ConvexPolygonShape3D.xml
index c036f80e2d..e18d716255 100644
--- a/doc/classes/ConvexPolygonShape3D.xml
+++ b/doc/classes/ConvexPolygonShape3D.xml
@@ -7,6 +7,7 @@
Convex polygon shape resource, which can be added to a [PhysicsBody3D] or area.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml
index 4edb3eda0a..1f6cb40cde 100644
--- a/doc/classes/Crypto.xml
+++ b/doc/classes/Crypto.xml
@@ -6,13 +6,12 @@
<description>
The Crypto class allows you to access some more advanced cryptographic functionalities in Godot.
For now, this includes generating cryptographically secure random bytes, RSA keys and self-signed X509 certificates generation, asymmetric key encryption/decryption, and signing/verification.
- [codeblock]
+ [codeblocks]
+ [gdscript]
extends Node
-
var crypto = Crypto.new()
var key = CryptoKey.new()
var cert = X509Certificate.new()
-
func _ready():
# Generate new RSA key.
key = crypto.generate_rsa(4096)
@@ -33,12 +32,59 @@
# Checks
assert(verified)
assert(data.to_utf8() == decrypted)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+ using System.Diagnostics;
+
+ public class CryptoNode : Node
+ {
+ public Crypto Crypto = new Crypto();
+ public CryptoKey Key = new CryptoKey();
+ public X509Certificate Cert = new X509Certificate();
+ public override void _Ready()
+ {
+ // Generate new RSA key.
+ Key = Crypto.GenerateRsa(4096);
+ // Generate new self-signed certificate with the given key.
+ Cert = Crypto.GenerateSelfSignedCertificate(Key, "CN=mydomain.com,O=My Game Company,C=IT");
+ // Save key and certificate in the user folder.
+ Key.Save("user://generated.key");
+ Cert.Save("user://generated.crt");
+ // Encryption
+ string data = "Some data";
+ byte[] encrypted = Crypto.Encrypt(Key, data.ToUTF8());
+ // Decryption
+ byte[] decrypted = Crypto.Decrypt(Key, encrypted);
+ // Signing
+ byte[] signature = Crypto.Sign(HashingContext.HashType.Sha256, Data.SHA256Buffer(), Key);
+ // Verifying
+ bool verified = Crypto.Verify(HashingContext.HashType.Sha256, Data.SHA256Buffer(), signature, Key);
+ // Checks
+ Debug.Assert(verified);
+ Debug.Assert(data.ToUTF8() == decrypted);
+ }
+ }
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] Not available in HTML5 exports.
</description>
<tutorials>
</tutorials>
<methods>
+ <method name="constant_time_compare">
+ <return type="bool">
+ </return>
+ <argument index="0" name="trusted" type="PackedByteArray">
+ </argument>
+ <argument index="1" name="received" type="PackedByteArray">
+ </argument>
+ <description>
+ Compares two [PackedByteArray]s for equality without leaking timing information in order to prevent timing attacks.
+ See [url=https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy]this blog post[/url] for more information.
+ </description>
+ </method>
<method name="decrypt">
<return type="PackedByteArray">
</return>
@@ -95,13 +141,36 @@
<description>
Generates a self-signed [X509Certificate] from the given [CryptoKey] and [code]issuer_name[/code]. The certificate validity will be defined by [code]not_before[/code] and [code]not_after[/code] (first valid date and last valid date). The [code]issuer_name[/code] must contain at least "CN=" (common name, i.e. the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered ISO-3166 code of the country the organization is based in).
A small example to generate an RSA key and a X509 self-signed certificate.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var crypto = Crypto.new()
# Generate 4096 bits RSA key.
var key = crypto.generate_rsa(4096)
# Generate self-signed certificate using the given key.
var cert = crypto.generate_self_signed_certificate(key, "CN=example.com,O=A Game Company,C=IT")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var crypto = new Crypto();
+ // Generate 4096 bits RSA key.
+ CryptoKey key = crypto.GenerateRsa(4096);
+ // Generate self-signed certificate using the given key.
+ X509Certificate cert = crypto.GenerateSelfSignedCertificate(key, "CN=mydomain.com,O=My Game Company,C=IT");
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="hmac_digest">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="hash_type" type="int" enum="HashingContext.HashType">
+ </argument>
+ <argument index="1" name="key" type="PackedByteArray">
+ </argument>
+ <argument index="2" name="msg" type="PackedByteArray">
+ </argument>
+ <description>
+ Generates an [url=https://en.wikipedia.org/wiki/HMAC]HMAC[/url] digest of [code]msg[/code] using [code]key[/code]. The [code]hash_type[/code] parameter is the hashing algorithm that is used for the inner and outer hashes.
+ Currently, only [constant HashingContext.HASH_SHA256] and [constant HashingContext.HASH_SHA1] are supported.
</description>
</method>
<method name="sign">
diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml
index 8ac6258e97..2d50d98a74 100644
--- a/doc/classes/Curve2D.xml
+++ b/doc/classes/Curve2D.xml
@@ -80,7 +80,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
+ Returns the position of the control point leading to the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
</description>
</method>
<method name="get_point_out" qualifiers="const">
@@ -89,7 +89,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
+ Returns the position of the control point leading out of the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0)[/code].
</description>
</method>
<method name="get_point_position" qualifiers="const">
@@ -152,7 +152,7 @@
<argument index="1" name="position" type="Vector2">
</argument>
<description>
- Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
+ Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<method name="set_point_out">
@@ -163,7 +163,7 @@
<argument index="1" name="position" type="Vector2">
</argument>
<description>
- Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
+ Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<method name="set_point_position">
diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml
index fe454d90cc..bda04f010b 100644
--- a/doc/classes/Curve3D.xml
+++ b/doc/classes/Curve3D.xml
@@ -95,7 +95,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
+ Returns the position of the control point leading to the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
</description>
</method>
<method name="get_point_out" qualifiers="const">
@@ -104,7 +104,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
+ Returns the position of the control point leading out of the vertex [code]idx[/code]. The returned position is relative to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console, and returns [code](0, 0, 0)[/code].
</description>
</method>
<method name="get_point_position" qualifiers="const">
@@ -145,7 +145,7 @@
<argument index="1" name="cubic" type="bool" default="false">
</argument>
<description>
- Returns a point within the curve at position [code]offset[/code], where [code]offset[/code] is measured as a pixel distance along the curve.
+ Returns a point within the curve at position [code]offset[/code], where [code]offset[/code] is measured as a distance in 3D units along the curve.
To do that, it finds the two cached points where the [code]offset[/code] lies between, then interpolates the values. This interpolation is cubic if [code]cubic[/code] is set to [code]true[/code], or linear if set to [code]false[/code].
Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough).
</description>
@@ -189,7 +189,7 @@
<argument index="1" name="position" type="Vector3">
</argument>
<description>
- Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
+ Sets the position of the control point leading to the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<method name="set_point_out">
@@ -200,7 +200,7 @@
<argument index="1" name="position" type="Vector3">
</argument>
<description>
- Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console.
+ Sets the position of the control point leading out of the vertex [code]idx[/code]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex.
</description>
</method>
<method name="set_point_position">
diff --git a/doc/classes/CylinderShape3D.xml b/doc/classes/CylinderShape3D.xml
index eb12568e71..99334ceae6 100644
--- a/doc/classes/CylinderShape3D.xml
+++ b/doc/classes/CylinderShape3D.xml
@@ -7,6 +7,9 @@
Cylinder shape for collisions.
</description>
<tutorials>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml
index 8c71b61553..91a04b1f28 100644
--- a/doc/classes/DTLSServer.xml
+++ b/doc/classes/DTLSServer.xml
@@ -6,8 +6,9 @@
<description>
This class is used to store the state of a DTLS server. Upon [method setup] it converts connected [PacketPeerUDP] to [PacketPeerDTLS] accepting them via [method take_connection] as DTLS clients. Under the hood, this class is used to store the DTLS state and cookies of the server. The reason of why the state and cookies are needed is outside of the scope of this documentation.
Below a small example of how to use it:
- [codeblock]
- # server.gd
+ [codeblocks]
+ [gdscript]
+ # ServerNode.gd
extends Node
var dtls := DTLSServer.new()
@@ -28,15 +29,64 @@
continue # It is normal that 50% of the connections fails due to cookie exchange.
print("Peer connected!")
peers.append(dtls_peer)
+
for p in peers:
p.poll() # Must poll to update the state.
if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED:
while p.get_available_packet_count() &gt; 0:
print("Received message from client: %s" % p.get_packet().get_string_from_utf8())
p.put_packet("Hello DTLS client".to_utf8())
- [/codeblock]
- [codeblock]
- # client.gd
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+ // ServerNode.cs
+ public class ServerNode : Node
+ {
+ public DTLSServer Dtls = new DTLSServer();
+ public UDPServer Server = new UDPServer();
+ public Godot.Collections.Array&lt;PacketPeerDTLS&gt; Peers = new Godot.Collections.Array&lt;PacketPeerDTLS&gt;();
+ public override void _Ready()
+ {
+ Server.Listen(4242);
+ var key = GD.Load&lt;CryptoKey&gt;("key.key"); // Your private key.
+ var cert = GD.Load&lt;X509Certificate&gt;("cert.crt"); // Your X509 certificate.
+ Dtls.Setup(key, cert);
+ }
+
+ public override void _Process(float delta)
+ {
+ while (Server.IsConnectionAvailable())
+ {
+ PacketPeerUDP peer = Server.TakeConnection();
+ PacketPeerDTLS dtlsPeer = Dtls.TakeConnection(peer);
+ if (dtlsPeer.GetStatus() != PacketPeerDTLS.Status.Handshaking)
+ {
+ continue; // It is normal that 50% of the connections fails due to cookie exchange.
+ }
+ GD.Print("Peer connected!");
+ Peers.Add(dtlsPeer);
+ }
+
+ foreach (var p in Peers)
+ {
+ p.Poll(); // Must poll to update the state.
+ if (p.GetStatus() == PacketPeerDTLS.Status.Connected)
+ {
+ while (p.GetAvailablePacketCount() &gt; 0)
+ {
+ GD.Print("Received Message From Client: " + p.GetPacket().GetStringFromUTF8());
+ p.PutPacket("Hello Dtls Client".ToUTF8());
+ }
+ }
+ }
+ }
+ }
+ [/csharp]
+ [/codeblocks]
+ [codeblocks]
+ [gdscript]
+ # ClientNode.gd
extends Node
var dtls := PacketPeerDTLS.new()
@@ -56,7 +106,42 @@
while dtls.get_available_packet_count() &gt; 0:
print("Connected: %s" % dtls.get_packet().get_string_from_utf8())
connected = true
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System.Text;
+ // ClientNode.cs
+ public class ClientNode : Node
+ {
+ public PacketPeerDTLS Dtls = new PacketPeerDTLS();
+ public PacketPeerUDP Udp = new PacketPeerUDP();
+ public bool Connected = false;
+ public override void _Ready()
+ {
+ Udp.ConnectToHost("127.0.0.1", 4242);
+ Dtls.ConnectToPeer(Udp, false); // Use true in production for certificate validation!
+ }
+
+ public override void _Process(float delta)
+ {
+ Dtls.Poll();
+ if (Dtls.GetStatus() == PacketPeerDTLS.Status.Connected)
+ {
+ if (!Connected)
+ {
+ // Try to contact server
+ Dtls.PutPacket("The Answer Is..42!".ToUTF8());
+ }
+ while (Dtls.GetAvailablePacketCount() &gt; 0)
+ {
+ GD.Print("Connected: " + Dtls.GetPacket().GetStringFromUTF8());
+ Connected = true;
+ }
+ }
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml
index f9baa3b09a..8107d97b67 100644
--- a/doc/classes/Decal.xml
+++ b/doc/classes/Decal.xml
@@ -20,10 +20,18 @@
Returns the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]albedo_tex = $Decal.get_texture(Decal.TEXTURE_ALBEDO)[/code], use [code]albedo_tex = $Decal.texture_albedo[/code].
One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
for i in Decal.TEXTURE_MAX:
$NewDecal.set_texture(i, $OldDecal.get_texture(i))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ for (int i = 0; i &lt; (int)Decal.DecalTexture.Max; i++)
+ {
+ GetNode&lt;Decal&gt;("NewDecal").SetTexture(i, GetNode&lt;Decal&gt;("OldDecal").GetTexture(i));
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_texture">
@@ -37,10 +45,18 @@
Sets the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]$Decal.set_texture(Decal.TEXTURE_ALBEDO, albedo_tex)[/code], use [code]$Decal.texture_albedo = albedo_tex[/code].
One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
for i in Decal.TEXTURE_MAX:
$NewDecal.set_texture(i, $OldDecal.get_texture(i))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ for (int i = 0; i &lt; (int)Decal.DecalTexture.Max; i++)
+ {
+ GetNode&lt;Decal&gt;("NewDecal").SetTexture(i, GetNode&lt;Decal&gt;("OldDecal").GetTexture(i));
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index 7123deb206..cd0b5ac027 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -9,73 +9,196 @@
Erasing elements while iterating over them [b]is not supported[/b] and will result in undefined behavior.
[b]Note:[/b] Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use [method duplicate].
Creating a dictionary:
- [codeblock]
- var my_dir = {} # Creates an empty dictionary.
- var points_dir = {"White": 50, "Yellow": 75, "Orange": 100}
- var another_dir = {
- key1: value1,
- key2: value2,
- key3: value3,
+ [codeblocks]
+ [gdscript]
+ var my_dict = {} # Creates an empty dictionary.
+
+ var dict_variable_key = "Another key name"
+ var dict_variable_value = "value2"
+ var another_dict = {
+ "Some key name": "value1",
+ dict_variable_key: dict_variable_value,
}
- [/codeblock]
- You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dir["White"][/code] will return [code]50[/code]. You can also write [code]points_dir.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable).
- [codeblock]
- export(String, "White", "Yellow", "Orange") var my_color
- var points_dir = {"White": 50, "Yellow": 75, "Orange": 100}
+ var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
+
+ # Alternative Lua-style syntax.
+ # Doesn't require quotes around keys, but only string constants can be used as key names.
+ # Additionally, key names must start with a letter or an underscore.
+ # Here, `some_key` is a string literal, not a variable!
+ another_dict = {
+ some_key = 42,
+ }
+ [/gdscript]
+ [csharp]
+ var myDict = new Godot.Collections.Dictionary(); // Creates an empty dictionary.
+ var pointsDict = new Godot.Collections.Dictionary
+ {
+ {"White", 50},
+ {"Yellow", 75},
+ {"Orange", 100}
+ };
+ [/csharp]
+ [/codeblocks]
+ You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dir["White"][/code] will return [code]50[/code]. You can also write [code]points_dir.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable).
+ [codeblocks]
+ [gdscript]
+ export(string, "White", "Yellow", "Orange") var my_color
+ var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
func _ready():
# We can't use dot syntax here as `my_color` is a variable.
- var points = points_dir[my_color]
- [/codeblock]
+ var points = points_dict[my_color]
+ [/gdscript]
+ [csharp]
+ [Export(PropertyHint.Enum, "White,Yellow,Orange")]
+ public string MyColor { get; set; }
+ public Godot.Collections.Dictionary pointsDict = new Godot.Collections.Dictionary
+ {
+ {"White", 50},
+ {"Yellow", 75},
+ {"Orange", 100}
+ };
+
+ public override void _Ready()
+ {
+ int points = (int)pointsDict[MyColor];
+ }
+ [/csharp]
+ [/codeblocks]
In the above code, [code]points[/code] will be assigned the value that is paired with the appropriate color selected in [code]my_color[/code].
Dictionaries can contain more complex data:
- [codeblock]
- my_dir = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key.
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ my_dict = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key.
+ [/gdscript]
+ [csharp]
+ var myDir = new Godot.Collections.Dictionary
+ {
+ {"First Array", new Godot.Collections.Array{1, 2, 3, 4}}
+ };
+ [/csharp]
+ [/codeblocks]
To add a key to an existing dictionary, access it like an existing key and assign to it:
- [codeblock]
- var points_dir = {"White": 50, "Yellow": 75, "Orange": 100}
- points_dir["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value.
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
+ points_dict["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value.
+ [/gdscript]
+ [csharp]
+ var pointsDir = new Godot.Collections.Dictionary
+ {
+ {"White", 50},
+ {"Yellow", 75},
+ {"Orange", 100}
+ };
+ pointsDict["blue"] = 150; // Add "Blue" as a key and assign 150 as its value.
+ [/csharp]
+ [/codeblocks]
Finally, dictionaries can contain different types of keys and values in the same dictionary:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# This is a valid dictionary.
# To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`.
# Indexing styles can be mixed and matched depending on your needs.
- var my_dir = {
+ var my_dict = {
"String Key": 5,
4: [1, 2, 3],
7: "Hello",
- "sub_dir": {"sub_key": "Nested value"},
+ "sub_dict": {"sub_key": "Nested value"},
}
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // This is a valid dictionary.
+ // To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`.
+ // Indexing styles can be mixed and matched depending on your needs.
+ var myDict = new Godot.Collections.Dictionary {
+ {"String Key", 5},
+ {4, new Godot.Collections.Array{1,2,3}},
+ {7, "Hello"},
+ {"sub_dict", new Godot.Collections.Dictionary{{"sub_key", "Nested value"}}}
+ };
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] Unlike [Array]s, you can't compare dictionaries directly:
- [codeblock]
- array1 = [1, 2, 3]
- array2 = [1, 2, 3]
+ [codeblocks]
+ [gdscript]
+ var array1 = [1, 2, 3]
+ var array2 = [1, 2, 3]
func compare_arrays():
print(array1 == array2) # Will print true.
- dir1 = {"a": 1, "b": 2, "c": 3}
- dir2 = {"a": 1, "b": 2, "c": 3}
+ var dict1 = {"a": 1, "b": 2, "c": 3}
+ var dict2 = {"a": 1, "b": 2, "c": 3}
func compare_dictionaries():
- print(dir1 == dir2) # Will NOT print true.
- [/codeblock]
+ print(dict1 == dict2) # Will NOT print true.
+ [/gdscript]
+ [csharp]
+ // You have to use GD.Hash().
+
+ public Godot.Collections.Array array1 = new Godot.Collections.Array{1, 2, 3};
+ public Godot.Collections.Array array2 = new Godot.Collections.Array{1, 2, 3};
+
+ public void CompareArrays()
+ {
+ GD.Print(array1 == array2); // Will print FALSE!!
+ GD.Print(GD.Hash(array1) == GD.Hash(array2)); // Will print true.
+ }
+
+ public Godot.Collections.Dictionary dict1 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}};
+ public Godot.Collections.Dictionary dict2 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}};
+
+ public void CompareDictionaries()
+ {
+ GD.Print(dict1 == dict2); // Will NOT print true.
+ }
+ [/csharp]
+ [/codeblocks]
You need to first calculate the dictionary's hash with [method hash] before you can compare them:
- [codeblock]
- dir1 = {"a": 1, "b": 2, "c": 3}
- dir2 = {"a": 1, "b": 2, "c": 3}
+ [codeblocks]
+ [gdscript]
+ var dict1 = {"a": 1, "b": 2, "c": 3}
+ var dict2 = {"a": 1, "b": 2, "c": 3}
func compare_dictionaries():
- print(dir1.hash() == dir2.hash()) # Will print true.
- [/codeblock]
+ print(dict1.hash() == dict2.hash()) # Will print true.
+ [/gdscript]
+ [csharp]
+ // You have to use GD.Hash().
+ public Godot.Collections.Dictionary dict1 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}};
+ public Godot.Collections.Dictionary dict2 = new Godot.Collections.Dictionary{{"a", 1}, {"b", 2}, {"c", 3}};
+
+ public void CompareDictionaries()
+ {
+ GD.Print(GD.Hash(dict1) == GD.Hash(dict2)); // Will print true.
+ }
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] When declaring a dictionary with [code]const[/code], the dictionary itself can still be mutated by defining the values of individual keys. Using [code]const[/code] will only prevent assigning the constant with another value after it was initialized.
</description>
<tutorials>
<link title="GDScript basics: Dictionary">https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#dictionary</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
+ <method name="Dictionary" qualifiers="constructor">
+ <return type="Dictionary">
+ </return>
+ <description>
+ Constructs an empty [Dictionary].
+ </description>
+ </method>
+ <method name="Dictionary" qualifiers="constructor">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="from" type="Dictionary">
+ </argument>
+ <description>
+ Constructs a [Dictionary] as a copy of the given [Dictionary].
+ </description>
+ </method>
<method name="clear">
<return type="void">
</return>
@@ -127,11 +250,20 @@
<description>
Returns [code]true[/code] if the dictionary has a given key.
[b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Will evaluate to `true`.
if "godot" in {"godot": "engine"}:
pass
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // You have to use Contains() here as an alternative to GDScript's `in` operator.
+ if (new Godot.Collections.Dictionary{{"godot", "engine"}}.Contains("godot"))
+ {
+ // I am executed.
+ }
+ [/csharp]
+ [/codeblocks]
This method (like the [code]in[/code] operator) will evaluate to [code]true[/code] as long as the key exists, even if the associated value is [code]null[/code].
</description>
</method>
@@ -149,12 +281,21 @@
</return>
<description>
Returns a hashed integer value representing the dictionary contents. This can be used to compare dictionaries by value:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var dict1 = {0: 10}
var dict2 = {0: 10}
# The line below prints `true`, whereas it would have printed `false` if both variables were compared directly.
print(dict1.hash() == dict2.hash())
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var dict1 = new Godot.Collections.Dictionary{{0, 10}};
+ var dict2 = new Godot.Collections.Dictionary{{0, 10}};
+ // The line below prints `true`, whereas it would have printed `false` if both variables were compared directly.
+ // Dictionary has no Hash() method. Use GD.Hash() instead.
+ GD.Print(GD.Hash(dict1) == GD.Hash(dict2));
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] Dictionaries with the same keys/values but in a different order will have a different hash.
</description>
</method>
@@ -165,11 +306,35 @@
Returns the list of keys in the [Dictionary].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Dictionary">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Dictionary">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="key" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="size">
<return type="int">
</return>
<description>
- Returns the size of the dictionary (in pairs).
+ Returns the number of keys in the dictionary.
</description>
</method>
<method name="values">
diff --git a/doc/classes/DirectionalLight2D.xml b/doc/classes/DirectionalLight2D.xml
new file mode 100644
index 0000000000..a6eb780159
--- /dev/null
+++ b/doc/classes/DirectionalLight2D.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="DirectionalLight2D" inherits="Light2D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="height" type="float" setter="set_height" getter="get_height" default="0.0">
+ The height of the light. Used with 2D normal mapping.
+ </member>
+ <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="10000.0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml
index afd85a9cb7..233b1f0c16 100644
--- a/doc/classes/DirectionalLight3D.xml
+++ b/doc/classes/DirectionalLight3D.xml
@@ -41,6 +41,9 @@
</member>
<member name="shadow_bias" type="float" setter="set_param" getter="get_param" override="true" default="0.05" />
<member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" override="true" default="1.0" />
+ <member name="use_in_sky_only" type="bool" setter="set_sky_only" getter="is_sky_only" default="false">
+ If [code]true[/code], this [DirectionalLight3D] will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon.
+ </member>
</members>
<constants>
<constant name="SHADOW_ORTHOGONAL" value="0" enum="ShadowMode">
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml
index bcdadcd970..2d7292717d 100644
--- a/doc/classes/Directory.xml
+++ b/doc/classes/Directory.xml
@@ -7,7 +7,8 @@
Directory type. It is used to manage directories and their content (not restricted to the project folder).
When creating a new [Directory], it must be explicitly opened using [method open] before most methods can be used. However, [method file_exists] and [method dir_exists] can be used without opening a directory. If so, they use a path relative to [code]res://[/code].
Here is an example on how to iterate through the files of a directory:
- [codeblock]
+ [codeblocks]
+ [gdscript]
func dir_contents(path):
var dir = Directory.new()
if dir.open(path) == OK:
@@ -21,7 +22,35 @@
file_name = dir.get_next()
else:
print("An error occurred when trying to access the path.")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public void DirContents(string path)
+ {
+ var dir = new Directory();
+ if (dir.Open(path) == Error.Ok)
+ {
+ dir.ListDirBegin();
+ string fileName = dir.GetNext();
+ while (fileName != "")
+ {
+ if (dir.CurrentIsDir())
+ {
+ GD.Print("Found directory: " + fileName);
+ }
+ else
+ {
+ GD.Print("Found file: " + fileName);
+ }
+ fileName = dir.GetNext();
+ }
+ }
+ else
+ {
+ GD.Print("An error occurred when trying to access the path.");
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
<link title="File system">https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link>
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 28194587ab..d91ea6528a 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -521,6 +521,18 @@
<argument index="0" name="screen" type="int" default="-1">
</argument>
<description>
+ Returns the dots per inch density of the specified screen. If [code]screen[/code] is [/code]SCREEN_OF_MAIN_WINDOW[/code] (the default value), a screen with the main window will be used.
+ [b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used.
+ [b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
+ [codeblock]
+ ldpi - 120 dpi
+ mdpi - 160 dpi
+ hdpi - 240 dpi
+ xhdpi - 320 dpi
+ xxhdpi - 480 dpi
+ xxxhdpi - 640 dpi
+ [/codeblock]
+ [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms.
</description>
</method>
<method name="screen_get_max_scale" qualifiers="const">
@@ -911,7 +923,8 @@
<description>
Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Set region, using Path2D node.
DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
@@ -920,7 +933,18 @@
# Reset region to default.
DisplayServer.window_set_mouse_passthrough([])
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // Set region, using Path2D node.
+ DisplayServer.WindowSetMousePassthrough(GetNode&lt;Path2D&gt;("Path2D").Curve.GetBakedPoints());
+
+ // Set region, using Polygon2D node.
+ DisplayServer.WindowSetMousePassthrough(GetNode&lt;Polygon2D&gt;("Polygon2D").Polygon);
+
+ // Reset region to default.
+ DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
@@ -1096,6 +1120,8 @@
<constant name="WINDOW_MODE_MAXIMIZED" value="2" enum="WindowMode">
</constant>
<constant name="WINDOW_MODE_FULLSCREEN" value="3" enum="WindowMode">
+ Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
+ Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
</constant>
<constant name="WINDOW_FLAG_RESIZE_DISABLED" value="0" enum="WindowFlags">
</constant>
diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml
deleted file mode 100644
index b0635892be..0000000000
--- a/doc/classes/DynamicFont.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="DynamicFont" inherits="Font" version="4.0">
- <brief_description>
- DynamicFont renders vector font files at runtime.
- </brief_description>
- <description>
- DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallback fonts, which will be used when displaying a character not supported by the main font.
- DynamicFont uses the [url=https://www.freetype.org/]FreeType[/url] library for rasterization.
- [codeblock]
- var dynamic_font = DynamicFont.new()
- dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf")
- dynamic_font.size = 64
- $"Label".set("custom_fonts/font", dynamic_font)
- [/codeblock]
- [b]Note:[/b] DynamicFont doesn't support features such as kerning, right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use [url=https://fontforge.org/]FontForge[/url] to do so. In FontForge, use [b]File &gt; Generate Fonts[/b], click [b]Options[/b], choose the desired features then generate the font.
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="add_fallback">
- <return type="void">
- </return>
- <argument index="0" name="data" type="DynamicFontData">
- </argument>
- <description>
- Adds a fallback font.
- </description>
- </method>
- <method name="get_available_chars" qualifiers="const">
- <return type="String">
- </return>
- <description>
- Returns a string containing all the characters available in the main and all the fallback fonts.
- If a given character is included in more than one font, it appears only once in the returned string.
- </description>
- </method>
- <method name="get_fallback" qualifiers="const">
- <return type="DynamicFontData">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the fallback font at index [code]idx[/code].
- </description>
- </method>
- <method name="get_fallback_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the number of fallback fonts.
- </description>
- </method>
- <method name="get_spacing" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="type" type="int">
- </argument>
- <description>
- Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
- </description>
- </method>
- <method name="remove_fallback">
- <return type="void">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Removes the fallback font at index [code]idx[/code].
- </description>
- </method>
- <method name="set_fallback">
- <return type="void">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="data" type="DynamicFontData">
- </argument>
- <description>
- Sets the fallback font at index [code]idx[/code].
- </description>
- </method>
- <method name="set_spacing">
- <return type="void">
- </return>
- <argument index="0" name="type" type="int">
- </argument>
- <argument index="1" name="value" type="int">
- </argument>
- <description>
- Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
- </description>
- </method>
- </methods>
- <members>
- <member name="extra_spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0">
- Extra spacing at the bottom in pixels.
- </member>
- <member name="extra_spacing_char" type="int" setter="set_spacing" getter="get_spacing" default="0">
- Extra character spacing in pixels.
- </member>
- <member name="extra_spacing_space" type="int" setter="set_spacing" getter="get_spacing" default="0">
- Extra space spacing in pixels.
- </member>
- <member name="extra_spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0">
- Extra spacing at the top in pixels.
- </member>
- <member name="font_data" type="DynamicFontData" setter="set_font_data" getter="get_font_data">
- The font data.
- </member>
- <member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color" default="Color( 1, 1, 1, 1 )">
- The font outline's color.
- [b]Note:[/b] It's recommended to leave this at the default value so that you can adjust it in individual controls. For example, if the outline is made black here, it won't be possible to change its color using a Label's font outline modulate theme item.
- </member>
- <member name="outline_size" type="int" setter="set_outline_size" getter="get_outline_size" default="0">
- The font outline's thickness in pixels (not relative to the font size).
- </member>
- <member name="size" type="int" setter="set_size" getter="get_size" default="16">
- The font size in pixels.
- </member>
- </members>
- <constants>
- <constant name="SPACING_TOP" value="0" enum="SpacingType">
- Spacing at the top.
- </constant>
- <constant name="SPACING_BOTTOM" value="1" enum="SpacingType">
- Spacing at the bottom.
- </constant>
- <constant name="SPACING_CHAR" value="2" enum="SpacingType">
- Character spacing.
- </constant>
- <constant name="SPACING_SPACE" value="3" enum="SpacingType">
- Space spacing.
- </constant>
- </constants>
-</class>
diff --git a/doc/classes/DynamicFontData.xml b/doc/classes/DynamicFontData.xml
deleted file mode 100644
index 483da96f3f..0000000000
--- a/doc/classes/DynamicFontData.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="DynamicFontData" inherits="Resource" version="4.0">
- <brief_description>
- Used with [DynamicFont] to describe the location of a font file.
- </brief_description>
- <description>
- Used with [DynamicFont] to describe the location of a vector font file for dynamic rendering at runtime.
- </description>
- <tutorials>
- </tutorials>
- <methods>
- </methods>
- <members>
- <member name="antialiased" type="bool" setter="set_antialiased" getter="is_antialiased" default="true">
- If [code]true[/code], the font is rendered with anti-aliasing. This property applies both to the main font and its outline (if it has one).
- </member>
- <member name="font_path" type="String" setter="set_font_path" getter="get_font_path" default="&quot;&quot;">
- The path to the vector font file.
- </member>
- <member name="hinting" type="int" setter="set_hinting" getter="get_hinting" enum="DynamicFontData.Hinting" default="2">
- The font hinting mode used by FreeType. See [enum Hinting] for options.
- </member>
- </members>
- <constants>
- <constant name="HINTING_NONE" value="0" enum="Hinting">
- Disables font hinting (smoother but less crisp).
- </constant>
- <constant name="HINTING_LIGHT" value="1" enum="Hinting">
- Use the light font hinting mode.
- </constant>
- <constant name="HINTING_NORMAL" value="2" enum="Hinting">
- Use the default font hinting mode (crisper but less smooth).
- </constant>
- </constants>
-</class>
diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index b290557336..e5401134bf 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -5,9 +5,10 @@
</brief_description>
<description>
EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your [EditorPlugin] with [method EditorPlugin.add_import_plugin].
- EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].import[/code] directory.
+ EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].godot/imported[/code] directory.
Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec":
- [codeblock]
+ [codeblocks]
+ [gdscript]
tool
extends EditorImportPlugin
@@ -39,14 +40,76 @@
var file = File.new()
if file.open(source_file, File.READ) != OK:
return FAILED
-
- var mesh = Mesh.new()
- # Fill the Mesh with data read in "file", left as an exercise to the reader
+ var mesh = ArrayMesh.new()
+ # Fill the Mesh with data read in "file", left as an exercise to the reader.
var filename = save_path + "." + get_save_extension()
ResourceSaver.save(filename, mesh)
return OK
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+
+ public class MySpecialPlugin : EditorImportPlugin
+ {
+ public override String GetImporterName()
+ {
+ return "my.special.plugin";
+ }
+
+ public override String GetVisibleName()
+ {
+ return "Special Mesh Importer";
+ }
+
+ public override Godot.Collections.Array GetRecognizedExtensions()
+ {
+ return new Godot.Collections.Array{"special", "spec"};
+ }
+
+ public override String GetSaveExtension()
+ {
+ return "mesh";
+ }
+
+ public override String GetResourceType()
+ {
+ return "Mesh";
+ }
+
+ public override int GetPresetCount()
+ {
+ return 1;
+ }
+
+ public override String GetPresetName(int i)
+ {
+ return "Default";
+ }
+
+ public override Godot.Collections.Array GetImportOptions(int i)
+ {
+ return new Godot.Collections.Array{new Godot.Collections.Dictionary{{"name", "myOption"}, {"defaultValue", false}}};
+ }
+
+ public override int Import(String sourceFile, String savePath, Godot.Collections.Dictionary options, Godot.Collections.Array platformVariants, Godot.Collections.Array genFiles)
+ {
+ var file = new File();
+ if (file.Open(sourceFile, File.ModeFlags.Read) != Error.Ok)
+ {
+ return (int)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();
+ ResourceSaver.Save(filename, mesh);
+ return (int)Error.Ok;
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
<link title="Import plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link>
@@ -84,14 +147,28 @@
</argument>
<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:
- [codeblock]
+ [codeblocks]
+ [gdscript]
func get_option_visibility(option, options):
# Only show the lossy quality setting if the compression mode is set to "Lossy".
if option == "compress/lossy_quality" and options.has("compress/mode"):
- return int(options["compress/mode"]) == COMPRESS_LOSSY
+ return int(options["compress/mode"]) == COMPRESS_LOSSY # This is a constant that you set
return true
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public void GetOptionVisibility(string option, Godot.Collections.Dictionary options)
+ {
+ // Only show the lossy quality setting if the compression mode is set to "Lossy".
+ if (option == "compress/lossyQuality" &amp;&amp; options.Contains("compress/mode"))
+ {
+ return (int)options["compress/mode"] == COMPRESS_LOSSY; // This is a constant you set
+ }
+
+ return true;
+ }
+ [/csharp]
+ [/codeblocks]
Return [code]true[/code] to make all options always visible.
</description>
</method>
@@ -136,7 +213,7 @@
<return type="String">
</return>
<description>
- Gets the extension used to save this resource in the [code].import[/code] directory.
+ Gets the extension used to save this resource in the [code].godot/imported[/code] directory.
</description>
</method>
<method name="get_visible_name" qualifiers="virtual">
diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml
index 9da36b51f9..c7561449b9 100644
--- a/doc/classes/EditorInterface.xml
+++ b/doc/classes/EditorInterface.xml
@@ -125,8 +125,10 @@
</argument>
<argument index="1" name="for_property" type="String" default="&quot;&quot;">
</argument>
+ <argument index="2" name="inspector_only" type="bool" default="false">
+ </argument>
<description>
- Shows the given property on the given [code]object[/code] in the editor's Inspector dock.
+ Shows the given property on the given [code]object[/code] in the editor's Inspector dock. If [code]inspector_only[/code] is [code]true[/code], plugins will not attempt to edit [code]object[/code].
</description>
</method>
<method name="is_playing_scene" qualifiers="const">
diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml
index 8865939eb1..322cff4e43 100644
--- a/doc/classes/EditorNode3DGizmoPlugin.xml
+++ b/doc/classes/EditorNode3DGizmoPlugin.xml
@@ -59,8 +59,11 @@
</argument>
<argument index="1" name="billboard" type="bool" default="false">
</argument>
+ <argument index="2" name="texture" type="Texture2D" default="null">
+ </argument>
<description>
Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_handles]. Should not be overridden.
+ You can optionally provide a texture to use instead of the default icon.
</description>
</method>
<method name="create_icon_material">
@@ -122,7 +125,7 @@
</return>
<argument index="0" name="name" type="String">
</argument>
- <argument index="1" name="gizmo" type="EditorNode3DGizmo">
+ <argument index="1" name="gizmo" type="EditorNode3DGizmo" default="null">
</argument>
<description>
Gets material from the internal list of materials. If an [EditorNode3DGizmo] is provided, it will try to get the corresponding variant (selected and/or editable).
@@ -136,7 +139,7 @@
</description>
</method>
<method name="get_priority" qualifiers="virtual">
- <return type="String">
+ <return type="int">
</return>
<description>
Override this method to set the gizmo's priority. Higher values correspond to higher priority. If a gizmo with higher priority conflicts with another gizmo, only the gizmo with higher priority will be used.
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 6a64a7aa55..874fe4e3de 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -130,14 +130,10 @@
</return>
<argument index="0" name="name" type="String">
</argument>
- <argument index="1" name="handler" type="Object">
- </argument>
- <argument index="2" name="callback" type="String">
- </argument>
- <argument index="3" name="ud" type="Variant" default="null">
+ <argument index="1" name="callable" type="Callable">
</argument>
<description>
- Adds a custom menu item to [b]Project &gt; Tools[/b] as [code]name[/code] that calls [code]callback[/code] on an instance of [code]handler[/code] with a parameter [code]ud[/code] when user activates it.
+ Adds a custom menu item to [b]Project &gt; Tools[/b] named [code]name[/code]. When clicked, the provided [code]callable[/code] will be called.
</description>
</method>
<method name="add_tool_submenu_item">
@@ -148,7 +144,7 @@
<argument index="1" name="submenu" type="Object">
</argument>
<description>
- Adds a custom submenu under [b]Project &gt; Tools &gt;[/b] [code]name[/code]. [code]submenu[/code] should be an object of class [PopupMenu]. This submenu should be cleaned up using [code]remove_tool_menu_item(name)[/code].
+ Adds a custom submenu under [b]Project &gt; Tools &gt;[/b] [code]name[/code]. [code]submenu[/code] should be an object of class [PopupMenu]. Use [code]remove_tool_menu_item(name)[/code] on plugin clean up to remove the menu.
</description>
</method>
<method name="add_translation_parser_plugin">
@@ -210,6 +206,38 @@
<argument index="0" name="overlay" type="Control">
</argument>
<description>
+ Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays].
+ [codeblocks]
+ [gdscript]
+ func forward_canvas_draw_over_viewport(overlay):
+ # Draw a circle at cursor position.
+ overlay.draw_circle(overlay.get_local_mouse_position(), 64)
+
+ func forward_canvas_gui_input(event):
+ if event is InputEventMouseMotion:
+ # Redraw viewport when cursor is moved.
+ update_overlays()
+ return true
+ return false
+ [/gdscript]
+ [csharp]
+ public override void ForwardCanvasDrawOverViewport(Godot.Control overlay)
+ {
+ // Draw a circle at cursor position.
+ overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White);
+ }
+
+ public override bool ForwardCanvasGuiInput(InputEvent @event)
+ {
+ if (@event is InputEventMouseMotion)
+ {
+ // Redraw viewport when cursor is moved.
+ UpdateOverlays();
+ return true;
+ }
+ return false;
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="forward_canvas_force_draw_over_viewport" qualifiers="virtual">
@@ -218,6 +246,8 @@
<argument index="0" name="overlay" type="Control">
</argument>
<description>
+ This method is the same as [method forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
+ You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled].
</description>
</method>
<method name="forward_canvas_gui_input" qualifiers="virtual">
@@ -227,21 +257,85 @@
</argument>
<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 [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Prevents the InputEvent to reach other Editor classes
func forward_canvas_gui_input(event):
- var forward = true
- return forward
- [/codeblock]
+ return true
+ [/gdscript]
+ [csharp]
+ // Prevents the InputEvent to reach other Editor classes
+ public override bool ForwardCanvasGuiInput(InputEvent @event)
+ {
+ return true;
+ }
+ [/csharp]
+ [/codeblocks]
Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example:
- [codeblock]
- # Consumes InputEventMouseMotion and forwards other InputEvent types
+ [codeblocks]
+ [gdscript]
+ # Consumes InputEventMouseMotion and forwards other InputEvent types.
func forward_canvas_gui_input(event):
- var forward = false
+ return event is InputEventMouseMotion
+ [/gdscript]
+ [csharp]
+ // Consumes InputEventMouseMotion and forwards other InputEvent types.
+ public override bool ForwardCanvasGuiInput(InputEvent @event)
+ {
+ return @event is InputEventMouseMotion;
+ }
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="forward_spatial_draw_over_viewport" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="overlay" type="Control">
+ </argument>
+ <description>
+ Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays].
+ [codeblocks]
+ [gdscript]
+ func forward_spatial_draw_over_viewport(overlay):
+ # Draw a circle at cursor position.
+ overlay.draw_circle(overlay.get_local_mouse_position(), 64)
+
+ func forward_spatial_gui_input(camera, event):
if event is InputEventMouseMotion:
- forward = true
- return forward
- [/codeblock]
+ # Redraw viewport when cursor is moved.
+ update_overlays()
+ return true
+ return false
+ [/gdscript]
+ [csharp]
+ public override void ForwardSpatialDrawOverViewport(Godot.Control overlay)
+ {
+ // Draw a circle at cursor position.
+ overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White);
+ }
+
+ public override bool ForwardSpatialGuiInput(Godot.Camera3D camera, InputEvent @event)
+ {
+ if (@event is InputEventMouseMotion)
+ {
+ // Redraw viewport when cursor is moved.
+ UpdateOverlays();
+ return true;
+ }
+ return false;
+ [/csharp]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="forward_spatial_force_draw_over_viewport" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="overlay" type="Control">
+ </argument>
+ <description>
+ This method is the same as [method forward_spatial_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
+ You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled].
</description>
</method>
<method name="forward_spatial_gui_input" qualifiers="virtual">
@@ -253,21 +347,35 @@
</argument>
<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. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example:
- [codeblock]
- # Prevents the InputEvent to reach other Editor classes
+ [codeblocks]
+ [gdscript]
+ # Prevents the InputEvent to reach other Editor classes.
func forward_spatial_gui_input(camera, event):
- var forward = true
- return forward
- [/codeblock]
+ return true
+ [/gdscript]
+ [csharp]
+ // Prevents the InputEvent to reach other Editor classes.
+ public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event)
+ {
+ return true;
+ }
+ [/csharp]
+ [/codeblocks]
Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example:
- [codeblock]
- # Consumes InputEventMouseMotion and forwards other InputEvent types
+ [codeblocks]
+ [gdscript]
+ # Consumes InputEventMouseMotion and forwards other InputEvent types.
func forward_spatial_gui_input(camera, event):
- var forward = false
- if event is InputEventMouseMotion:
- forward = true
- return forward
- [/codeblock]
+ return event is InputEventMouseMotion
+ [/gdscript]
+ [csharp]
+ // Consumes InputEventMouseMotion and forwards other InputEvent types.
+ public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event)
+ {
+ return @event is InputEventMouseMotion;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_breakpoints" qualifiers="virtual">
@@ -291,13 +399,24 @@
Override this method in your plugin to return a [Texture2D] in order to give it an icon.
For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons.
Ideally, the plugin icon should be white with a transparent background and 16x16 pixels in size.
- [codeblock]
+ [codeblocks]
+ [gdscript]
func get_plugin_icon():
# You can use a custom icon:
return preload("res://addons/my_plugin/my_plugin_icon.svg")
# Or use a built-in icon:
return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override Texture2D GetPluginIcon()
+ {
+ // You can use a custom icon:
+ return ResourceLoader.Load&lt;Texture2D&gt;("res://addons/my_plugin/my_plugin_icon.svg");
+ // Or use a built-in icon:
+ return GetEditorInterface().GetBaseControl().GetIcon("Node", "EditorIcons");
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_plugin_name" qualifiers="virtual">
@@ -379,7 +498,7 @@
Remember that you have to manage the visibility of all your editor controls manually.
</description>
</method>
- <method name="queue_save_layout" qualifiers="const">
+ <method name="queue_save_layout">
<return type="void">
</return>
<description>
@@ -511,6 +630,7 @@
<return type="void">
</return>
<description>
+ Enables calling of [method forward_canvas_force_draw_over_viewport] for the 2D editor and [method forward_spatial_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin.
</description>
</method>
<method name="set_input_event_forwarding_always_enabled">
@@ -542,7 +662,7 @@
<return type="int">
</return>
<description>
- Updates the overlays of the editor (2D/3D) viewport.
+ Updates the overlays of the 2D and 3D editor viewport. Causes methods [method forward_canvas_draw_over_viewport], [method forward_canvas_force_draw_over_viewport], [method forward_spatial_draw_over_viewport] and [method forward_spatial_force_draw_over_viewport] to be called.
</description>
</method>
</methods>
diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml
index cb1f5d2e77..5cddecffa8 100644
--- a/doc/classes/EditorScenePostImport.xml
+++ b/doc/classes/EditorScenePostImport.xml
@@ -6,24 +6,50 @@
<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:
- [codeblock]
- tool # Needed so it runs in editor
+ [codeblocks]
+ [gdscript]
+ tool # Needed so it runs in editor.
extends EditorScenePostImport
-
- # This sample changes all node names
-
- # Called right after the scene is imported and gets the root node
+ # This sample changes all node names.
+ # Called right after the scene is imported and gets the root node.
func post_import(scene):
# Change all node names to "modified_[oldnodename]"
iterate(scene)
return scene # Remember to return the imported scene
-
func iterate(node):
if node != null:
node.name = "modified_" + node.name
for child in node.get_children():
iterate(child)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+
+ // This sample changes all node names.
+ // Called right after the scene is imported and gets the root node.
+ [Tool]
+ public class NodeRenamer : EditorScenePostImport
+ {
+ public override Object PostImport(Object scene)
+ {
+ // Change all node names to "modified_[oldnodename]"
+ Iterate(scene as Node);
+ return scene; // Remember to return the imported scene
+ }
+ public void Iterate(Node node)
+ {
+ if (node != null)
+ {
+ node.Name = "modified_" + node.Name;
+ foreach (Node child in node.GetChildren())
+ {
+ Iterate(child);
+ }
+ }
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
<link title="Importing 3D scenes: Custom script">https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script</link>
diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml
index e96044bf48..60ccf451b8 100644
--- a/doc/classes/EditorScript.xml
+++ b/doc/classes/EditorScript.xml
@@ -7,13 +7,28 @@
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]
- [codeblock]
+ [codeblocks]
+ [gdscript]
tool
extends EditorScript
func _run():
print("Hello from the Godot Editor!")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+
+ [Tool]
+ public class HelloEditor : EditorScript
+ {
+ public override void _Run()
+ {
+ GD.Print("Hello from the Godot Editor!");
+ }
+ }
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] The script is run in the Editor context, which means the output is visible in the console window started with the Editor (stdout) instead of the usual Godot [b]Output[/b] dock.
</description>
<tutorials>
diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml
index 0c6a2d61cd..6088ae7a43 100644
--- a/doc/classes/EditorSettings.xml
+++ b/doc/classes/EditorSettings.xml
@@ -7,15 +7,24 @@
Object that holds the project-independent editor settings. These settings are generally visible in the [b]Editor &gt; Editor Settings[/b] menu.
Property names use slash delimiters to distinguish sections. Setting values can be of any [Variant] type. It's recommended to use [code]snake_case[/code] for editor settings to be consistent with the Godot editor itself.
Accessing the settings can be done using the following methods, such as:
- [codeblock]
- # `settings.set("some/property", value)` also works as this class overrides `_set()` internally.
- settings.set_setting("some/property",value)
-
- # `settings.get("some/property", value)` also works as this class overrides `_get()` internally.
+ [codeblocks]
+ [gdscript]
+ var settings = EditorInterface.get_editor_settings()
+ # `settings.set("some/property", 10)` also works as this class overrides `_set()` internally.
+ settings.set_setting("some/property", 10)
+ # `settings.get("some/property")` also works as this class overrides `_get()` internally.
settings.get_setting("some/property")
-
var list_of_settings = settings.get_property_list()
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ EditorSettings settings = GetEditorInterface().GetEditorSettings();
+ // `settings.set("some/property", value)` also works as this class overrides `_set()` internally.
+ settings.SetSetting("some/property", Value);
+ // `settings.get("some/property", value)` also works as this class overrides `_get()` internally.
+ settings.GetSetting("some/property");
+ Godot.Collections.Array listOfSettings = settings.GetPropertyList();
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_editor_settings].
</description>
<tutorials>
@@ -32,8 +41,10 @@
- [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]
- [codeblock]
- editor_settings.set("category/property_name", 0)
+ [codeblocks]
+ [gdscript]
+ var settings = EditorInterface.get_editor_settings()
+ settings.set("category/property_name", 0)
var property_info = {
"name": "category/property_name",
@@ -42,8 +53,23 @@
"hint_string": "one,two,three"
}
- editor_settings.add_property_info(property_info)
- [/codeblock]
+ settings.add_property_info(property_info)
+ [/gdscript]
+ [csharp]
+ var settings = GetEditorInterface().GetEditorSettings();
+ settings.Set("category/property_name", 0);
+
+ var propertyInfo = new Godot.Collections.Dictionary
+ {
+ {"name", "category/propertyName"},
+ {"type", Variant.Type.Int},
+ {"hint", PropertyHint.Enum},
+ {"hint_string", "one,two,three"}
+ };
+
+ settings.AddPropertyInfo(propertyInfo);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="erase">
diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml
index f5204e7bab..c97459d9dc 100644
--- a/doc/classes/EditorTranslationParserPlugin.xml
+++ b/doc/classes/EditorTranslationParserPlugin.xml
@@ -9,45 +9,95 @@
When adding to [code]msgids_context_plural[/code], you must add the data using the format [code]["A", "B", "C"][/code], where [code]A[/code] represents the extracted string, [code]B[/code] represents the context, and [code]C[/code] represents the plural version of the extracted string. If you want to add only context but not plural, put [code]""[/code] for the plural slot. The idea is the same if you only want to add plural but not context. See the code below for concrete examples.
The extracted strings will be written into a POT file selected by user under "POT Generation" in "Localization" tab in "Project Settings" menu.
Below shows an example of a custom parser that extracts strings from a CSV file to write into a POT.
- [codeblock]
+ [codeblocks]
+ [gdscript]
tool
extends EditorTranslationParserPlugin
-
func parse_file(path, msgids, msgids_context_plural):
var file = File.new()
file.open(path, File.READ)
var text = file.get_as_text()
- var split_strs = text.split(",", false, 0)
+ var split_strs = text.split(",", false)
for s in split_strs:
msgids.append(s)
#print("Extracted string: " + s)
-
func get_recognized_extensions():
return ["csv"]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+
+ [Tool]
+ public class CustomParser : EditorTranslationParserPlugin
+ {
+ public override void ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural)
+ {
+ var file = new File();
+ file.Open(path, File.ModeFlags.Read);
+ string text = file.GetAsText();
+ string[] splitStrs = text.Split(",", false);
+ foreach (var s in splitStrs)
+ {
+ msgids.Add(s);
+ //GD.Print("Extracted string: " + s)
+ }
+ }
+
+ public override Godot.Collections.Array GetRecognizedExtensions()
+ {
+ return new Godot.Collections.Array{"csv"};
+ }
+ }
+ [/csharp]
+ [/codeblocks]
To add a translatable string associated with context or plural, add it to [code]msgids_context_plural[/code]:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals".
msgids_context_plural.append(["Test 1", "context", "test 1 plurals"])
# This will add a message with msgid "A test without context" and msgid_plural "plurals".
msgids_context_plural.append(["A test without context", "", "plurals"])
# This will add a message with msgid "Only with context" and msgctxt "a friendly context".
msgids_context_plural.append(["Only with context", "a friendly context", ""])
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals".
+ msgidsContextPlural.Add(new Godot.Collections.Array{"Test 1", "context", "test 1 Plurals"});
+ // This will add a message with msgid "A test without context" and msgid_plural "plurals".
+ msgidsContextPlural.Add(new Godot.Collections.Array{"A test without context", "", "plurals"});
+ // This will add a message with msgid "Only with context" and msgctxt "a friendly context".
+ 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 [File] type.
For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
func parse_file(path, msgids, msgids_context_plural):
var res = ResourceLoader.load(path, "Script")
- var text = res.get_source_code()
+ var text = res.source_code
# Parsing logic.
-
func get_recognized_extensions():
return ["gd"]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural)
+ {
+ var res = ResourceLoader.Load&lt;Script&gt;(path, "Script");
+ string text = res.SourceCode;
+ // Parsing logic.
+ }
+
+ public override Godot.Collections.Array GetRecognizedExtensions()
+ {
+ return new Godot.Collections.Array{"gd"};
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml
index 297cccaaac..fab8512e4a 100644
--- a/doc/classes/Engine.xml
+++ b/doc/classes/Engine.xml
@@ -117,12 +117,24 @@
[code]year[/code] - Holds the year the version was released in as an int
[code]string[/code] - [code]major[/code] + [code]minor[/code] + [code]patch[/code] + [code]status[/code] + [code]build[/code] in a single String
The [code]hex[/code] value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code]. [b]Note:[/b] It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code:
- [codeblock]
+ [codeblocks]
+ [gdscript]
if Engine.get_version_info().hex &gt;= 0x030200:
# Do things specific to version 3.2 or later
else:
# Do things specific to versions before 3.2
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ if ((int)Engine.GetVersionInfo()["hex"] &gt;= 0x030200)
+ {
+ // Do things specific to version 3.2 or later
+ }
+ else
+ {
+ // Do things specific to versions before 3.2
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="has_singleton" qualifiers="const">
diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml
index caee6a0c07..c5b6a54f71 100644
--- a/doc/classes/Environment.xml
+++ b/doc/classes/Environment.xml
@@ -13,26 +13,29 @@
<tutorials>
<link title="Environment and post-processing">https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link>
<link title="Light transport in game engines">https://docs.godotengine.org/en/latest/tutorials/3d/high_dynamic_range.html</link>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
- <method name="is_glow_level_enabled" qualifiers="const">
- <return type="bool">
+ <method name="get_glow_level" qualifiers="const">
+ <return type="float">
</return>
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns [code]true[/code] if the glow level [code]idx[/code] is specified, [code]false[/code] otherwise.
+ Returns the intensity of the glow level [code]idx[/code].
</description>
</method>
- <method name="set_glow_level_enabled">
+ <method name="set_glow_level">
<return type="void">
</return>
<argument index="0" name="idx" type="int">
</argument>
- <argument index="1" name="enabled" type="bool">
+ <argument index="1" name="intensity" type="float">
</argument>
<description>
- Enables or disables the glow level at index [code]idx[/code]. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled.
+ Sets the intensity of the glow level [code]idx[/code]. A value above [code]0.0[/code] enables the level. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled.
</description>
</method>
</methods>
@@ -40,8 +43,8 @@
<member name="adjustment_brightness" type="float" setter="set_adjustment_brightness" getter="get_adjustment_brightness" default="1.0">
The global brightness value of the rendered scene. Effective only if [code]adjustment_enabled[/code] is [code]true[/code].
</member>
- <member name="adjustment_color_correction" type="Texture2D" setter="set_adjustment_color_correction" getter="get_adjustment_color_correction">
- Applies the provided [Texture2D] resource to affect the global color aspect of the rendered scene. Effective only if [code]adjustment_enabled[/code] is [code]true[/code].
+ <member name="adjustment_color_correction" type="Texture" setter="set_adjustment_color_correction" getter="get_adjustment_color_correction">
+ The [Texture2D] or [Texture3D] lookup table (LUT) to use for the built-in post-process color grading. Can use a [GradientTexture] for a 1-dimensional LUT, or a [Texture3D] for a more complex LUT. Effective only if [code]adjustment_enabled[/code] is [code]true[/code].
</member>
<member name="adjustment_contrast" type="float" setter="set_adjustment_contrast" getter="get_adjustment_contrast" default="1.0">
The global contrast value of the rendered scene (default value is 1). Effective only if [code]adjustment_enabled[/code] is [code]true[/code].
@@ -95,6 +98,10 @@
<member name="background_mode" type="int" setter="set_background" getter="get_background" enum="Environment.BGMode" default="0">
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">
+ Blend factor between the fog's color and the color of the background [Sky]. 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.
+ </member>
<member name="fog_density" type="float" setter="set_fog_density" getter="get_fog_density" default="0.001">
</member>
<member name="fog_enabled" type="bool" setter="set_fog_enabled" getter="is_fog_enabled" default="false">
@@ -129,33 +136,36 @@
The lower threshold of the HDR glow. When using the GLES2 renderer (which doesn't support HDR), this needs to be below [code]1.0[/code] for glow to be visible. A value of [code]0.9[/code] works well in this case.
</member>
<member name="glow_intensity" type="float" setter="set_glow_intensity" getter="get_glow_intensity" default="0.8">
- The glow intensity. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering.
+ The overall brightness multiplier of the glow effect. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering.
</member>
- <member name="glow_levels/1" type="bool" setter="set_glow_level_enabled" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 1st level of glow is enabled. This is the most "local" level (least blurry).
+ <member name="glow_levels/1" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 1st level of glow. This is the most "local" level (least blurry).
</member>
- <member name="glow_levels/2" type="bool" setter="set_glow_level_enabled" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 2th level of glow is enabled.
+ <member name="glow_levels/2" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 2nd level of glow.
</member>
- <member name="glow_levels/3" type="bool" setter="set_glow_level_enabled" getter="is_glow_level_enabled" default="true">
- If [code]true[/code], the 3th level of glow is enabled.
+ <member name="glow_levels/3" type="float" setter="set_glow_level" getter="get_glow_level" default="1.0">
+ The intensity of the 3rd level of glow.
</member>
- <member name="glow_levels/4" type="bool" setter="set_glow_level_enabled" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 4th level of glow is enabled.
+ <member name="glow_levels/4" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 4th level of glow.
</member>
- <member name="glow_levels/5" type="bool" setter="set_glow_level_enabled" getter="is_glow_level_enabled" default="true">
- If [code]true[/code], the 5th level of glow is enabled.
+ <member name="glow_levels/5" type="float" setter="set_glow_level" getter="get_glow_level" default="1.0">
+ The intensity of the 5th level of glow.
</member>
- <member name="glow_levels/6" type="bool" setter="set_glow_level_enabled" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 6th level of glow is enabled.
+ <member name="glow_levels/6" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 6th level of glow.
</member>
- <member name="glow_levels/7" type="bool" setter="set_glow_level_enabled" getter="is_glow_level_enabled" default="false">
- If [code]true[/code], the 7th level of glow is enabled. This is the most "global" level (blurriest).
+ <member name="glow_levels/7" type="float" setter="set_glow_level" getter="get_glow_level" default="0.0">
+ The intensity of the 7th level of glow. This is the most "global" level (blurriest).
</member>
<member name="glow_mix" type="float" setter="set_glow_mix" getter="get_glow_mix" default="0.05">
</member>
+ <member name="glow_normalized" type="bool" setter="set_glow_normalized" getter="is_glow_normalized" default="false">
+ If [code]true[/code], glow levels will be normalized so that summed together their intensities equal [code]1.0[/code].
+ </member>
<member name="glow_strength" type="float" setter="set_glow_strength" getter="get_glow_strength" default="1.0">
- The glow strength. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering.
+ The strength of the glow effect. This applies as the glow is blurred across the screen and increases the distance and intensity of the blur. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering.
</member>
<member name="reflected_light_source" type="int" setter="set_reflection_source" getter="get_reflection_source" enum="Environment.ReflectionSource" default="0">
</member>
diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml
index f2611dc850..d777c6fd9d 100644
--- a/doc/classes/Expression.xml
+++ b/doc/classes/Expression.xml
@@ -7,21 +7,46 @@
An expression can be made of any arithmetic operation, built-in math function call, method call of a passed instance, or built-in type construction call.
An example expression text using the built-in math functions could be [code]sqrt(pow(3, 2) + pow(4, 2))[/code].
In the following example we use a [LineEdit] node to write our expression and show the result.
- [codeblock]
- onready var expression = Expression.new()
+ [codeblocks]
+ [gdscript]
+ var expression = Expression.new()
func _ready():
$LineEdit.connect("text_entered", self, "_on_text_entered")
func _on_text_entered(command):
- var error = expression.parse(command, [])
+ var error = expression.parse(command)
if error != OK:
print(expression.get_error_text())
return
- var result = expression.execute([], null, true)
+ var result = expression.execute()
if not expression.has_execute_failed():
$LineEdit.text = str(result)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public Expression expression = new Expression();
+
+ public override void _Ready()
+ {
+ GetNode("LineEdit").Connect("text_entered", this, nameof(OnTextEntered));
+ }
+
+ private void OnTextEntered(string command)
+ {
+ Error error = expression.Parse(command);
+ if (error != Error.Ok)
+ {
+ GD.Print(expression.GetErrorText());
+ return;
+ }
+ object result = expression.Execute();
+ if (!expression.HasExecuteFailed())
+ {
+ GetNode&lt;LineEdit&gt;("LineEdit").Text = result.ToString();
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/File.xml b/doc/classes/File.xml
index 1982406993..2f7ac551cf 100644
--- a/doc/classes/File.xml
+++ b/doc/classes/File.xml
@@ -6,7 +6,8 @@
<description>
File type. This is used to permanently store data into the user device's file system and to read from it. This can be used to store game save data or player configuration files, for example.
Here's a sample on how to write and read from a file:
- [codeblock]
+ [codeblocks]
+ [gdscript]
func save(content):
var file = File.new()
file.open("user://save_game.dat", File.WRITE)
@@ -19,11 +20,32 @@
var content = file.get_as_text()
file.close()
return content
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public void Save(string content)
+ {
+ var file = new File();
+ file.Open("user://save_game.dat", File.ModeFlags.Write);
+ file.StoreString(content);
+ file.Close();
+ }
+
+ public string Load()
+ {
+ var file = new File();
+ file.Open("user://save_game.dat", File.ModeFlags.Read);
+ string content = file.GetAsText();
+ file.Close();
+ return content;
+ }
+ [/csharp]
+ [/codeblocks]
In the example above, the file will be saved in the user data folder as specified in the [url=https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html]Data paths[/url] documentation.
+ [b]Note:[/b] To access project resources once exported, it is recommended to use [ResourceLoader] instead of the [File] API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package.
</description>
<tutorials>
<link title="File system">https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="close">
@@ -48,7 +70,7 @@
</argument>
<description>
Returns [code]true[/code] if the file exists in the given path.
- [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and that their source asset will not be included in the exported game, as only the imported version is used (in the [code]res://.import[/code] folder). To check for the existence of such resources while taking into account the remapping to their imported location, use [method ResourceLoader.exists]. Typically, using [code]File.file_exists[/code] on an imported resource would work while you are developing in the editor (the source asset is present in [code]res://[/code], but fail when exported).
+ [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See [method ResourceLoader.exists] for an alternative approach that takes resource remapping into account.
</description>
</method>
<method name="get_16" qualifiers="const">
@@ -301,7 +323,8 @@
Stores an integer as 16 bits in the file.
[b]Note:[/b] The [code]value[/code] should lie in the interval [code][0, 2^16 - 1][/code]. Any other value will overflow and wrap around.
To store a signed integer, use [method store_64] or store a signed integer from the interval [code][-2^15, 2^15 - 1][/code] (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
const MAX_15B = 1 &lt;&lt; 15
const MAX_16B = 1 &lt;&lt; 16
@@ -318,7 +341,22 @@
var read2 = f.get_16() # 121
var converted1 = unsigned16_to_signed(read1) # -42
var converted2 = unsigned16_to_signed(read2) # 121
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ var f = new File();
+ f.Open("user://file.dat", File.ModeFlags.WriteRead);
+ f.Store16(unchecked((ushort)-42)); // This wraps around and stores 65494 (2^16 - 42).
+ f.Store16(121); // In bounds, will store 121.
+ f.Seek(0); // Go back to start to read the stored value.
+ ushort read1 = f.Get16(); // 65494
+ ushort read2 = f.Get16(); // 121
+ short converted1 = BitConverter.ToInt16(BitConverter.GetBytes(read1), 0); // -42
+ short converted2 = BitConverter.ToInt16(BitConverter.GetBytes(read2), 0); // 121
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="store_32">
@@ -398,8 +436,7 @@
<argument index="0" name="line" type="String">
</argument>
<description>
- Stores the given [String] as a line in the file.
- Text will be encoded as UTF-8.
+ Appends [code]line[/code] to the file followed by a line return character ([code]\n[/code]), encoding the text as UTF-8.
</description>
</method>
<method name="store_pascal_string">
@@ -427,8 +464,7 @@
<argument index="0" name="string" type="String">
</argument>
<description>
- Stores the given [String] in the file.
- Text will be encoded as UTF-8.
+ Appends [code]string[/code] to the file without a line return, encoding the text as UTF-8.
</description>
</method>
<method name="store_var">
diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml
index f49fbf0d2a..edd2bd137f 100644
--- a/doc/classes/Font.xml
+++ b/doc/classes/Font.xml
@@ -1,60 +1,167 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Font" inherits="Resource" version="4.0">
<brief_description>
- Internationalized font and text drawing support.
+ Font class is set of font data sources used to draw text.
</brief_description>
<description>
- Font contains a Unicode-compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts.
- [b]Note:[/b] If a DynamicFont doesn't contain a character used in a string, the character in question will be replaced with codepoint [code]0xfffd[/code] if it's available in the DynamicFont. If this replacement character isn't available in the DynamicFont, the character will be hidden without displaying any replacement character in the string.
- [b]Note:[/b] If a BitmapFont doesn't contain a character used in a string, the character in question will be hidden without displaying any replacement character in the string.
+ Font contains a set of glyphs to represent Unicode characters, as well as the ability to draw it with variable width, ascent, descent and kerning.
+ [b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way.
+ [b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source.
+ [b]Note:[/b] If a non of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code.
+ [codeblocks]
+ [gdscript]
+ var font = Font.new()
+ font.add_data(load("res://BarlowCondensed-Bold.ttf"))
+ $"Label".set("custom_fonts/font", font)
+ $"Label".set("custom_fonts/font_size", 64)
+ [/gdscript]
+ [csharp]
+ var font = new Font();
+ font.AddData(ResourceLoader.Load&lt;FontData&gt;("res://BarlowCondensed-Bold.ttf"));
+ GetNode("Label").Set("custom_fonts/font", font);
+ GetNode("Label").Set("custom_font_sizes/font_size", 64);
+ [/csharp]
+ [/codeblocks]
+ To control font substitution priority use [FontData] language and script support.
+ Use language overrides to use same [Font] stack for multiple languages:
+ [codeblocks]
+ [gdscript]
+ # Use Naskh font for Persian and Nastaʼlīq font for Urdu text.
+ var font_data_fa = load("res://NotoNaskhArabicUI_Regular.ttf");
+ font_data_fa.set_language_support_override("fa", true);
+ font_data_fa.set_language_support_override("ur", false);
+
+ var font_data_ur = load("res://NotoNastaliqUrdu_Regular.ttf");
+ font_data_ur.set_language_support_override("fa", false);
+ font_data_ur.set_language_support_override("ur", true);
+ [/gdscript]
+ [csharp]
+ // Use Naskh font for Persian and Nastaʼlīq font for Urdu text.
+ var fontDataFA = ResourceLoader.Load&lt;FontData&gt;("res://NotoNaskhArabicUI_Regular.ttf");
+ fontDataFA.SetLanguageSupportOverride("fa", true);
+ fontDataFA.SetLanguageSupportOverride("ur", false);
+
+ var fontDataUR = ResourceLoader.Load&lt;FontData&gt;("res://NotoNastaliqUrdu_Regular.ttf");
+ fontDataUR.SetLanguageSupportOverride("fa", false);
+ fontDataUR.SetLanguageSupportOverride("ur", true);
+ [/csharp]
+ [/codeblocks]
+ Use script overrides to specify supported scripts for bitmap font or for less common scripts not directly supported by TrueType format:
+ [codeblocks]
+ [gdscript]
+ # Use specified font for Egyptian hieroglyphs.
+ var font_data = load("res://unifont.ttf");
+ font_data.set_script_support_override("Egyp", true);
+ [/gdscript]
+ [csharp]
+ // Use specified font for Egyptian hieroglyphs.
+ var fontData = ResourceLoader.Load&lt;FontData&gt;("res://unifont.ttf");
+ fontData.SetScriptSupportOverride("Egyp", true);
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
<methods>
- <method name="draw" qualifiers="const">
+ <method name="add_data">
<return type="void">
</return>
+ <argument index="0" name="data" type="FontData">
+ </argument>
+ <description>
+ Add font data source to the set.
+ </description>
+ </method>
+ <method name="draw_char" qualifiers="const">
+ <return type="float">
+ </return>
<argument index="0" name="canvas_item" type="RID">
</argument>
- <argument index="1" name="position" type="Vector2">
+ <argument index="1" name="pos" type="Vector2">
+ </argument>
+ <argument index="2" name="char" type="int">
+ </argument>
+ <argument index="3" name="next" type="int" default="0">
</argument>
- <argument index="2" name="string" type="String">
+ <argument index="4" name="size" type="int" default="-1">
</argument>
- <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ <argument index="5" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
</argument>
- <argument index="4" name="clip_w" type="int" default="-1">
+ <argument index="6" name="outline_size" type="int" default="0">
</argument>
- <argument index="5" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ <argument index="7" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
</argument>
<description>
- Draw [code]string[/code] into a canvas item using the font at a given position, with [code]modulate[/code] color, and optionally clipping the width. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
- See also [method CanvasItem.draw_string].
+ Draw a single Unicode character [code]char[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, and optionally kerning if [code]next[/code] is passed. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
+ [b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead.
</description>
</method>
- <method name="draw_char" qualifiers="const">
- <return type="float">
+ <method name="draw_multiline_string" qualifiers="const">
+ <return type="void">
</return>
<argument index="0" name="canvas_item" type="RID">
</argument>
- <argument index="1" name="position" type="Vector2">
+ <argument index="1" name="pos" type="Vector2">
</argument>
- <argument index="2" name="char" type="int">
+ <argument index="2" name="text" type="String">
+ </argument>
+ <argument index="3" name="align" type="int" enum="HAlign" default="0">
+ </argument>
+ <argument index="4" name="width" type="float" default="-1">
+ </argument>
+ <argument index="5" name="max_lines" type="int" default="-1">
+ </argument>
+ <argument index="6" name="size" type="int" default="-1">
+ </argument>
+ <argument index="7" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <argument index="8" name="outline_size" type="int" default="0">
+ </argument>
+ <argument index="9" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
+ </argument>
+ <argument index="10" name="flags" type="int" default="51">
+ </argument>
+ <description>
+ Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws it into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
+ See also [method CanvasItem.draw_multiline_string].
+ </description>
+ </method>
+ <method name="draw_string" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="canvas_item" type="RID">
+ </argument>
+ <argument index="1" name="pos" type="Vector2">
+ </argument>
+ <argument index="2" name="text" type="String">
+ </argument>
+ <argument index="3" name="align" type="int" enum="HAlign" default="0">
+ </argument>
+ <argument index="4" name="width" type="float" default="-1">
+ </argument>
+ <argument index="5" name="size" type="int" default="-1">
+ </argument>
+ <argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
</argument>
- <argument index="3" name="next" type="int" default="-1">
+ <argument index="7" name="outline_size" type="int" default="0">
</argument>
- <argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ <argument index="8" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
</argument>
- <argument index="5" name="outline" type="bool" default="false">
+ <argument index="9" name="flags" type="int" default="3">
</argument>
<description>
- Draw character [code]char[/code] into a canvas item using the font at a given position, with [code]modulate[/code] color, and optionally kerning if [code]next[/code] is passed. clipping the width. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character.
+ Draw [code]text[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
+ See also [method CanvasItem.draw_string].
</description>
</method>
<method name="get_ascent" qualifiers="const">
<return type="float">
</return>
+ <argument index="0" name="size" type="int" default="-1">
+ </argument>
<description>
- Returns the font ascent (number of pixels above the baseline).
+ Returns the average font ascent (number of pixels above the baseline).
+ [b]Note:[/b] Real ascent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the ascent of empty line).
</description>
</method>
<method name="get_char_size" qualifiers="const">
@@ -64,65 +171,176 @@
</argument>
<argument index="1" name="next" type="int" default="0">
</argument>
+ <argument index="2" name="size" type="int" default="-1">
+ </argument>
<description>
Returns the size of a character, optionally taking kerning into account if the next character is provided.
+ [b]Note:[/b] Do not use this function to calculate width of the string character by character, use [method get_string_size] or [TextLine] instead.
+ </description>
+ </method>
+ <method name="get_data" qualifiers="const">
+ <return type="FontData">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Returns the font data source at index [code]idx[/code]. If the index does not exist, returns [code]null[/code].
+ </description>
+ </method>
+ <method name="get_data_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the number of font data sources.
</description>
</method>
<method name="get_descent" qualifiers="const">
<return type="float">
</return>
+ <argument index="0" name="size" type="int" default="-1">
+ </argument>
<description>
- Returns the font descent (number of pixels below the baseline).
+ Returns the average font descent (number of pixels below the baseline).
+ [b]Note:[/b] Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line).
</description>
</method>
<method name="get_height" qualifiers="const">
<return type="float">
</return>
+ <argument index="0" name="size" type="int" default="-1">
+ </argument>
<description>
- Returns the total font height (ascent plus descent) in pixels.
+ Returns the total average font height (ascent plus descent) in pixels.
+ [b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the height of empty line).
</description>
</method>
- <method name="get_string_size" qualifiers="const">
+ <method name="get_multiline_string_size" qualifiers="const">
<return type="Vector2">
</return>
- <argument index="0" name="string" type="String">
+ <argument index="0" name="text" type="String">
+ </argument>
+ <argument index="1" name="width" type="float" default="-1">
+ </argument>
+ <argument index="2" name="size" type="int" default="-1">
+ </argument>
+ <argument index="3" name="flags" type="int" default="48">
+ </argument>
+ <description>
+ Returns the size of a bounding box of a string broken into the lines, taking kerning and advance into account.
+ See also [method draw_multiline_string].
+ </description>
+ </method>
+ <method name="get_spacing" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="type" type="int">
</argument>
<description>
- Returns the size of a string, taking kerning and advance into account.
+ Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
</description>
</method>
- <method name="get_wordwrap_string_size" qualifiers="const">
+ <method name="get_string_size" qualifiers="const">
<return type="Vector2">
</return>
- <argument index="0" name="string" type="String">
+ <argument index="0" name="text" type="String">
</argument>
- <argument index="1" name="width" type="float">
+ <argument index="1" name="size" type="int" default="-1">
</argument>
<description>
- Returns the size that the string would have with word wrapping enabled with a fixed [code]width[/code].
+ Returns the size size of a bounding box of a string, taking kerning and advance into account.
+ See also [method draw_string].
</description>
</method>
- <method name="has_outline" qualifiers="const">
- <return type="bool">
+ <method name="get_supported_chars" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Returns a string containing all the characters available in the font.
+ If a given character is included in more than one font data source, it appears only once in the returned string.
+ </description>
+ </method>
+ <method name="get_underline_position" qualifiers="const">
+ <return type="float">
</return>
+ <argument index="0" name="size" type="int" default="-1">
+ </argument>
<description>
- Returns [code]true[/code] if the font has an outline.
+ Return average pixel offset of the underline below the baseline.
+ [b]Note:[/b] Real underline position of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate.
</description>
</method>
- <method name="is_distance_field_hint" qualifiers="const">
+ <method name="get_underline_thickness" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="size" type="int" default="-1">
+ </argument>
+ <description>
+ Return average thickness of the underline.
+ [b]Note:[/b] Real underline thickness of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate.
+ </description>
+ </method>
+ <method name="has_char" qualifiers="const">
<return type="bool">
</return>
+ <argument index="0" name="char" type="int">
+ </argument>
+ <description>
+ Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
+ </description>
+ </method>
+ <method name="remove_data">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Removes the font data source at index [code]idx[/code]. If the index does not exist, nothing happens.
+ </description>
+ </method>
+ <method name="set_data">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="data" type="FontData">
+ </argument>
+ <description>
+ Sets the font data source at index [code]idx[/code]. If the index does not exist, nothing happens.
+ </description>
+ </method>
+ <method name="set_spacing">
+ <return type="void">
+ </return>
+ <argument index="0" name="type" type="int">
+ </argument>
+ <argument index="1" name="value" type="int">
+ </argument>
<description>
+ Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
</description>
</method>
<method name="update_changes">
<return type="void">
</return>
<description>
- After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it.
+ After editing a font (changing data sources, etc.). Call this function to propagate changes to controls that might use it.
</description>
</method>
</methods>
+ <members>
+ <member name="extra_spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0">
+ Extra spacing at the bottom in pixels.
+ </member>
+ <member name="extra_spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0">
+ Extra character spacing in pixels.
+ </member>
+ </members>
<constants>
+ <constant name="SPACING_TOP" value="0" enum="SpacingType">
+ Spacing at the top of the line.
+ </constant>
+ <constant name="SPACING_BOTTOM" value="1" enum="SpacingType">
+ Spacing at the bottom of the line.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml
new file mode 100644
index 0000000000..e2c35f9ce7
--- /dev/null
+++ b/doc/classes/FontData.xml
@@ -0,0 +1,330 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="FontData" inherits="Resource" version="4.0">
+ <brief_description>
+ Font data source, file or memory buffer.
+ </brief_description>
+ <description>
+ Built-in text servers support font data sources of the following formats:
+ - Bitmap fonts in the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format. Handles [code].fnt, *.font[/code] fonts containing texture atlases. Non-scalable. Supports distance fields. Complex text shaping support is limited.
+ - Dynamic fonts using the [url=https://www.freetype.org/]FreeType[/url] and [url=https://github.com/silnrsi/graphite/]Graphite[/url] library for rasterization. Handles [code]*.ttf, *.otf[/code] fonts. Scalable. Doesn't support distance fields. Supports complex text shaping and OpenType features.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="draw_glyph" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="canvas" type="RID">
+ </argument>
+ <argument index="1" name="size" type="int">
+ </argument>
+ <argument index="2" name="pos" type="Vector2">
+ </argument>
+ <argument index="3" name="index" type="int">
+ </argument>
+ <argument index="4" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
+ Returns advance of the glyph for horizontal and vertical layouts.
+ Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+ </description>
+ </method>
+ <method name="draw_glyph_outline" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="canvas" type="RID">
+ </argument>
+ <argument index="1" name="size" type="int">
+ </argument>
+ <argument index="2" name="outline_size" type="int">
+ </argument>
+ <argument index="3" name="pos" type="Vector2">
+ </argument>
+ <argument index="4" name="index" type="int">
+ </argument>
+ <argument index="5" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code]. If outline drawing is not supported, nothing is drawn.
+ Returns advance of the glyph for horizontal and vertical layouts (regardless of outline drawing support).
+ Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+ </description>
+ </method>
+ <method name="get_ascent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="size" type="int">
+ </argument>
+ <description>
+ Returns the font ascent (number of pixels above the baseline).
+ </description>
+ </method>
+ <method name="get_base_size" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the base size of the font (the only size supported for non-scalable fonts, meaningless for scalable fonts).
+ </description>
+ </method>
+ <method name="get_descent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="size" type="int">
+ </argument>
+ <description>
+ Returns the font descent (number of pixels below the baseline).
+ </description>
+ </method>
+ <method name="get_glyph_advance" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="size" type="int">
+ </argument>
+ <description>
+ Returns advance of the glyph for horizontal and vertical layouts.
+ Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+ </description>
+ </method>
+ <method name="get_glyph_index" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="char" type="int">
+ </argument>
+ <argument index="1" name="variation_selector" type="int" default="0">
+ </argument>
+ <description>
+ Return the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
+ </description>
+ </method>
+ <method name="get_glyph_kerning" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="index_a" type="int">
+ </argument>
+ <argument index="1" name="index_b" type="int">
+ </argument>
+ <argument index="2" name="size" type="int">
+ </argument>
+ <description>
+ Returns a kerning of the pair of glyphs for horizontal and vertical layouts.
+ Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+ </description>
+ </method>
+ <method name="get_height" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="size" type="int">
+ </argument>
+ <description>
+ Returns the total font height (ascent plus descent) in pixels.
+ </description>
+ </method>
+ <method name="get_language_support_override" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="language" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code] if support override is enabled for the [code]language[/code].
+ </description>
+ </method>
+ <method name="get_language_support_overrides" qualifiers="const">
+ <return type="PackedStringArray">
+ </return>
+ <description>
+ Returns list of language support overrides.
+ </description>
+ </method>
+ <method name="get_script_support_override" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="script" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code] if support override is enabled for the [code]script[/code].
+ </description>
+ </method>
+ <method name="get_script_support_overrides" qualifiers="const">
+ <return type="PackedStringArray">
+ </return>
+ <description>
+ Returns list of script support overrides.
+ </description>
+ </method>
+ <method name="get_supported_chars" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Returns a string containing all the characters available in the font.
+ </description>
+ </method>
+ <method name="get_underline_position" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="size" type="int">
+ </argument>
+ <description>
+ Returns underline offset (number of pixels below the baseline).
+ </description>
+ </method>
+ <method name="get_underline_thickness" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="size" type="int">
+ </argument>
+ <description>
+ Returns underline thickness in pixels.
+ </description>
+ </method>
+ <method name="get_variation" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <description>
+ Returns variation coordinate [code]tag[/code].
+ </description>
+ </method>
+ <method name="get_variation_list" qualifiers="const">
+ <return type="Dictionary">
+ </return>
+ <description>
+ Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code].
+ Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant.
+ </description>
+ </method>
+ <method name="has_char" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="char" type="int">
+ </argument>
+ <description>
+ Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
+ </description>
+ </method>
+ <method name="has_outline" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code], if font supports drawing glyph outlines.
+ </description>
+ </method>
+ <method name="is_language_supported" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="language" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code).
+ </description>
+ </method>
+ <method name="is_script_supported" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="script" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code).
+ </description>
+ </method>
+ <method name="load_memory">
+ <return type="void">
+ </return>
+ <argument index="0" name="data" type="PackedByteArray">
+ </argument>
+ <argument index="1" name="type" type="String">
+ </argument>
+ <argument index="2" name="base_size" type="int" default="16">
+ </argument>
+ <description>
+ Creates new font from the data in memory.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
+ </description>
+ </method>
+ <method name="load_resource">
+ <return type="void">
+ </return>
+ <argument index="0" name="filename" type="String">
+ </argument>
+ <argument index="1" name="base_size" type="int" default="16">
+ </argument>
+ <description>
+ Creates new font from the file.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
+ </description>
+ </method>
+ <method name="remove_language_support_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="language" type="String">
+ </argument>
+ <description>
+ Remove language support override.
+ </description>
+ </method>
+ <method name="remove_script_support_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="script" type="String">
+ </argument>
+ <description>
+ Removes script support override.
+ </description>
+ </method>
+ <method name="set_language_support_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="language" type="String">
+ </argument>
+ <argument index="1" name="supported" type="bool">
+ </argument>
+ <description>
+ Adds override for [method is_language_supported].
+ </description>
+ </method>
+ <method name="set_script_support_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="script" type="String">
+ </argument>
+ <argument index="1" name="supported" type="bool">
+ </argument>
+ <description>
+ Adds override for [method is_script_supported].
+ </description>
+ </method>
+ <method name="set_variation">
+ <return type="void">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <argument index="1" name="value" type="float">
+ </argument>
+ <description>
+ Sets variation coordinate [code]tag[/code].
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" default="false">
+ If [code]true[/code], the font is rendered with anti-aliasing.
+ </member>
+ <member name="data_path" type="String" setter="set_data_path" getter="get_data_path" default="&quot;&quot;">
+ The path to the font data file. If font data was loaded from memory location is set to [code]"(Memory)"[/code].
+ </member>
+ <member name="distance_field_hint" type="bool" setter="set_distance_field_hint" getter="get_distance_field_hint" default="false">
+ If [code]true[/code], distance field hint is enabled.
+ </member>
+ <member name="force_autohinter" type="bool" setter="set_force_autohinter" getter="get_force_autohinter" default="false">
+ If [code]true[/code], default autohinter is used for font hinting.
+ </member>
+ <member name="hinting" type="int" setter="set_hinting" getter="get_hinting" enum="TextServer.Hinting" default="0">
+ The font hinting mode used by FreeType. See [enum TextServer.Hinting] for options.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/FuncRef.xml b/doc/classes/FuncRef.xml
deleted file mode 100644
index bf0c0b0d34..0000000000
--- a/doc/classes/FuncRef.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="FuncRef" inherits="Reference" version="4.0">
- <brief_description>
- Reference to a function in an object.
- </brief_description>
- <description>
- In GDScript, functions are not [i]first-class objects[/i]. This means it is impossible to store them directly as variables, return them from another function, or pass them as arguments.
- However, by creating a [FuncRef] using the [method @GDScript.funcref] function, a reference to a function in a given object can be created, passed around and called.
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="call_func" qualifiers="vararg">
- <return type="Variant">
- </return>
- <description>
- Calls the referenced function previously set by [method set_function] or [method @GDScript.funcref].
- </description>
- </method>
- <method name="call_funcv">
- <return type="Variant">
- </return>
- <argument index="0" name="arg_array" type="Array">
- </argument>
- <description>
- Calls the referenced function previously set by [method set_function] or [method @GDScript.funcref]. Contrarily to [method call_func], this method does not support a variable number of arguments but expects all parameters to be passed via a single [Array].
- </description>
- </method>
- <method name="is_valid" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Returns whether the object still exists and has the function assigned.
- </description>
- </method>
- <method name="set_function">
- <return type="void">
- </return>
- <argument index="0" name="name" type="StringName">
- </argument>
- <description>
- The name of the referenced function to call on the object, without parentheses or any parameters.
- </description>
- </method>
- <method name="set_instance">
- <return type="void">
- </return>
- <argument index="0" name="instance" type="Object">
- </argument>
- <description>
- The object containing the referenced function. This object must be of a type actually inheriting from [Object], not a built-in type such as [int], [Vector2] or [Dictionary].
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml
index 9199468ab3..52d3698201 100644
--- a/doc/classes/GIProbe.xml
+++ b/doc/classes/GIProbe.xml
@@ -9,6 +9,7 @@
</description>
<tutorials>
<link title="GI probes">https://docs.godotengine.org/en/latest/tutorials/3d/gi_probes.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="bake">
diff --git a/doc/classes/GIProbeData.xml b/doc/classes/GIProbeData.xml
index 228e1afb4c..693df8f819 100644
--- a/doc/classes/GIProbeData.xml
+++ b/doc/classes/GIProbeData.xml
@@ -5,6 +5,7 @@
<description>
</description>
<tutorials>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="allocate">
diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml
index 244bdcf2f3..c09151405a 100644
--- a/doc/classes/GPUParticles2D.xml
+++ b/doc/classes/GPUParticles2D.xml
@@ -9,6 +9,7 @@
</description>
<tutorials>
<link title="Particle systems (2D)">https://docs.godotengine.org/en/latest/tutorials/2d/particle_systems_2d.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="capture_rect" qualifiers="const">
@@ -51,10 +52,6 @@
<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
</member>
- <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
- Normal map to be used for the [member texture] property.
- [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
- </member>
<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end.
</member>
diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml
index 8444610f49..d1296c3418 100644
--- a/doc/classes/GPUParticles3D.xml
+++ b/doc/classes/GPUParticles3D.xml
@@ -9,6 +9,7 @@
</description>
<tutorials>
<link title="Controlling thousands of fish with Particles">https://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/controlling_thousands_of_fish.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="capture_aabb" qualifiers="const">
@@ -66,6 +67,8 @@
<member name="amount" type="int" setter="set_amount" getter="get_amount" default="8">
Number of particles to emit.
</member>
+ <member name="collision_base_size" type="float" setter="set_collision_base_size" getter="get_collision_base_size" default="0.01">
+ </member>
<member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="GPUParticles3D.DrawOrder" default="0">
Particle draw order. Uses [enum DrawOrder] values.
</member>
diff --git a/doc/classes/GPUParticlesAttractor3D.xml b/doc/classes/GPUParticlesAttractor3D.xml
new file mode 100644
index 0000000000..111827d294
--- /dev/null
+++ b/doc/classes/GPUParticlesAttractor3D.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesAttractor3D" inherits="VisualInstance3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="attenuation" type="float" setter="set_attenuation" getter="get_attenuation" default="1.0">
+ </member>
+ <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295">
+ </member>
+ <member name="directionality" type="float" setter="set_directionality" getter="get_directionality" default="0.0">
+ </member>
+ <member name="strength" type="float" setter="set_strength" getter="get_strength" default="1.0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesAttractorBox.xml b/doc/classes/GPUParticlesAttractorBox.xml
new file mode 100644
index 0000000000..68616f9bbd
--- /dev/null
+++ b/doc/classes/GPUParticlesAttractorBox.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesAttractorBox" inherits="GPUParticlesAttractor3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesAttractorSphere.xml b/doc/classes/GPUParticlesAttractorSphere.xml
new file mode 100644
index 0000000000..6984427a96
--- /dev/null
+++ b/doc/classes/GPUParticlesAttractorSphere.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesAttractorSphere" inherits="GPUParticlesAttractor3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesAttractorVectorField.xml b/doc/classes/GPUParticlesAttractorVectorField.xml
new file mode 100644
index 0000000000..cf5e375ea3
--- /dev/null
+++ b/doc/classes/GPUParticlesAttractorVectorField.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesAttractorVectorField" inherits="GPUParticlesAttractor3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollision3D.xml b/doc/classes/GPUParticlesCollision3D.xml
new file mode 100644
index 0000000000..dce9a32fc4
--- /dev/null
+++ b/doc/classes/GPUParticlesCollision3D.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollision3D" inherits="VisualInstance3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollisionBox.xml b/doc/classes/GPUParticlesCollisionBox.xml
new file mode 100644
index 0000000000..17fc124c41
--- /dev/null
+++ b/doc/classes/GPUParticlesCollisionBox.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollisionBox" inherits="GPUParticlesCollision3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollisionHeightField.xml b/doc/classes/GPUParticlesCollisionHeightField.xml
new file mode 100644
index 0000000000..c6987515a9
--- /dev/null
+++ b/doc/classes/GPUParticlesCollisionHeightField.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollisionHeightField" inherits="GPUParticlesCollision3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ <member name="follow_camera_enabled" type="bool" setter="set_follow_camera_mode" getter="is_follow_camera_mode_enabled" default="false">
+ </member>
+ <member name="follow_camera_push_ratio" type="float" setter="set_follow_camera_push_ratio" getter="get_follow_camera_push_ratio" default="0.1">
+ </member>
+ <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionHeightField.Resolution" default="2">
+ </member>
+ <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="GPUParticlesCollisionHeightField.UpdateMode" default="0">
+ </member>
+ </members>
+ <constants>
+ <constant name="RESOLUTION_256" value="0" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_512" value="1" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_1024" value="2" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_2048" value="3" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_4096" value="4" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_8192" value="5" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_MAX" value="6" enum="Resolution">
+ </constant>
+ <constant name="UPDATE_MODE_WHEN_MOVED" value="0" enum="UpdateMode">
+ </constant>
+ <constant name="UPDATE_MODE_ALWAYS" value="1" enum="UpdateMode">
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollisionSDF.xml b/doc/classes/GPUParticlesCollisionSDF.xml
new file mode 100644
index 0000000000..c3cbe4b1c6
--- /dev/null
+++ b/doc/classes/GPUParticlesCollisionSDF.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollisionSDF" inherits="GPUParticlesCollision3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )">
+ </member>
+ <member name="resolution" type="int" setter="set_resolution" getter="get_resolution" enum="GPUParticlesCollisionSDF.Resolution" default="2">
+ </member>
+ <member name="texture" type="Texture3D" setter="set_texture" getter="get_texture">
+ </member>
+ <member name="thickness" type="float" setter="set_thickness" getter="get_thickness" default="1.0">
+ </member>
+ </members>
+ <constants>
+ <constant name="RESOLUTION_16" value="0" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_32" value="1" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_64" value="2" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_128" value="3" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_256" value="4" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_512" value="5" enum="Resolution">
+ </constant>
+ <constant name="RESOLUTION_MAX" value="6" enum="Resolution">
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/GPUParticlesCollisionSphere.xml b/doc/classes/GPUParticlesCollisionSphere.xml
new file mode 100644
index 0000000000..41150960d2
--- /dev/null
+++ b/doc/classes/GPUParticlesCollisionSphere.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GPUParticlesCollisionSphere" inherits="GPUParticlesCollision3D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Generic6DOFJoint3D.xml b/doc/classes/Generic6DOFJoint3D.xml
index ae86ab7365..79b861dfb8 100644
--- a/doc/classes/Generic6DOFJoint3D.xml
+++ b/doc/classes/Generic6DOFJoint3D.xml
@@ -348,8 +348,6 @@
</member>
<member name="linear_spring_z/stiffness" type="float" setter="set_param_z" getter="get_param_z" default="0.01">
</member>
- <member name="precision" type="int" setter="set_precision" getter="get_precision" default="1">
- </member>
</members>
<constants>
<constant name="PARAM_LINEAR_LOWER_LIMIT" value="0" enum="Param">
diff --git a/doc/classes/Geometry2D.xml b/doc/classes/Geometry2D.xml
index 86dc8e864a..2c0d9b54d1 100644
--- a/doc/classes/Geometry2D.xml
+++ b/doc/classes/Geometry2D.xml
@@ -91,7 +91,7 @@
<argument index="3" name="q2" type="Vector2">
</argument>
<description>
- Given the two 2D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector2Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]).
+ Given the two 2D segments ([code]p1[/code], [code]q1[/code]) and ([code]p2[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector2Array] that contains this point on ([code]p1[/code], [code]q1[/code]) as well the accompanying point on ([code]p2[/code], [code]q2[/code]).
</description>
</method>
<method name="intersect_polygons">
@@ -200,13 +200,22 @@
Inflates or deflates [code]polygon[/code] by [code]delta[/code] units (pixels). If [code]delta[/code] is positive, makes the polygon grow outward. If [code]delta[/code] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [code]delta[/code] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon.
Each polygon's vertices will be rounded as determined by [code]join_type[/code], see [enum PolyJoinType].
The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
- [b]Note:[/b] To translate the polygon's vertices specifically, use the [method Transform2D.xform] method:
- [codeblock]
+ [b]Note:[/b] To translate the polygon's vertices specifically, multiply them to a [Transform2D]:
+ [codeblocks]
+ [gdscript]
var polygon = PackedVector2Array([Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)])
var offset = Vector2(50, 50)
- polygon = Transform2D(0, offset).xform(polygon)
+ polygon = Transform2D(0, offset) * polygon
print(polygon) # prints [Vector2(50, 50), Vector2(150, 50), Vector2(150, 150), Vector2(50, 150)]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var polygon = new Vector2[] { new Vector2(0, 0), new Vector2(100, 0), new Vector2(100, 100), new Vector2(0, 100) };
+ var offset = new Vector2(50, 50);
+ // TODO: This code is not valid right now. Ping @aaronfranke about it before Godot 4.0 is out.
+ //polygon = (Vector2[]) new Transform2D(0, offset).Xform(polygon);
+ //GD.Print(polygon); // prints [Vector2(50, 50), Vector2(150, 50), Vector2(150, 150), Vector2(50, 150)]
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="offset_polyline">
diff --git a/doc/classes/Geometry3D.xml b/doc/classes/Geometry3D.xml
index ec685a5ce7..d0b930defb 100644
--- a/doc/classes/Geometry3D.xml
+++ b/doc/classes/Geometry3D.xml
@@ -102,15 +102,6 @@
Given the two 3D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector3Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]).
</description>
</method>
- <method name="get_uv84_normal_bit">
- <return type="int">
- </return>
- <argument index="0" name="normal" type="Vector3">
- </argument>
- <description>
- Used internally by the engine.
- </description>
- </method>
<method name="ray_intersects_triangle">
<return type="Variant">
</return>
diff --git a/doc/classes/Gradient.xml b/doc/classes/Gradient.xml
index abb105a41c..4ccbdee144 100644
--- a/doc/classes/Gradient.xml
+++ b/doc/classes/Gradient.xml
@@ -4,7 +4,7 @@
A color interpolator resource which can be used to generate colors between user-defined color points.
</brief_description>
<description>
- Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the ramp will interpolate from color 1 to color 2 and from color 2 to color 3. The ramp will initially have 2 colors (black and white), one (black) at ramp lower offset 0 and the other (white) at the ramp higher offset 1.
+ Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the gradient will interpolate from color 1 to color 2 and from color 2 to color 3. The gradient will initially have 2 colors (black and white), one (black) at gradient lower offset 0 and the other (white) at the gradient higher offset 1.
</description>
<tutorials>
</tutorials>
@@ -17,7 +17,7 @@
<argument index="1" name="color" type="Color">
</argument>
<description>
- Adds the specified color to the end of the ramp, with the specified offset.
+ Adds the specified color to the end of the gradient, with the specified offset.
</description>
</method>
<method name="get_color">
@@ -26,7 +26,7 @@
<argument index="0" name="point" type="int">
</argument>
<description>
- Returns the color of the ramp color at index [code]point[/code].
+ Returns the color of the gradient color at index [code]point[/code].
</description>
</method>
<method name="get_offset">
@@ -35,14 +35,14 @@
<argument index="0" name="point" type="int">
</argument>
<description>
- Returns the offset of the ramp color at index [code]point[/code].
+ Returns the offset of the gradient color at index [code]point[/code].
</description>
</method>
<method name="get_point_count" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the number of colors in the ramp.
+ Returns the number of colors in the gradient.
</description>
</method>
<method name="interpolate">
@@ -71,7 +71,7 @@
<argument index="1" name="color" type="Color">
</argument>
<description>
- Sets the color of the ramp color at index [code]point[/code].
+ Sets the color of the gradient color at index [code]point[/code].
</description>
</method>
<method name="set_offset">
@@ -82,7 +82,7 @@
<argument index="1" name="offset" type="float">
</argument>
<description>
- Sets the offset for the ramp color at index [code]point[/code].
+ Sets the offset for the gradient color at index [code]point[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml
index 9d00ffe233..c5884aa44a 100644
--- a/doc/classes/GraphEdit.xml
+++ b/doc/classes/GraphEdit.xml
@@ -174,7 +174,22 @@
</method>
</methods>
<members>
+ <member name="connection_lines_antialiased" type="bool" setter="set_connection_lines_antialiased" getter="is_connection_lines_antialiased" default="true">
+ If [code]true[/code], the lines between nodes will use antialiasing.
+ </member>
+ <member name="connection_lines_thickness" type="float" setter="set_connection_lines_thickness" getter="get_connection_lines_thickness" default="2.0">
+ The thickness of the lines between the nodes.
+ </member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" />
+ <member name="minimap_enabled" type="bool" setter="set_minimap_enabled" getter="is_minimap_enabled" default="true">
+ If [code]true[/code], the minimap is visible.
+ </member>
+ <member name="minimap_opacity" type="float" setter="set_minimap_opacity" getter="get_minimap_opacity" default="0.65">
+ The opacity of the minimap rectangle.
+ </member>
+ <member name="minimap_size" type="Vector2" setter="set_minimap_size" getter="get_minimap_size" default="Vector2( 240, 160 )">
+ The size of the minimap rectangle. The map itself is based on the size of the grid area and is scaled to fit this rectangle.
+ </member>
<member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" override="true" default="true" />
<member name="right_disconnects" type="bool" setter="set_right_disconnects" getter="is_right_disconnects_enabled" default="false">
If [code]true[/code], enables disconnection of existing connections in the GraphEdit by dragging the right end.
@@ -193,16 +208,11 @@
</member>
</members>
<signals>
- <signal name="_begin_node_move">
+ <signal name="begin_node_move">
<description>
Emitted at the beginning of a GraphNode movement.
</description>
</signal>
- <signal name="_end_node_move">
- <description>
- Emitted at the end of a GraphNode movement.
- </description>
- </signal>
<signal name="connection_from_empty">
<argument index="0" name="to" type="StringName">
</argument>
@@ -266,6 +276,11 @@
Emitted when a GraphNode is attempted to be duplicated in the GraphEdit.
</description>
</signal>
+ <signal name="end_node_move">
+ <description>
+ Emitted at the end of a GraphNode movement.
+ </description>
+ </signal>
<signal name="node_selected">
<argument index="0" name="node" type="Node">
</argument>
@@ -317,6 +332,8 @@
<theme_item name="grid_minor" type="Color" default="Color( 1, 1, 1, 0.05 )">
Color of minor grid lines.
</theme_item>
+ <theme_item name="minimap" type="Texture2D">
+ </theme_item>
<theme_item name="minus" type="Texture2D">
The icon for the zoom out button.
</theme_item>
diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml
index 33074536da..632d138932 100644
--- a/doc/classes/GraphNode.xml
+++ b/doc/classes/GraphNode.xml
@@ -18,6 +18,13 @@
Disables all input and output slots of the GraphNode.
</description>
</method>
+ <method name="clear_opentype_features">
+ <return type="void">
+ </return>
+ <description>
+ Removes all OpenType features.
+ </description>
+ </method>
<method name="clear_slot">
<return type="void">
</return>
@@ -95,6 +102,15 @@
Returns the type of the output connection [code]idx[/code].
</description>
</method>
+ <method name="get_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code].
+ </description>
+ </method>
<method name="get_slot_color_left" qualifiers="const">
<return type="Color">
</return>
@@ -149,6 +165,17 @@
Returns [code]true[/code] if right (output) slot [code]idx[/code] is enabled, [code]false[/code] otherwise.
</description>
</method>
+ <method name="set_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <argument index="1" name="value" type="int">
+ </argument>
+ <description>
+ Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+ </description>
+ </method>
<method name="set_slot">
<return type="void">
</return>
@@ -184,6 +211,9 @@
<member name="comment" type="bool" setter="set_comment" getter="is_comment" default="false">
If [code]true[/code], the GraphNode is a comment node.
</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="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" override="true" enum="Control.MouseFilter" default="0" />
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
The offset of the GraphNode, relative to the scroll offset of the [GraphEdit].
@@ -203,6 +233,9 @@
If [code]true[/code], the close button will be visible.
[b]Note:[/b] Pressing it will only emit the [signal close_request] signal, the GraphNode needs to be removed manually.
</member>
+ <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="title" type="String" setter="set_title" getter="get_title" default="&quot;&quot;">
The text displayed in the GraphNode's title bar.
</member>
diff --git a/doc/classes/GridContainer.xml b/doc/classes/GridContainer.xml
index 6ee794c5c4..ca6b4e69c3 100644
--- a/doc/classes/GridContainer.xml
+++ b/doc/classes/GridContainer.xml
@@ -9,6 +9,7 @@
[b]Note:[/b] GridContainer only works with child nodes inheriting from Control. It won't rearrange child nodes inheriting from Node2D.
</description>
<tutorials>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/HMACContext.xml b/doc/classes/HMACContext.xml
new file mode 100644
index 0000000000..00d528ef8f
--- /dev/null
+++ b/doc/classes/HMACContext.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="HMACContext" inherits="Reference" version="4.0">
+ <brief_description>
+ Used to create an HMAC for a message using a key.
+ </brief_description>
+ <description>
+ The HMACContext class is useful for advanced HMAC use cases, such as streaming the message as it supports creating the message over time rather than providing it all at once.
+ [codeblocks]
+ [gdscript]
+ extends Node
+ var ctx = HMACContext.new()
+
+ func _ready():
+ var key = "supersecret".to_utf8()
+ var err = ctx.start(HashingContext.HASH_SHA256, key)
+ assert(err == OK)
+ var msg1 = "this is ".to_utf8()
+ var msg2 = "vewy vewy secret".to_utf8()
+ err = ctx.update(msg1)
+ assert(err == OK)
+ err = ctx.update(msg2)
+ assert(err == OK)
+ var hmac = ctx.finish()
+ print(hmac.hex_encode())
+
+ [/gdscript]
+ [csharp]
+ using Godot;
+ using System;
+ using System.Diagnostics;
+
+ public class CryptoNode : Node
+ {
+ private HMACContext ctx = new HMACContext();
+ public override void _Ready()
+ {
+ PackedByteArray key = String("supersecret").to_utf8();
+ Error err = ctx.Start(HashingContext.HASH_SHA256, key);
+ GD.Assert(err == OK);
+ PackedByteArray msg1 = String("this is ").to_utf8();
+ PackedByteArray msg2 = String("vewy vew secret").to_utf8();
+ err = ctx.Update(msg1);
+ GD.Assert(err == OK);
+ err = ctx.Update(msg2);
+ GD.Assert(err == OK);
+ PackedByteArray hmac = ctx.Finish();
+ GD.Print(hmac.HexEncode());
+ }
+ }
+
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] Not available in HTML5 exports.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="finish">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ Returns the resulting HMAC. If the HMAC failed, an empty [PackedByteArray] is returned.
+ </description>
+ </method>
+ <method name="start">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="hash_type" type="int" enum="HashingContext.HashType">
+ </argument>
+ <argument index="1" name="key" type="PackedByteArray">
+ </argument>
+ <description>
+ Initializes the HMACContext. This method cannot be called again on the same HMACContext until [method finish] has been called.
+ </description>
+ </method>
+ <method name="update">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="data" type="PackedByteArray">
+ </argument>
+ <description>
+ Updates the message to be HMACed. This can be called multiple times before [method finish] is called to append [code]data[/code] to the message, but cannot be called until [method start] has been called.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index 9dc38b018a..b6594aac39 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -9,6 +9,7 @@
A [HTTPClient] should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side.
For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616).
[b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header.
+ [b]Note:[/b] SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error.
</description>
<tutorials>
<link title="HTTP client class">https://docs.godotengine.org/en/latest/tutorials/networking/http_client_class.html</link>
@@ -111,17 +112,31 @@
</argument>
<description>
Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var fields = {"username": "user", "password": "pass"}
var query_string = http_client.query_string_from_dict(fields)
# Returns "username=user&amp;password=pass"
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var fields = new Godot.Collections.Dictionary { { "username", "user" }, { "password", "pass" } };
+ string queryString = new HTTPClient().QueryStringFromDict(fields);
+ // Returns "username=user&amp;password=pass"
+ [/csharp]
+ [/codeblocks]
Furthermore, if a key has a [code]null[/code] value, only the key itself is added, without equal sign and value. If the value is an array, for each value in it a pair with the same key is added.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var fields = {"single": 123, "not_valued": null, "multiple": [22, 33, 44]}
var query_string = http_client.query_string_from_dict(fields)
# Returns "single=123&amp;not_valued&amp;multiple=22&amp;multiple=33&amp;multiple=44"
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var fields = new Godot.Collections.Dictionary{{"single", 123}, {"notValued", null}, {"multiple", new Godot.Collections.Array{22, 33, 44}}};
+ string queryString = new HTTPClient().QueryStringFromDict(fields);
+ // Returns "single=123&amp;not_valued&amp;multiple=22&amp;multiple=33&amp;multiple=44"
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="read_response_body_chunk">
@@ -146,12 +161,20 @@
Sends a request to the connected host. The URL parameter is just the part after the host, so for [code]http://somehost.com/index.php[/code], it is [code]index.php[/code].
Headers are HTTP request headers. For available HTTP methods, see [enum Method].
To create a POST request with query strings to push to the server, do:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var fields = {"username" : "user", "password" : "pass"}
var query_string = http_client.query_string_from_dict(fields)
var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(query_string.length())]
var result = http_client.request(http_client.METHOD_POST, "index.php", headers, query_string)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var fields = new Godot.Collections.Dictionary { { "username", "user" }, { "password", "pass" } };
+ string queryString = new HTTPClient().QueryStringFromDict(fields);
+ string[] headers = {"Content-Type: application/x-www-form-urlencoded", "Content-Length: " + queryString.Length};
+ var result = new HTTPClient().Request(HTTPClient.Method.Post, "index.php", headers, queryString);
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] The [code]request_data[/code] parameter is ignored if [code]method[/code] is [constant HTTPClient.METHOD_GET]. This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See [method String.http_escape] for an example.
</description>
</method>
@@ -180,7 +203,7 @@
<member name="connection" type="StreamPeer" setter="set_connection" getter="get_connection">
The connection to use for this client.
</member>
- <member name="read_chunk_size" type="int" setter="set_read_chunk_size" getter="get_read_chunk_size" default="4096">
+ <member name="read_chunk_size" type="int" setter="set_read_chunk_size" getter="get_read_chunk_size" default="65536">
The size of the buffer used and maximum bytes to read per iteration. See [method read_response_body_chunk].
</member>
</members>
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index dc88c53810..f2ab93033a 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -7,7 +7,8 @@
A node with the ability to send HTTP requests. Uses [HTTPClient] internally.
Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP.
[b]Example of contacting a REST API and printing one of its returned fields:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
func _ready():
# Create an HTTP request node and connect its completion signal.
var http_request = HTTPRequest.new()
@@ -23,7 +24,7 @@
# Note: Don't make simultaneous requests using a single HTTPRequest node.
# The snippet below is provided for reference only.
var body = {"name": "Godette"}
- var error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body)
+ error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body)
if error != OK:
push_error("An error occurred in the HTTP request.")
@@ -34,9 +35,48 @@
# Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org).
print(response.headers["User-Agent"])
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ // Create an HTTP request node and connect its completion signal.
+ var httpRequest = new HTTPRequest();
+ AddChild(httpRequest);
+ httpRequest.Connect("request_completed", this, nameof(HttpRequestCompleted));
+
+ // Perform a GET request. The URL below returns JSON as of writing.
+ Error error = httpRequest.Request("https://httpbin.org/get");
+ if (error != Error.Ok)
+ {
+ GD.PushError("An error occurred in the HTTP request.");
+ }
+
+ // Perform a POST request. The URL below returns JSON as of writing.
+ // Note: Don't make simultaneous requests using a single HTTPRequest node.
+ // The snippet below is provided for reference only.
+ string[] body = { "name", "Godette" };
+ // GDScript to_json is non existent, so we use JSON.Print() here.
+ error = httpRequest.Request("https://httpbin.org/post", null, true, HTTPClient.Method.Post, JSON.Print(body));
+ if (error != Error.Ok)
+ {
+ GD.PushError("An error occurred in the HTTP request.");
+ }
+ }
+
+
+ // Called when the HTTP request is completed.
+ private void HttpRequestCompleted(int result, int response_code, string[] headers, byte[] body)
+ {
+ // GDScript parse_json is non existent so we have to use JSON.parse, which has a slightly different syntax.
+ var response = JSON.Parse(body.GetStringFromUTF8()).Result as Godot.Collections.Dictionary;
+ // Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org).
+ GD.Print((response["headers"] as Godot.Collections.Dictionary)["User-Agent"]);
+ }
+ [/csharp]
+ [/codeblocks]
[b]Example of loading and displaying an image using HTTPRequest:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
func _ready():
# Create an HTTP request node and connect its completion signal.
var http_request = HTTPRequest.new()
@@ -51,6 +91,9 @@
# Called when the HTTP request is completed.
func _http_request_completed(result, response_code, headers, body):
+ if result != HTTPRequest.RESULT_SUCCESS:
+ push_error("Image couldn't be downloaded. Try a different image.")
+
var image = Image.new()
var error = image.load_png_from_buffer(body)
if error != OK:
@@ -63,13 +106,52 @@
var texture_rect = TextureRect.new()
add_child(texture_rect)
texture_rect.texture = texture
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ // Create an HTTP request node and connect its completion signal.
+ var httpRequest = new HTTPRequest();
+ AddChild(httpRequest);
+ httpRequest.Connect("request_completed", this, nameof(HttpRequestCompleted));
+
+ // Perform the HTTP request. The URL below returns a PNG image as of writing.
+ Error error = httpRequest.Request("https://via.placeholder.com/512");
+ if (error != Error.Ok)
+ {
+ GD.PushError("An error occurred in the HTTP request.");
+ }
+ }
+
+
+ // Called when the HTTP request is completed.
+ private void HttpRequestCompleted(int result, int response_code, string[] headers, byte[] body)
+ {
+ if (result != (int)HTTPRequest.Result.Success)
+ {
+ GD.PushError("Image couldn't be downloaded. Try a different image.");
+ }
+ var image = new Image();
+ Error error = image.LoadPngFromBuffer(body);
+ if (error != Error.Ok)
+ {
+ GD.PushError("Couldn't load the image.");
+ }
+
+ var texture = new ImageTexture();
+ texture.CreateFromImage(image);
+
+ // Display the image in a TextureRect node.
+ var textureRect = new TextureRect();
+ AddChild(textureRect);
+ textureRect.Texture = texture;
+ }
+ [/csharp]
+ [/codeblocks]
- [b]Gzipped response bodies[/b]
- HttpRequest will automatically handle decompression of response bodies.
- A "Accept-Encoding" header will be automatically added to each of your requests, unless one is already specified.
- Any response with a "Content-Encoding: gzip" header will automatically be decompressed and delivered to you as a uncompressed bytes.
+ [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] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header.
+ [b]Note:[/b] SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error.
</description>
<tutorials>
<link title="Making HTTP requests">https://docs.godotengine.org/en/latest/tutorials/networking/http_request_class.html</link>
@@ -146,16 +228,16 @@
<members>
<member name="accept_gzip" type="bool" setter="set_accept_gzip" getter="is_accepting_gzip" default="true">
If [code]true[/code], this header will be added to each request: [code]Accept-Encoding: gzip, deflate[/code] telling servers that it's okay to compress response bodies.
- Any Reponse body declaring a [code]Content-Encoding[/code] of either [code]gzip[/code] or [code]deflate[/code] will then be automatically decompressed, and the uncompressed bytes will be delivered via [code]request_completed[/code].
+ Any Response body declaring a [code]Content-Encoding[/code] of either [code]gzip[/code] or [code]deflate[/code] will then be automatically decompressed, and the uncompressed bytes will be delivered via [code]request_completed[/code].
If the user has specified their own [code]Accept-Encoding[/code] header, then no header will be added regaurdless of [code]accept_gzip[/code].
If [code]false[/code] no header will be added, and no decompression will be performed on response bodies. The raw bytes of the response body will be returned via [code]request_completed[/code].
</member>
<member name="body_size_limit" type="int" setter="set_body_size_limit" getter="get_body_size_limit" default="-1">
Maximum allowed size for response bodies. If the response body is compressed, this will be used as the maximum allowed size for the decompressed body.
</member>
- <member name="download_chunk_size" type="int" setter="set_download_chunk_size" getter="get_download_chunk_size" default="4096">
+ <member name="download_chunk_size" type="int" setter="set_download_chunk_size" getter="get_download_chunk_size" default="65536">
The size of the buffer used and maximum bytes to read per iteration. See [member HTTPClient.read_chunk_size].
- Set this to a higher value (e.g. 65536 for 64 KiB) when downloading large files to achieve better speeds at the cost of memory.
+ Set this to a lower value (e.g. 4096 for 4 KiB) when downloading small files to decrease memory usage at the cost of download speeds.
</member>
<member name="download_file" type="String" setter="set_download_file" getter="get_download_file" default="&quot;&quot;">
The file to download into. Will output any received file into it.
diff --git a/doc/classes/HashingContext.xml b/doc/classes/HashingContext.xml
index f8152c813e..e020293d76 100644
--- a/doc/classes/HashingContext.xml
+++ b/doc/classes/HashingContext.xml
@@ -6,8 +6,9 @@
<description>
The HashingContext class provides an interface for computing cryptographic hashes over multiple iterations. This is useful for example when computing hashes of big files (so you don't have to load them all in memory), network streams, and data streams in general (so you don't have to hold buffers).
The [enum HashType] enum shows the supported hashing algorithms.
- [codeblock]
- const CHUNK_SIZE = 1024
+ [codeblocks]
+ [gdscript]
+ const CHUNK_SIZE = 102
func hash_file(path):
var ctx = HashingContext.new()
@@ -26,7 +27,36 @@
var res = ctx.finish()
# Print the result as hex string and array.
printt(res.hex_encode(), Array(res))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ public const int ChunkSize = 1024;
+
+ public void HashFile(string path)
+ {
+ var ctx = new HashingContext();
+ var file = new File();
+ // Start a SHA-256 context.
+ ctx.Start(HashingContext.HashType.Sha256);
+ // Check that file exists.
+ if (!file.FileExists(path))
+ {
+ return;
+ }
+ // Open the file to hash.
+ file.Open(path, File.ModeFlags.Read);
+ // Update the context after reading each chunk.
+ while (!file.EofReached())
+ {
+ ctx.Update(file.GetBuffer(ChunkSize));
+ }
+ // Get the computed hash.
+ byte[] res = ctx.Finish();
+ // Print the result as hex string and array.
+
+ GD.PrintT(res.HexEncode(), res);
+ }
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] Not available in HTML5 exports.
</description>
<tutorials>
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index 20be20db34..414249f110 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -4,10 +4,12 @@
Image datatype.
</brief_description>
<description>
- Native image datatype. Contains image data, which can be converted to a [Texture2D], and several functions to interact with it. The maximum width and height for an [Image] are [constant MAX_WIDTH] and [constant MAX_HEIGHT].
- [b]Note:[/b] The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images will fail to import.
+ Native image datatype. Contains image data which can be converted to an [ImageTexture] and provides commonly used [i]image processing[/i] methods. The maximum width and height for an [Image] are [constant MAX_WIDTH] and [constant MAX_HEIGHT].
+ An [Image] cannot be assigned to a [code]texture[/code] property of an object directly (such as [Sprite2D]), and has to be converted manually to an [ImageTexture] first.
+ [b]Note:[/b] The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images may fail to import.
</description>
<tutorials>
+ <link title="Importing images">https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_images.html</link>
</tutorials>
<methods>
<method name="blend_rect">
@@ -267,16 +269,18 @@
<argument index="1" name="y" type="int">
</argument>
<description>
- Returns the color of the pixel at [code](x, y)[/code]. This is the same as [method get_pixelv], but with two integer arguments instead of a [Vector2] argument.
+ Returns the color of the pixel at [code](x, y)[/code].
+ This is the same as [method get_pixelv], but with two integer arguments instead of a [Vector2i] argument.
</description>
</method>
<method name="get_pixelv" qualifiers="const">
<return type="Color">
</return>
- <argument index="0" name="src" type="Vector2">
+ <argument index="0" name="point" type="Vector2i">
</argument>
<description>
- Returns the color of the pixel at [code]src[/code]. This is the same as [method get_pixel], but with a [Vector2] argument instead of two integer arguments.
+ Returns the color of the pixel at [code]point[/code].
+ This is the same as [method get_pixel], but with a [Vector2i] argument instead of two integer arguments.
</description>
</method>
<method name="get_rect" qualifiers="const">
@@ -344,6 +348,18 @@
</argument>
<description>
Loads an image from file [code]path[/code]. See [url=https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_images.html#supported-image-formats]Supported image formats[/url] for a list of supported image formats and limitations.
+ [b]Warning:[/b] This method should only be used in the editor or in cases when you need to load external images at run-time, such as images located at the [code]user://[/code] directory, and may not work in exported projects.
+ See also [ImageTexture] description for usage examples.
+ </description>
+ </method>
+ <method name="load_bmp_from_buffer">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="buffer" type="PackedByteArray">
+ </argument>
+ <description>
+ Loads an image from the binary contents of a BMP file.
+ [b]Note:[/b] Godot's BMP module doesn't support 16-bit per pixel images. Only 1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported.
</description>
</method>
<method name="load_jpg_from_buffer">
@@ -406,7 +422,7 @@
<argument index="2" name="interpolation" type="int" enum="Image.Interpolation" default="1">
</argument>
<description>
- Resizes the image to the given [code]width[/code] and [code]height[/code]. New pixels are calculated using [code]interpolation[/code]. See [code]interpolation[/code] constants.
+ Resizes the image to the given [code]width[/code] and [code]height[/code]. New pixels are calculated using the [code]interpolation[/code] mode defined via [enum Interpolation] constants.
</description>
</method>
<method name="resize_to_po2">
@@ -414,8 +430,10 @@
</return>
<argument index="0" name="square" type="bool" default="false">
</argument>
+ <argument index="1" name="interpolation" type="int" enum="Image.Interpolation" default="1">
+ </argument>
<description>
- Resizes the image to the nearest power of 2 for the width and height. If [code]square[/code] is [code]true[/code] then set width and height to be the same.
+ Resizes the image to the nearest power of 2 for the width and height. If [code]square[/code] is [code]true[/code] then set width and height to be the same. New pixels are calculated using the [code]interpolation[/code] mode defined via [enum Interpolation] constants.
</description>
</method>
<method name="rgbe_to_srgb">
@@ -461,28 +479,56 @@
<argument index="2" name="color" type="Color">
</argument>
<description>
- Sets the [Color] of the pixel at [code](x, y)[/code]. Example:
- [codeblock]
+ Sets the [Color] of the pixel at [code](x, y)[/code] to [code]color[/code]. Example:
+ [codeblocks]
+ [gdscript]
+ var img_width = 10
+ var img_height = 5
var img = Image.new()
img.create(img_width, img_height, false, Image.FORMAT_RGBA8)
- img.set_pixel(x, y, color)
- [/codeblock]
+
+ img.set_pixel(1, 2, Color.red) # Sets the color at (1, 2) to red.
+ [/gdscript]
+ [csharp]
+ int imgWidth = 10;
+ int imgHeight = 5;
+ var img = new Image();
+ img.Create(imgWidth, imgHeight, false, Image.Format.Rgba8);
+
+ img.SetPixel(1, 2, Colors.Red); // Sets the color at (1, 2) to red.
+ [/csharp]
+ [/codeblocks]
+ This is the same as [method set_pixelv], but with a two integer arguments instead of a [Vector2i] argument.
</description>
</method>
<method name="set_pixelv">
<return type="void">
</return>
- <argument index="0" name="dst" type="Vector2">
+ <argument index="0" name="point" type="Vector2i">
</argument>
<argument index="1" name="color" type="Color">
</argument>
<description>
- Sets the [Color] of the pixel at [code](dst.x, dst.y)[/code]. Note that the [code]dst[/code] values must be integers. Example:
- [codeblock]
+ Sets the [Color] of the pixel at [code]point[/code] to [code]color[/code]. Example:
+ [codeblocks]
+ [gdscript]
+ var img_width = 10
+ var img_height = 5
var img = Image.new()
img.create(img_width, img_height, false, Image.FORMAT_RGBA8)
- img.set_pixelv(Vector2(x, y), color)
- [/codeblock]
+
+ img.set_pixelv(Vector2i(1, 2), Color.red) # Sets the color at (1, 2) to red.
+ [/gdscript]
+ [csharp]
+ int imgWidth = 10;
+ int imgHeight = 5;
+ var img = new Image();
+ img.Create(imgWidth, imgHeight, false, Image.Format.Rgba8);
+
+ img.SetPixelv(new Vector2i(1, 2), Colors.Red); // Sets the color at (1, 2) to red.
+ [/csharp]
+ [/codeblocks]
+ This is the same as [method set_pixel], but with a [Vector2i] argument instead of two integer arguments.
</description>
</method>
<method name="shrink_x2">
@@ -592,18 +638,19 @@
<constant name="FORMAT_BPTC_RGBFU" value="24" enum="Format">
Texture format that uses [url=https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression]BPTC[/url] compression with unsigned floating-point RGB components.
</constant>
- <constant name="FORMAT_PVRTC2" value="25" enum="Format">
+ <constant name="FORMAT_PVRTC1_2" value="25" enum="Format">
Texture format used on PowerVR-supported mobile platforms, uses 2-bit color depth with no alpha. More information can be found [url=https://en.wikipedia.org/wiki/PVRTC]here[/url].
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
- <constant name="FORMAT_PVRTC2A" value="26" enum="Format">
- Same as [url=https://en.wikipedia.org/wiki/PVRTC]PVRTC2[/url], but with an alpha component.
+ <constant name="FORMAT_PVRTC1_2A" value="26" enum="Format">
+ Same as [constant FORMAT_PVRTC1_2], but with an alpha component.
</constant>
- <constant name="FORMAT_PVRTC4" value="27" enum="Format">
- Similar to [url=https://en.wikipedia.org/wiki/PVRTC]PVRTC2[/url], but with 4-bit color depth and no alpha.
+ <constant name="FORMAT_PVRTC1_4" value="27" enum="Format">
+ Texture format used on PowerVR-supported mobile platforms, uses 4-bit color depth with no alpha. More information can be found [url=https://en.wikipedia.org/wiki/PVRTC]here[/url].
+ [b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
- <constant name="FORMAT_PVRTC4A" value="28" enum="Format">
- Same as [url=https://en.wikipedia.org/wiki/PVRTC]PVRTC4[/url], but with an alpha component.
+ <constant name="FORMAT_PVRTC1_4A" value="28" enum="Format">
+ Same as [constant FORMAT_PVRTC1_4], but with an alpha component.
</constant>
<constant name="FORMAT_ETC" value="29" enum="Format">
[url=https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC1]Ericsson Texture Compression format 1[/url], also referred to as "ETC1", and is part of the OpenGL ES graphics standard. This format cannot store an alpha channel.
@@ -670,18 +717,18 @@
<constant name="COMPRESS_S3TC" value="0" enum="CompressMode">
Use S3TC compression.
</constant>
- <constant name="COMPRESS_PVRTC2" value="1" enum="CompressMode">
- Use PVRTC2 compression.
+ <constant name="COMPRESS_PVRTC1_4" value="1" enum="CompressMode">
+ Use PVRTC1 4-bpp compression.
</constant>
- <constant name="COMPRESS_PVRTC4" value="2" enum="CompressMode">
- Use PVRTC4 compression.
- </constant>
- <constant name="COMPRESS_ETC" value="3" enum="CompressMode">
+ <constant name="COMPRESS_ETC" value="2" enum="CompressMode">
Use ETC compression.
</constant>
- <constant name="COMPRESS_ETC2" value="4" enum="CompressMode">
+ <constant name="COMPRESS_ETC2" value="3" enum="CompressMode">
Use ETC2 compression.
</constant>
+ <constant name="COMPRESS_BPTC" value="4" enum="CompressMode">
+ Use BPTC compression.
+ </constant>
<constant name="USED_CHANNELS_L" value="0" enum="UsedChannels">
</constant>
<constant name="USED_CHANNELS_LA" value="1" enum="UsedChannels">
diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml
index d122d74e85..2bea482bc1 100644
--- a/doc/classes/ImageTexture.xml
+++ b/doc/classes/ImageTexture.xml
@@ -4,10 +4,31 @@
A [Texture2D] based on an [Image].
</brief_description>
<description>
- A [Texture2D] based on an [Image]. Can be created from an [Image] with [method create_from_image].
- [b]Note:[/b] The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images will fail to import.
+ A [Texture2D] based on an [Image]. For an image to be displayed, an [ImageTexture] has to be created from it using the [method create_from_image] method:
+ [codeblock]
+ var texture = ImageTexture.new()
+ var image = Image.new()
+ image.load("res://icon.png")
+ texture.create_from_image(image)
+ $Sprite2D.texture = texture
+ [/codeblock]
+ This way, textures can be created at run-time by loading images both from within the editor and externally.
+ [b]Warning:[/b] Prefer to load imported textures with [method @GDScript.load] over loading them from within the filesystem dynamically with [method Image.load], as it may not work in exported projects:
+ [codeblock]
+ var texture = load("res://icon.png")
+ $Sprite2D.texture = texture
+ [/codeblock]
+ This is because images have to be imported as [StreamTexture2D] first to be loaded with [method @GDScript.load]. If you'd still like to load an image file just like any other [Resource], import it as an [Image] resource instead, and then load it normally using the [method @GDScript.load] method.
+ But do note that the image data can still be retrieved from an imported texture as well using the [method Texture2D.get_data] method, which returns a copy of the data:
+ [codeblock]
+ var texture = load("res://icon.png")
+ var image : Image = texture.get_data()
+ [/codeblock]
+ An [ImageTexture] is not meant to be operated from within the editor interface directly, and is mostly useful for rendering images on screen dynamically via code. If you need to generate images procedurally from within the editor, consider saving and importing images as custom texture resources implementing a new [EditorImportPlugin].
+ [b]Note:[/b] The maximum texture size is 16384×16384 pixels due to graphics hardware limitations.
</description>
<tutorials>
+ <link title="Importing images">https://docs.godotengine.org/en/latest/tutorials/assets_pipeline/importing_images.html</link>
</tutorials>
<methods>
<method name="create_from_image">
@@ -16,14 +37,14 @@
<argument index="0" name="image" type="Image">
</argument>
<description>
- Create a new [ImageTexture] from an [Image].
+ Initializes the texture by allocating and setting the data from an [Image].
</description>
</method>
<method name="get_format" qualifiers="const">
<return type="int" enum="Image.Format">
</return>
<description>
- Returns the format of the [ImageTexture], one of [enum Image.Format].
+ Returns the format of the texture, one of [enum Image.Format].
</description>
</method>
<method name="set_size_override">
@@ -32,7 +53,7 @@
<argument index="0" name="size" type="Vector2">
</argument>
<description>
- Resizes the [ImageTexture] to the specified dimensions.
+ Resizes the texture to the specified dimensions.
</description>
</method>
<method name="update">
@@ -43,7 +64,9 @@
<argument index="1" name="immediate" type="bool" default="false">
</argument>
<description>
- Replaces the texture's data with a new [code]image[/code]. If [code]immediate[/code] is [code]true[/code], it will take effect immediately after the call.
+ Replaces the texture's data with a new [Image]. If [code]immediate[/code] is [code]true[/code], it will take effect immediately after the call.
+ [b]Note:[/b] The texture has to be initialized first with the [method create_from_image] method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration, otherwise it has to be re-created with the [method create_from_image] method.
+ Use this method over [method create_from_image] if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time.
</description>
</method>
</methods>
diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml
index b05ab5b4d6..cfb3e8d981 100644
--- a/doc/classes/Input.xml
+++ b/doc/classes/Input.xml
@@ -8,6 +8,8 @@
</description>
<tutorials>
<link title="Inputs tutorial index">https://docs.godotengine.org/en/latest/tutorials/inputs/index.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="action_press">
@@ -47,11 +49,20 @@
<return type="Vector3">
</return>
<description>
- Returns the acceleration of the device's accelerometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
+ Returns the acceleration of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
Note this method returns an empty [Vector3] when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer.
[b]Note:[/b] This method only works on iOS, Android, and UWP. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
+ <method name="get_action_raw_strength" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="action" type="StringName">
+ </argument>
+ <description>
+ Returns a value between 0 and 1 representing the raw intensity of the given action, ignoring the action's deadzone. In most cases, you should use [method get_action_strength] instead.
+ </description>
+ </method>
<method name="get_action_strength" qualifiers="const">
<return type="float">
</return>
@@ -61,6 +72,18 @@
Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis as the keyboard, the value returned will be 0 or 1.
</description>
</method>
+ <method name="get_axis" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="negative_action" type="StringName">
+ </argument>
+ <argument index="1" name="positive_action" type="StringName">
+ </argument>
+ <description>
+ Get axis input by specifying two actions, one negative and one positive.
+ This is a horthand for writing [code]Input.get_action_strength("positive_action") - Input.get_action_strength("negative_action")[/code].
+ </description>
+ </method>
<method name="get_connected_joypads">
<return type="Array">
</return>
@@ -79,7 +102,7 @@
<return type="Vector3">
</return>
<description>
- Returns the gravity of the device's accelerometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
+ Returns the gravity of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
[b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
@@ -87,8 +110,8 @@
<return type="Vector3">
</return>
<description>
- Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
- [b]Note:[/b] This method only works on Android. On other platforms, it always returns [constant Vector3.ZERO].
+ Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
+ [b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_joy_axis" qualifiers="const">
@@ -102,42 +125,6 @@
Returns the current value of the joypad axis at given index (see [enum JoyAxisList]).
</description>
</method>
- <method name="get_joy_axis_index_from_string">
- <return type="int">
- </return>
- <argument index="0" name="axis" type="String">
- </argument>
- <description>
- Returns the index of the provided axis name.
- </description>
- </method>
- <method name="get_joy_axis_string">
- <return type="String">
- </return>
- <argument index="0" name="axis_index" type="int">
- </argument>
- <description>
- Receives a [enum JoyAxisList] axis and returns its equivalent name as a string.
- </description>
- </method>
- <method name="get_joy_button_index_from_string">
- <return type="int">
- </return>
- <argument index="0" name="button" type="String">
- </argument>
- <description>
- Returns the index of the provided button name.
- </description>
- </method>
- <method name="get_joy_button_string">
- <return type="String">
- </return>
- <argument index="0" name="button_index" type="int">
- </argument>
- <description>
- Receives a gamepad button from [enum JoyButtonList] and returns its equivalent name as a string.
- </description>
- </method>
<method name="get_joy_guid" qualifiers="const">
<return type="String">
</return>
@@ -185,8 +172,8 @@
<return type="Vector3">
</return>
<description>
- Returns the the magnetic field strength in micro-Tesla for all axes of the device's magnetometer, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
- [b]Note:[/b] This method only works on Android and UWP. On other platforms, it always returns [constant Vector3.ZERO].
+ Returns the the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
+ [b]Note:[/b] This method only works on Android, iOS and UWP. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_mouse_button_mask" qualifiers="const">
@@ -203,6 +190,25 @@
Returns the mouse mode. See the constants for more information.
</description>
</method>
+ <method name="get_vector" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="negative_x" type="StringName">
+ </argument>
+ <argument index="1" name="positive_x" type="StringName">
+ </argument>
+ <argument index="2" name="negative_y" type="StringName">
+ </argument>
+ <argument index="3" name="positive_y" type="StringName">
+ </argument>
+ <argument index="4" name="deadzone" type="float" default="-1.0">
+ </argument>
+ <description>
+ Get vector input by specifying four actions, two for the X axis and two for the Y axis, negative and positive.
+ This method is useful when getting vector input, such as from a joystick, directional pad, arrows, or WASD. The vector has its length limited to 1 and has a circular deadzone, which is useful for using vector input as movement.
+ By default, the deadzone is automatically calculated from the average of the action deadzones. However, you can override the deadzone to be whatever you want (on the range of 0 to 1).
+ </description>
+ </method>
<method name="is_action_just_pressed" qualifiers="const">
<return type="bool">
</return>
@@ -293,12 +299,20 @@
<description>
Feeds an [InputEvent] to the game. Can be used to artificially trigger input events from code. Also generates [method Node._input] calls.
Example:
- [codeblock]
- var a = InputEventAction.new()
- a.action = "ui_cancel"
- a.pressed = true
- Input.parse_input_event(a)
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ var cancel_event = InputEventAction.new()
+ cancel_event.action = "ui_cancel"
+ cancel_event.pressed = true
+ Input.parse_input_event(cancel_event)
+ [/gdscript]
+ [csharp]
+ var cancelEvent = new InputEventAction();
+ cancelEvent.Action = "ui_cancel";
+ cancelEvent.Pressed = true;
+ Input.ParseInputEvent(cancelEvent);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="remove_joy_mapping">
@@ -389,7 +403,7 @@
</argument>
<description>
Vibrate Android and iOS devices.
- [b]Note:[/b] It needs VIBRATE permission for Android at export settings. iOS does not support duration.
+ [b]Note:[/b] It needs [code]VIBRATE[/code] permission for Android at export settings. iOS does not support duration.
</description>
</method>
<method name="warp_mouse_position">
diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml
index 3663ee98cc..8c6063bd67 100644
--- a/doc/classes/InputEvent.xml
+++ b/doc/classes/InputEvent.xml
@@ -9,6 +9,8 @@
<tutorials>
<link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
<link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="accumulate">
diff --git a/doc/classes/InputEventAction.xml b/doc/classes/InputEventAction.xml
index e0d3e47219..1fe85a5ae8 100644
--- a/doc/classes/InputEventAction.xml
+++ b/doc/classes/InputEventAction.xml
@@ -8,6 +8,8 @@
</description>
<tutorials>
<link title="InputEvent: Actions">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#actions</link>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml
index 3e64fd63ab..0f9e71adb4 100644
--- a/doc/classes/InputEventMouseMotion.xml
+++ b/doc/classes/InputEventMouseMotion.xml
@@ -9,6 +9,7 @@
</description>
<tutorials>
<link title="Mouse and input coordinates">https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/InputEventWithModifiers.xml b/doc/classes/InputEventWithModifiers.xml
index 667879a922..dd782209e5 100644
--- a/doc/classes/InputEventWithModifiers.xml
+++ b/doc/classes/InputEventWithModifiers.xml
@@ -27,6 +27,10 @@
<member name="shift" type="bool" setter="set_shift" getter="get_shift" default="false">
State of the [kbd]Shift[/kbd] modifier.
</member>
+ <member name="store_command" type="bool" setter="set_store_command" getter="is_storing_command" default="true">
+ If [code]true[/code], pressing [kbd]Cmd[/kbd] on macOS or [kbd]Ctrl[/kbd] on all other platforms will both be serialized as [member command]. If [code]false[/code], those same keys will be serialized as [member meta] on macOS and [member control] on all other platforms.
+ This aids with cross-platform compatibility when developing e.g. on Windows for macOS, or vice-versa.
+ </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml
index 062ac3869d..49d29b3a53 100644
--- a/doc/classes/InputMap.xml
+++ b/doc/classes/InputMap.xml
@@ -120,7 +120,7 @@
Returns [code]true[/code] if the [InputMap] has a registered action with the given name.
</description>
</method>
- <method name="load_from_globals">
+ <method name="load_from_project_settings">
<return type="void">
</return>
<description>
diff --git a/doc/classes/InstancePlaceholder.xml b/doc/classes/InstancePlaceholder.xml
index 39827f6604..defd23afb1 100644
--- a/doc/classes/InstancePlaceholder.xml
+++ b/doc/classes/InstancePlaceholder.xml
@@ -18,13 +18,14 @@
<argument index="1" name="custom_scene" type="PackedScene" default="null">
</argument>
<description>
+ Not thread-safe. Use [method Object.call_deferred] if calling from a thread.
</description>
</method>
<method name="get_instance_path" qualifiers="const">
<return type="String">
</return>
<description>
- Gets the path to the [PackedScene] resource file that is loaded by default when calling [method create_instance].
+ Gets the path to the [PackedScene] resource file that is loaded by default when calling [method create_instance]. Not thread-safe. Use [method Object.call_deferred] if calling from a thread.
</description>
</method>
<method name="get_stored_values">
diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml
index 25420bd77b..0fd0fe7b3d 100644
--- a/doc/classes/ItemList.xml
+++ b/doc/classes/ItemList.xml
@@ -43,6 +43,15 @@
Removes all items from the list.
</description>
</method>
+ <method name="clear_item_opentype_features">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Removes all OpenType features from the item's text.
+ </description>
+ </method>
<method name="ensure_current_is_visible">
<return type="void">
</return>
@@ -114,6 +123,15 @@
Returns the region of item's icon used. The whole icon will be used if the region has no area.
</description>
</method>
+ <method name="get_item_language" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Returns item's text language code.
+ </description>
+ </method>
<method name="get_item_metadata" qualifiers="const">
<return type="Variant">
</return>
@@ -123,6 +141,17 @@
Returns the metadata value of the specified index.
</description>
</method>
+ <method name="get_item_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code] of the item's text.
+ </description>
+ </method>
<method name="get_item_text" qualifiers="const">
<return type="String">
</return>
@@ -132,6 +161,15 @@
Returns the text associated with the specified index.
</description>
</method>
+ <method name="get_item_text_direction" qualifiers="const">
+ <return type="int" enum="Control.TextDirection">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Returns item's text base writing direction.
+ </description>
+ </method>
<method name="get_item_tooltip" qualifiers="const">
<return type="String">
</return>
@@ -247,11 +285,16 @@
<argument index="1" name="custom_bg_color" type="Color">
</argument>
<description>
- Sets the background color of the item specified by [code]idx[/code] index to the specified [Color].
- [codeblock]
- var some_string = "Some text"
- some_string.set_item_custom_bg_color(0,Color(1, 0, 0, 1) # This will set the background color of the first item of the control to red.
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ var itemList = ItemList.new()
+ some_string.set_item_custom_bg_color(0, Color.red) # This will set the background color of the first item of the control to red.
+ [/gdscript]
+ [csharp]
+ var itemList = new ItemList();
+ itemList.SetItemCustomBgColor(0, Colors.Red); // This will set the background color of the first item of the control to red.
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_item_custom_fg_color">
@@ -263,10 +306,16 @@
</argument>
<description>
Sets the foreground color of the item specified by [code]idx[/code] index to the specified [Color].
- [codeblock]
- var some_string = "Some text"
- some_string.set_item_custom_fg_color(0,Color(1, 0, 0, 1) # This will set the foreground color of the first item of the control to red.
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ var item_list = ItemList.new()
+ item_list.set_item_custom_fg_color(0, Color.red) # This will set the foreground color of the first item of the control to red.
+ [/gdscript]
+ [csharp]
+ var itemList = new ItemList();
+ itemList.SetItemCustomFgColor(0, Colors.Red); // This will set the foreground color of the first item of the control to red.
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_item_disabled">
@@ -325,6 +374,17 @@
Sets whether the item icon will be drawn transposed.
</description>
</method>
+ <method name="set_item_language">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="language" type="String">
+ </argument>
+ <description>
+ Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+ </description>
+ </method>
<method name="set_item_metadata">
<return type="void">
</return>
@@ -336,6 +396,19 @@
Sets a value (of any type) to be stored with the item associated with the specified index.
</description>
</method>
+ <method name="set_item_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <argument index="2" name="value" type="int">
+ </argument>
+ <description>
+ Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+ </description>
+ </method>
<method name="set_item_selectable">
<return type="void">
</return>
@@ -358,6 +431,17 @@
Sets text of the item associated with the specified index.
</description>
</method>
+ <method name="set_item_text_direction">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="direction" type="int" enum="Control.TextDirection">
+ </argument>
+ <description>
+ Sets item's text base writing direction.
+ </description>
+ </method>
<method name="set_item_tooltip">
<return type="void">
</return>
@@ -533,6 +617,9 @@
<theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )">
Text [Color] used when the item is selected.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the item's text.
+ </theme_item>
<theme_item name="guide_color" type="Color" default="Color( 0, 0, 0, 0.1 )">
[Color] of the guideline. The guideline is a line drawn between each row of items.
</theme_item>
diff --git a/doc/classes/JSONParseResult.xml b/doc/classes/JSONParseResult.xml
index 4dbceb35e9..991ebcd7a0 100644
--- a/doc/classes/JSONParseResult.xml
+++ b/doc/classes/JSONParseResult.xml
@@ -24,13 +24,26 @@
A [Variant] containing the parsed JSON. Use [method @GDScript.typeof] or the [code]is[/code] keyword to check if it is what you expect. For example, if the JSON source starts with curly braces ([code]{}[/code]), a [Dictionary] will be returned. If the JSON source starts with brackets ([code][][/code]), an [Array] will be returned.
[b]Note:[/b] The JSON specification does not define integer or float types, but only a [i]number[/i] type. Therefore, parsing a JSON text will convert all numerical values to [float] types.
[b]Note:[/b] JSON objects do not preserve key order like Godot dictionaries, thus, you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var p = JSON.parse('["hello", "world", "!"]')
if typeof(p.result) == TYPE_ARRAY:
print(p.result[0]) # Prints "hello"
else:
push_error("Unexpected results.")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ JSONParseResult p = JSON.Parse("[\"hello\"], \"world\", \"!\"]");
+ if (p.Result is Godot.Collections.Array)
+ {
+ GD.Print((p.Result as Godot.Collections.Array)[0]); // Prints "hello"
+ }
+ else
+ {
+ GD.PushError("Unexpected results.");
+ }
+ [/csharp]
+ [/codeblocks]
</member>
</members>
<constants>
diff --git a/doc/classes/JSONParser.xml b/doc/classes/JSONParser.xml
new file mode 100644
index 0000000000..31ba295418
--- /dev/null
+++ b/doc/classes/JSONParser.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="JSONParser" inherits="Reference" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="decode_data">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="data" type="Variant">
+ </argument>
+ <argument index="1" name="indent" type="String" default="&quot;&quot;">
+ </argument>
+ <argument index="2" name="sort_keys" type="bool" default="true">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_data" qualifiers="const">
+ <return type="Variant">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_error_line" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_error_text" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_string" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="parse_string">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="json_string" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/JavaScript.xml b/doc/classes/JavaScript.xml
index d2cb558385..c707a72ee8 100644
--- a/doc/classes/JavaScript.xml
+++ b/doc/classes/JavaScript.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
The JavaScript singleton is implemented only in the HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs.
+ [b]Note:[/b] This singleton can be disabled at build-time to improve security. By default, the JavaScript singleton is enabled. Official export templates also have the JavaScript singleton enabled. See [url=https://docs.godotengine.org/en/latest/development/compiling/compiling_for_web.html]Compiling for the Web[/url] in the documentation for more information.
</description>
<tutorials>
<link title="Exporting for the Web: Calling JavaScript from script">https://docs.godotengine.org/en/latest/getting_started/workflow/export/exporting_for_web.html#calling-javascript-from-script</link>
diff --git a/doc/classes/Joint3D.xml b/doc/classes/Joint3D.xml
index 15bef960f6..107c638b9e 100644
--- a/doc/classes/Joint3D.xml
+++ b/doc/classes/Joint3D.xml
@@ -7,6 +7,7 @@
Joints are used to bind together two physics bodies. They have a solver priority and can define if the bodies of the two attached nodes should be able to collide with each other.
</description>
<tutorials>
+ <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml
index 5a1b4630d0..476b64a336 100644
--- a/doc/classes/KinematicBody2D.xml
+++ b/doc/classes/KinematicBody2D.xml
@@ -6,11 +6,13 @@
<description>
Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses:
[b]Simulated motion:[/b] When these bodies are moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
- [b]Kinematic characters:[/b] KinematicBody2D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics.
+ [b]Kinematic characters:[/b] KinematicBody2D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics.
</description>
<tutorials>
<link title="Kinematic character (2D)">https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link>
<link title="Using KinematicBody2D">https://docs.godotengine.org/en/latest/tutorials/physics/using_kinematic_body_2d.html</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
</tutorials>
<methods>
<method name="get_floor_normal" qualifiers="const">
@@ -33,41 +35,50 @@
<argument index="0" name="slide_idx" type="int">
</argument>
<description>
- Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last [method move_and_slide] call. 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_count] - 1).
+ Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide] or [method move_and_slide_with_snap]. 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_count] - 1).
[b]Example usage:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
for i in get_slide_count():
var collision = get_slide_collision(i)
print("Collided with: ", collision.collider.name)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ for (int i = 0; i &lt; GetSlideCount(); i++)
+ {
+ KinematicCollision2D collision = GetSlideCollision(i);
+ GD.Print("Collided with: ", (collision.Collider as Node).Name);
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_slide_count" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the number of times the body collided and changed direction during the last call to [method move_and_slide].
+ Returns the number of times the body collided and changed direction during the last call to [method move_and_slide] or [method move_and_slide_with_snap].
</description>
</method>
<method name="is_on_ceiling" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on the ceiling. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with the ceiling on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="is_on_floor" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on the floor. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with the floor on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="is_on_wall" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on a wall. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with a wall on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="move_and_collide">
@@ -102,7 +113,7 @@
<argument index="5" name="infinite_inertia" type="bool" default="true">
</argument>
<description>
- Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes.
+ Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
[code]linear_velocity[/code] is the velocity vector in pixels per second. Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
[code]up_direction[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games.
diff --git a/doc/classes/KinematicBody3D.xml b/doc/classes/KinematicBody3D.xml
index 5d9c7fd896..a21496de54 100644
--- a/doc/classes/KinematicBody3D.xml
+++ b/doc/classes/KinematicBody3D.xml
@@ -6,10 +6,14 @@
<description>
Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses:
[b]Simulated motion:[/b] When these bodies are moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
- [b]Kinematic characters:[/b] KinematicBody3D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics.
+ [b]Kinematic characters:[/b] KinematicBody3D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics.
</description>
<tutorials>
<link title="Kinematic character (2D)">https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="get_axis_lock" qualifiers="const">
@@ -41,35 +45,35 @@
<argument index="0" name="slide_idx" type="int">
</argument>
<description>
- Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last [method move_and_slide] call. 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_count] - 1).
+ Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide] or [method move_and_slide_with_snap]. 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_count] - 1).
</description>
</method>
<method name="get_slide_count" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the number of times the body collided and changed direction during the last call to [method move_and_slide].
+ Returns the number of times the body collided and changed direction during the last call to [method move_and_slide] or [method move_and_slide_with_snap].
</description>
</method>
<method name="is_on_ceiling" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on the ceiling. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with the ceiling on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="is_on_floor" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on the floor. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with the floor on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="is_on_wall" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the body is on a wall. Only updates when calling [method move_and_slide].
+ Returns [code]true[/code] if the body collided with a wall on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code].
</description>
</method>
<method name="move_and_collide">
@@ -104,7 +108,7 @@
<argument index="5" name="infinite_inertia" type="bool" default="true">
</argument>
<description>
- Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes.
+ Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
[code]linear_velocity[/code] is the velocity vector (typically meters per second). Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
[code]up_direction[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector3(0, 0, 0)[/code], everything is considered a wall.
diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml
index 3318f2757d..1edf31de4a 100644
--- a/doc/classes/Label.xml
+++ b/doc/classes/Label.xml
@@ -8,8 +8,16 @@
[b]Note:[/b] Contrarily to most other [Control]s, Label's [member Control.mouse_filter] defaults to [constant Control.MOUSE_FILTER_IGNORE] (i.e. it doesn't react to mouse input events). This implies that a label won't display any configured [member Control.hint_tooltip], unless you change its mouse filter.
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
+ <method name="clear_opentype_features">
+ <return type="void">
+ </return>
+ <description>
+ Removes all OpenType features.
+ </description>
+ </method>
<method name="get_line_count" qualifiers="const">
<return type="int">
</return>
@@ -20,8 +28,21 @@
<method name="get_line_height" qualifiers="const">
<return type="int">
</return>
+ <argument index="0" name="line" type="int" default="-1">
+ </argument>
+ <description>
+ Returns the height of the line [code]line[/code].
+ If [code]line[/code] is set to [code]-1[/code], returns biggest line height.
+ If there're no lines returns font size in pixels.
+ </description>
+ </method>
+ <method name="get_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
<description>
- Returns the font size in pixels.
+ Returns OpenType feature [code]tag[/code].
</description>
</method>
<method name="get_total_character_count" qualifiers="const">
@@ -38,6 +59,17 @@
Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines.
</description>
</method>
+ <method name="set_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <argument index="1" name="value" type="int">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+ </description>
+ </method>
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="Label.Align" default="0">
@@ -49,6 +81,9 @@
<member name="clip_text" type="bool" setter="set_clip_text" getter="is_clipping_text" default="false">
If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle. It also lets you scale the node down freely.
</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="lines_skipped" type="int" setter="set_lines_skipped" getter="get_lines_skipped" default="0">
The node ignores the first [code]lines_skipped[/code] lines before it starts to display text.
</member>
@@ -60,9 +95,18 @@
Limits the amount of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" override="true" default="4" />
+ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
+ Set BiDi algorithm override for the structured text.
+ </member>
+ <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]">
+ Set additional options for BiDi override.
+ </member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
The text to display on screen.
</member>
+ <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="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase" default="false">
If [code]true[/code], all the text displays as UPPERCASE.
</member>
@@ -84,7 +128,7 @@
Align rows to the right.
</constant>
<constant name="ALIGN_FILL" value="3" enum="Align">
- Expand row whitespaces to fit the width.
+ Expand row to fit the width.
</constant>
<constant name="VALIGN_TOP" value="0" enum="VAlign">
Align the whole text to the top.
@@ -110,7 +154,10 @@
[Color] of the text's shadow effect.
</theme_item>
<theme_item name="font_outline_modulate" type="Color" default="Color( 1, 1, 1, 1 )">
- The tint of [Font]'s outline. See [member DynamicFont.outline_color].
+ The tint of [Font]'s outline.
+ </theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [Label]'s text.
</theme_item>
<theme_item name="line_spacing" type="int" default="3">
Vertical space between lines in multiline [Label].
@@ -118,8 +165,8 @@
<theme_item name="normal" type="StyleBox">
Background [StyleBox] for the [Label].
</theme_item>
- <theme_item name="shadow_as_outline" type="int" default="0">
- Boolean value. If set to 1 ([code]true[/code]), the shadow will be displayed around the whole text as an outline.
+ <theme_item name="outline_size" type="int" default="0">
+ Text outline size.
</theme_item>
<theme_item name="shadow_offset_x" type="int" default="1">
The horizontal offset of the text's shadow.
@@ -127,5 +174,8 @@
<theme_item name="shadow_offset_y" type="int" default="1">
The vertical offset of the text's shadow.
</theme_item>
+ <theme_item name="shadow_outline_size" type="int" default="1">
+ Shadow outline size. If set to 1 or greater, the shadow will be displayed around the whole text as an outline.
+ </theme_item>
</theme_items>
</class>
diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml
index c5f0c2df8c..f6698352ab 100644
--- a/doc/classes/Light2D.xml
+++ b/doc/classes/Light2D.xml
@@ -11,8 +11,25 @@
<link title="2D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link>
</tutorials>
<methods>
+ <method name="get_height" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_height">
+ <return type="void">
+ </return>
+ <argument index="0" name="height" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
+ <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="Light2D.BlendMode" default="0">
+ The Light2D's blend mode. See [enum BlendMode] constants for values.
+ </member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
The Light2D's [Color].
</member>
@@ -25,15 +42,6 @@
<member name="energy" type="float" setter="set_energy" getter="get_energy" default="1.0">
The Light2D's energy value. The larger the value, the stronger the light.
</member>
- <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Light2D.Mode" default="0">
- The Light2D's mode. See [enum Mode] constants for values.
- </member>
- <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )">
- The offset of the Light2D's [code]texture[/code].
- </member>
- <member name="range_height" type="float" setter="set_height" getter="get_height" default="0.0">
- The height of the Light2D. Used with 2D normal mapping.
- </member>
<member name="range_item_cull_mask" type="int" setter="set_item_cull_mask" getter="get_item_cull_mask" default="1">
The layer mask. Only objects with a matching mask will be affected by the Light2D.
</member>
@@ -49,9 +57,6 @@
<member name="range_z_min" type="int" setter="set_z_range_min" getter="get_z_range_min" default="-1024">
Minimum [code]z[/code] value of objects that are affected by the Light2D.
</member>
- <member name="shadow_buffer_size" type="int" setter="set_shadow_buffer_size" getter="get_shadow_buffer_size" default="2048">
- Shadow buffer size.
- </member>
<member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 0 )">
[Color] of shadows cast by the Light2D.
</member>
@@ -67,26 +72,8 @@
<member name="shadow_item_cull_mask" type="int" setter="set_item_shadow_cull_mask" getter="get_item_shadow_cull_mask" default="1">
The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching light mask will cast shadows.
</member>
- <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
- [Texture2D] used for the Light2D's appearance.
- </member>
- <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale" default="1.0">
- The [code]texture[/code]'s scale factor.
- </member>
</members>
<constants>
- <constant name="MODE_ADD" value="0" enum="Mode">
- Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light.
- </constant>
- <constant name="MODE_SUB" value="1" enum="Mode">
- Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect.
- </constant>
- <constant name="MODE_MIX" value="2" enum="Mode">
- Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation.
- </constant>
- <constant name="MODE_MASK" value="3" enum="Mode">
- The light texture of the Light2D is used as a mask, hiding or revealing parts of the screen underneath depending on the value of each pixel of the light (mask) texture.
- </constant>
<constant name="SHADOW_FILTER_NONE" value="0" enum="ShadowFilter">
No filter applies to the shadow map. See [member shadow_filter].
</constant>
@@ -96,5 +83,14 @@
<constant name="SHADOW_FILTER_PCF13" value="2" enum="ShadowFilter">
Percentage closer filtering (13 samples) applies to the shadow map. See [member shadow_filter].
</constant>
+ <constant name="BLEND_MODE_ADD" value="0" enum="BlendMode">
+ Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light.
+ </constant>
+ <constant name="BLEND_MODE_SUB" value="1" enum="BlendMode">
+ Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect.
+ </constant>
+ <constant name="BLEND_MODE_MIX" value="2" enum="BlendMode">
+ Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml
index c022e56a39..6c008e4f7e 100644
--- a/doc/classes/Light3D.xml
+++ b/doc/classes/Light3D.xml
@@ -8,6 +8,7 @@
</description>
<tutorials>
<link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="get_param" qualifiers="const">
diff --git a/doc/classes/LightOccluder2D.xml b/doc/classes/LightOccluder2D.xml
index 9f128e5942..550daf9225 100644
--- a/doc/classes/LightOccluder2D.xml
+++ b/doc/classes/LightOccluder2D.xml
@@ -12,12 +12,14 @@
<methods>
</methods>
<members>
- <member name="light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" default="1">
- The LightOccluder2D's light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s).
- </member>
<member name="occluder" type="OccluderPolygon2D" setter="set_occluder_polygon" getter="get_occluder_polygon">
The [OccluderPolygon2D] used to compute the shadow.
</member>
+ <member name="occluder_light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" default="1">
+ The LightOccluder2D's occluder light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s).
+ </member>
+ <member name="sdf_collision" type="bool" setter="set_as_sdf_collision" getter="is_set_as_sdf_collision" default="true">
+ </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml
index 22fe4f6194..dec5d60cbb 100644
--- a/doc/classes/Line2D.xml
+++ b/doc/classes/Line2D.xml
@@ -7,6 +7,8 @@
A line through several points in 2D space.
</description>
<tutorials>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link>
</tutorials>
<methods>
<method name="add_point">
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index f08a15d873..f05121d48c 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -10,6 +10,7 @@
- [kbd]Ctrl + X[/kbd]: Cut
- [kbd]Ctrl + V[/kbd] or [kbd]Ctrl + Y[/kbd]: Paste/"yank"
- [kbd]Ctrl + Z[/kbd]: Undo
+ - [kbd]Ctrl + ~[/kbd]: Swap input direction.
- [kbd]Ctrl + Shift + Z[/kbd]: Redo
- [kbd]Ctrl + U[/kbd]: Delete text from the cursor position to the beginning of the line
- [kbd]Ctrl + K[/kbd]: Delete text from the cursor position to the end of the line
@@ -46,6 +47,13 @@
Erases the [LineEdit]'s [member text].
</description>
</method>
+ <method name="clear_opentype_features">
+ <return type="void">
+ </return>
+ <description>
+ Removes all OpenType features.
+ </description>
+ </method>
<method name="delete_char_at_cursor">
<return type="void">
</return>
@@ -78,6 +86,22 @@
Returns the [PopupMenu] of this [LineEdit]. By default, this menu is displayed when right-clicking on the [LineEdit].
</description>
</method>
+ <method name="get_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code].
+ </description>
+ </method>
+ <method name="get_scroll_offset" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the scroll offset due to [member caret_position], as a number of characters.
+ </description>
+ </method>
<method name="menu_option">
<return type="void">
</return>
@@ -96,12 +120,20 @@
</argument>
<description>
Selects characters inside [LineEdit] between [code]from[/code] and [code]to[/code]. By default, [code]from[/code] is at the beginning and [code]to[/code] at the end.
- [codeblock]
+ [codeblocks]
+ [gdscript]
text = "Welcome"
select() # Will select "Welcome".
select(4) # Will select "ome".
select(2, 5) # Will select "lco".
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ Text = "Welcome";
+ Select(); // Will select "Welcome".
+ Select(4); // Will select "ome".
+ Select(2, 5); // Will select "lco".
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="select_all">
@@ -111,6 +143,17 @@
Selects the whole [String].
</description>
</method>
+ <method name="set_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <argument index="1" name="value" type="int">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+ </description>
+ </method>
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align" default="0">
@@ -124,6 +167,10 @@
</member>
<member name="caret_force_displayed" type="bool" setter="cursor_set_force_displayed" getter="cursor_get_force_displayed" default="false">
</member>
+ <member name="caret_mid_grapheme" type="bool" setter="set_mid_grapheme_caret_enabled" getter="get_mid_grapheme_caret_enabled" default="false">
+ Allow moving caret, selecting and removing the individual composite character components.
+ Note: [kbd]Backspace[/kbd] is always removing individual composite character components.
+ </member>
<member name="caret_position" type="int" setter="set_cursor_position" getter="get_cursor_position" default="0">
The cursor's position inside the [LineEdit]. When set, the text may scroll to accommodate it.
</member>
@@ -133,6 +180,9 @@
<member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true">
If [code]true[/code], the context menu will appear when right-clicked.
</member>
+ <member name="draw_control_chars" type="bool" setter="set_draw_control_chars" getter="get_draw_control_chars" default="false">
+ If [code]true[/code], control characters are displayed.
+ </member>
<member name="editable" type="bool" setter="set_editable" getter="is_editable" default="true">
If [code]false[/code], existing text cannot be modified and new text cannot be added.
</member>
@@ -140,6 +190,9 @@
If [code]true[/code], the [LineEdit] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened.
</member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" />
+ <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="max_length" type="int" setter="set_max_length" getter="get_max_length" default="0">
Maximum amount of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit.
</member>
@@ -165,10 +218,19 @@
<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.
</member>
+ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
+ Set BiDi algorithm override for the structured text.
+ </member>
+ <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]">
+ Set additional options for BiDi override.
+ </member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
String value of the [LineEdit].
[b]Note:[/b] Changing text using this property won't emit the [signal text_changed] signal.
</member>
+ <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="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>
@@ -205,7 +267,7 @@
Aligns the text on the right-hand side of the [LineEdit].
</constant>
<constant name="ALIGN_FILL" value="3" enum="Align">
- Stretches whitespaces to fit the [LineEdit]'s width.
+ Expand row to fit the [LineEdit]'s width.
</constant>
<constant name="MENU_CUT" value="0" enum="MenuItems">
Cuts (copies and clears) the selected text.
@@ -229,7 +291,70 @@
<constant name="MENU_REDO" value="6" enum="MenuItems">
Reverse the last undo action.
</constant>
- <constant name="MENU_MAX" value="7" enum="MenuItems">
+ <constant name="MENU_DIR_INHERITED" value="7" enum="MenuItems">
+ Sets text direction to inherited.
+ </constant>
+ <constant name="MENU_DIR_AUTO" value="8" enum="MenuItems">
+ Sets text direction to automatic.
+ </constant>
+ <constant name="MENU_DIR_LTR" value="9" enum="MenuItems">
+ Sets text direction to left-to-right.
+ </constant>
+ <constant name="MENU_DIR_RTL" value="10" enum="MenuItems">
+ Sets text direction to right-to-left.
+ </constant>
+ <constant name="MENU_DISPLAY_UCC" value="11" enum="MenuItems">
+ Toggles control character display.
+ </constant>
+ <constant name="MENU_INSERT_LRM" value="12" enum="MenuItems">
+ Inserts left-to-right mark (LRM) character.
+ </constant>
+ <constant name="MENU_INSERT_RLM" value="13" enum="MenuItems">
+ Inserts right-to-left mark (RLM) character.
+ </constant>
+ <constant name="MENU_INSERT_LRE" value="14" enum="MenuItems">
+ Inserts start of left-to-right embedding (LRE) character.
+ </constant>
+ <constant name="MENU_INSERT_RLE" value="15" enum="MenuItems">
+ Inserts start of right-to-left embedding (RLE) character.
+ </constant>
+ <constant name="MENU_INSERT_LRO" value="16" enum="MenuItems">
+ Inserts start of left-to-right override (LRO) character.
+ </constant>
+ <constant name="MENU_INSERT_RLO" value="17" enum="MenuItems">
+ Inserts start of right-to-left override (RLO) character.
+ </constant>
+ <constant name="MENU_INSERT_PDF" value="18" enum="MenuItems">
+ Inserts pop direction formatting (PDF) character.
+ </constant>
+ <constant name="MENU_INSERT_ALM" value="19" enum="MenuItems">
+ Inserts Arabic letter mark (ALM) character.
+ </constant>
+ <constant name="MENU_INSERT_LRI" value="20" enum="MenuItems">
+ Inserts left-to-right isolate (LRI) character.
+ </constant>
+ <constant name="MENU_INSERT_RLI" value="21" enum="MenuItems">
+ Inserts right-to-left isolate (RLI) character.
+ </constant>
+ <constant name="MENU_INSERT_FSI" value="22" enum="MenuItems">
+ Inserts first strong isolate (FSI) character.
+ </constant>
+ <constant name="MENU_INSERT_PDI" value="23" enum="MenuItems">
+ Inserts pop direction isolate (PDI) character.
+ </constant>
+ <constant name="MENU_INSERT_ZWJ" value="24" enum="MenuItems">
+ Inserts zero width joiner (ZWJ) character.
+ </constant>
+ <constant name="MENU_INSERT_ZWNJ" value="25" enum="MenuItems">
+ Inserts zero width non-joiner (ZWNJ) character.
+ </constant>
+ <constant name="MENU_INSERT_WJ" value="26" enum="MenuItems">
+ Inserts word joiner (WJ) character.
+ </constant>
+ <constant name="MENU_INSERT_SHY" value="27" enum="MenuItems">
+ Inserts soft hyphen (SHY) character.
+ </constant>
+ <constant name="MENU_MAX" value="28" enum="MenuItems">
Represents the size of the [enum MenuItems] enum.
</constant>
</constants>
@@ -261,6 +386,9 @@
<theme_item name="font_color_uneditable" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )">
Font color when editing is disabled.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [LineEdit]'s text.
+ </theme_item>
<theme_item name="minimum_spaces" type="int" default="12">
Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of space characters (i.e. this amount of space characters can be displayed without scrolling).
</theme_item>
diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml
index 13d3355da5..93384843de 100644
--- a/doc/classes/LinkButton.xml
+++ b/doc/classes/LinkButton.xml
@@ -5,18 +5,57 @@
</brief_description>
<description>
This kind of button is primarily used when the interaction with the button causes a context change (like linking to a web page).
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
<methods>
+ <method name="clear_opentype_features">
+ <return type="void">
+ </return>
+ <description>
+ Removes all OpenType features.
+ </description>
+ </method>
+ <method name="get_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code].
+ </description>
+ </method>
+ <method name="set_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <argument index="1" name="value" type="int">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+ </description>
+ </method>
</methods>
<members>
- <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" override="true" enum="Control.FocusMode" default="0" />
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" />
+ <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="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" override="true" enum="Control.CursorShape" default="2" />
+ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
+ Set BiDi algorithm override for the structured text.
+ </member>
+ <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]">
+ Set additional options for BiDi override.
+ </member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
The button's text that will be displayed inside the button's area.
</member>
+ <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="underline" type="int" setter="set_underline_mode" getter="get_underline_mode" enum="LinkButton.UnderlineMode" default="0">
Determines when to show the underline. See [enum UnderlineMode] for options.
</member>
@@ -48,6 +87,9 @@
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
Text [Color] used when the [LinkButton] is being pressed.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [LinkButton]'s text.
+ </theme_item>
<theme_item name="underline_spacing" type="int" default="2">
The vertical space between the baseline of text and the underline.
</theme_item>
diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml
index 55ae54d12b..7682379b64 100644
--- a/doc/classes/MainLoop.xml
+++ b/doc/classes/MainLoop.xml
@@ -78,38 +78,6 @@
If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame.
</description>
</method>
- <method name="finish">
- <return type="void">
- </return>
- <description>
- Should not be called manually, override [method _finalize] instead. Will be removed in Godot 4.0.
- </description>
- </method>
- <method name="idle">
- <return type="bool">
- </return>
- <argument index="0" name="delta" type="float">
- </argument>
- <description>
- Should not be called manually, override [method _idle] instead. Will be removed in Godot 4.0.
- </description>
- </method>
- <method name="init">
- <return type="void">
- </return>
- <description>
- Should not be called manually, override [method _initialize] instead. Will be removed in Godot 4.0.
- </description>
- </method>
- <method name="iteration">
- <return type="bool">
- </return>
- <argument index="0" name="delta" type="float">
- </argument>
- <description>
- Should not be called manually, override [method _iteration] instead. Will be removed in Godot 4.0.
- </description>
- </method>
</methods>
<signals>
<signal name="on_request_permissions_result">
@@ -158,5 +126,8 @@
Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
Implemented on desktop platforms.
</constant>
+ <constant name="NOTIFICATION_TEXT_SERVER_CHANGED" value="2018">
+ Notification received when text server is changed.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/MarginContainer.xml b/doc/classes/MarginContainer.xml
index fb5f437239..c8eebd4677 100644
--- a/doc/classes/MarginContainer.xml
+++ b/doc/classes/MarginContainer.xml
@@ -6,13 +6,22 @@
<description>
Adds a top, left, bottom, and right margin to all [Control] nodes that are direct children of the container. To control the [MarginContainer]'s margin, use the [code]margin_*[/code] theme properties listed below.
[b]Note:[/b] Be careful, [Control] margin values are different than the constant margin values. If you want to change the custom margin values of the [MarginContainer] by code, you should use the following examples:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var margin_value = 100
set("custom_constants/margin_top", margin_value)
set("custom_constants/margin_left", margin_value)
set("custom_constants/margin_bottom", margin_value)
set("custom_constants/margin_right", margin_value)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ int marginValue = 100;
+ Set("custom_constants/margin_top", marginValue);
+ Set("custom_constants/margin_left", marginValue);
+ Set("custom_constants/margin_bottom", marginValue);
+ Set("custom_constants/margin_right", marginValue);
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml
index f3686876ca..10a7061bef 100644
--- a/doc/classes/Material.xml
+++ b/doc/classes/Material.xml
@@ -7,6 +7,8 @@
Material is a base [Resource] used for coloring and shading geometry. All materials inherit from it and almost all [VisualInstance3D] derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here.
</description>
<tutorials>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml
index 316315f777..a002ce636b 100644
--- a/doc/classes/MenuButton.xml
+++ b/doc/classes/MenuButton.xml
@@ -6,6 +6,7 @@
<description>
Special button that brings up a [PopupMenu] when clicked.
New items can be created inside this [PopupMenu] using [code]get_popup().add_item("My Item Name")[/code]. You can also create them directly from the editor. To do so, select the [MenuButton] node, then in the toolbar at the top of the 2D editor, click [b]Items[/b] then click [b]Add[/b] in the popup. You will be able to give each items new properties.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
@@ -29,7 +30,6 @@
</methods>
<members>
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" override="true" enum="BaseButton.ActionMode" default="0" />
- <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" override="true" enum="Control.FocusMode" default="0" />
<member name="flat" type="bool" setter="set_flat" getter="is_flat" override="true" default="true" />
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" />
<member name="switch_on_hover" type="bool" setter="set_switch_on_hover" getter="is_switch_on_hover" default="false">
@@ -68,6 +68,9 @@
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
Text [Color] used when the [MenuButton] is being pressed.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [MenuButton]'s text.
+ </theme_item>
<theme_item name="hover" type="StyleBox">
[StyleBox] used when the [MenuButton] is being hovered.
</theme_item>
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index 1efa72a2b2..dff4b4f7ab 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -7,6 +7,10 @@
Mesh is a type of [Resource] that contains vertex array-based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.
</description>
<tutorials>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="create_convex_shape" qualifiers="const">
@@ -122,11 +126,63 @@
<constant name="PRIMITIVE_TRIANGLE_STRIP" value="4" enum="PrimitiveType">
Render array as triangle strips.
</constant>
- <constant name="BLEND_SHAPE_MODE_NORMALIZED" value="0" enum="BlendShapeMode">
- Blend shapes are normalized.
+ <constant name="ARRAY_VERTEX" value="0" enum="ArrayType">
+ [PackedVector3Array], [PackedVector2Array], or [Array] of vertex positions.
+ </constant>
+ <constant name="ARRAY_NORMAL" value="1" enum="ArrayType">
+ [PackedVector3Array] of vertex normals.
+ </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.
+ </constant>
+ <constant name="ARRAY_COLOR" value="3" enum="ArrayType">
+ [PackedColorArray] of vertex colors.
+ </constant>
+ <constant name="ARRAY_TEX_UV" value="4" enum="ArrayType">
+ [PackedVector2Array] for UV coordinates.
+ </constant>
+ <constant name="ARRAY_TEX_UV2" value="5" enum="ArrayType">
+ [PackedVector2Array] for second UV coordinates.
+ </constant>
+ <constant name="ARRAY_CUSTOM0" value="6" enum="ArrayType">
+ </constant>
+ <constant name="ARRAY_CUSTOM1" value="7" enum="ArrayType">
+ </constant>
+ <constant name="ARRAY_CUSTOM2" value="8" enum="ArrayType">
+ </constant>
+ <constant name="ARRAY_CUSTOM3" value="9" enum="ArrayType">
+ </constant>
+ <constant name="ARRAY_BONES" value="10" enum="ArrayType">
+ [PackedFloat32Array] or [PackedInt32Array] of bone indices. Each element is a group of 4 numbers.
+ </constant>
+ <constant name="ARRAY_WEIGHTS" value="11" enum="ArrayType">
+ [PackedFloat32Array] of bone weights. Each element in groups of 4 floats.
+ </constant>
+ <constant name="ARRAY_INDEX" value="12" enum="ArrayType">
+ [PackedInt32Array] of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices.
+ For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line.
+ </constant>
+ <constant name="ARRAY_MAX" value="13" enum="ArrayType">
+ Represents the size of the [enum ArrayType] enum.
+ </constant>
+ <constant name="ARRAY_CUSTOM_RGBA8_UNORM" value="0" enum="ArrayCustomFormat">
+ </constant>
+ <constant name="ARRAY_CUSTOM_RGBA8_SNORM" value="1" enum="ArrayCustomFormat">
+ </constant>
+ <constant name="ARRAY_CUSTOM_RG_HALF" value="2" enum="ArrayCustomFormat">
</constant>
- <constant name="BLEND_SHAPE_MODE_RELATIVE" value="1" enum="BlendShapeMode">
- Blend shapes are relative to base weight.
+ <constant name="ARRAY_CUSTOM_RGBA_HALF" value="3" enum="ArrayCustomFormat">
+ </constant>
+ <constant name="ARRAY_CUSTOM_R_FLOAT" value="4" enum="ArrayCustomFormat">
+ </constant>
+ <constant name="ARRAY_CUSTOM_RG_FLOAT" value="5" enum="ArrayCustomFormat">
+ </constant>
+ <constant name="ARRAY_CUSTOM_RGB_FLOAT" value="6" enum="ArrayCustomFormat">
+ </constant>
+ <constant name="ARRAY_CUSTOM_RGBA_FLOAT" value="7" enum="ArrayCustomFormat">
+ </constant>
+ <constant name="ARRAY_CUSTOM_MAX" value="8" enum="ArrayCustomFormat">
+ Represents the size of the [enum ArrayCustomFormat] enum.
</constant>
<constant name="ARRAY_FORMAT_VERTEX" value="1" enum="ArrayFormat">
Mesh array contains vertices. All meshes require a vertex array so this should always be present.
@@ -146,68 +202,45 @@
<constant name="ARRAY_FORMAT_TEX_UV2" value="32" enum="ArrayFormat">
Mesh array contains second UV.
</constant>
- <constant name="ARRAY_FORMAT_BONES" value="64" enum="ArrayFormat">
- Mesh array contains bones.
- </constant>
- <constant name="ARRAY_FORMAT_WEIGHTS" value="128" enum="ArrayFormat">
- Mesh array contains bone weights.
- </constant>
- <constant name="ARRAY_FORMAT_INDEX" value="256" enum="ArrayFormat">
- Mesh array uses indices.
- </constant>
- <constant name="ARRAY_COMPRESS_NORMAL" value="1024" enum="ArrayFormat">
- Flag used to mark a compressed (half float) normal array.
+ <constant name="ARRAY_FORMAT_CUSTOM0" value="64" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_TANGENT" value="2048" enum="ArrayFormat">
- Flag used to mark a compressed (half float) tangent array.
+ <constant name="ARRAY_FORMAT_CUSTOM1" value="128" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_COLOR" value="4096" enum="ArrayFormat">
- Flag used to mark a compressed (half float) color array.
+ <constant name="ARRAY_FORMAT_CUSTOM2" value="256" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_TEX_UV" value="8192" enum="ArrayFormat">
- Flag used to mark a compressed (half float) UV coordinates array.
+ <constant name="ARRAY_FORMAT_CUSTOM3" value="512" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_TEX_UV2" value="16384" enum="ArrayFormat">
- Flag used to mark a compressed (half float) UV coordinates array for the second UV coordinates.
+ <constant name="ARRAY_FORMAT_BONES" value="1024" enum="ArrayFormat">
+ Mesh array contains bones.
</constant>
- <constant name="ARRAY_COMPRESS_INDEX" value="131072" enum="ArrayFormat">
- Flag used to mark a compressed index array.
+ <constant name="ARRAY_FORMAT_WEIGHTS" value="2048" enum="ArrayFormat">
+ Mesh array contains bone weights.
</constant>
- <constant name="ARRAY_FLAG_USE_2D_VERTICES" value="262144" enum="ArrayFormat">
- Flag used to mark that the array contains 2D vertices.
+ <constant name="ARRAY_FORMAT_INDEX" value="4096" enum="ArrayFormat">
+ Mesh array uses indices.
</constant>
- <constant name="ARRAY_COMPRESS_DEFAULT" value="31744" enum="ArrayFormat">
- Used to set flags [constant ARRAY_COMPRESS_NORMAL], [constant ARRAY_COMPRESS_TANGENT], [constant ARRAY_COMPRESS_COLOR], [constant ARRAY_COMPRESS_TEX_UV] and [constant ARRAY_COMPRESS_TEX_UV2] quickly.
+ <constant name="ARRAY_FORMAT_BLEND_SHAPE_MASK" value="2147475463" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_VERTEX" value="0" enum="ArrayType">
- Array of vertices.
+ <constant name="ARRAY_FORMAT_CUSTOM_BASE" value="13" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_NORMAL" value="1" enum="ArrayType">
- Array of normals.
+ <constant name="ARRAY_FORMAT_CUSTOM0_SHIFT" value="13" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_TANGENT" value="2" enum="ArrayType">
- Array of tangents as an array of floats, 4 floats per tangent.
+ <constant name="ARRAY_FORMAT_CUSTOM1_SHIFT" value="16" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COLOR" value="3" enum="ArrayType">
- Array of colors.
+ <constant name="ARRAY_FORMAT_CUSTOM2_SHIFT" value="19" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_TEX_UV" value="4" enum="ArrayType">
- Array of UV coordinates.
+ <constant name="ARRAY_FORMAT_CUSTOM3_SHIFT" value="22" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_TEX_UV2" value="5" enum="ArrayType">
- Array of second set of UV coordinates.
+ <constant name="ARRAY_FORMAT_CUSTOM_MASK" value="7" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_BONES" value="6" enum="ArrayType">
- Array of bone data.
+ <constant name="ARRAY_COMPRESS_FLAGS_BASE" value="25" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_WEIGHTS" value="7" enum="ArrayType">
- Array of weights.
+ <constant name="ARRAY_FLAG_USE_2D_VERTICES" value="33554432" enum="ArrayFormat">
+ Flag used to mark that the array contains 2D vertices.
</constant>
- <constant name="ARRAY_INDEX" value="8" enum="ArrayType">
- Array of indices.
+ <constant name="ARRAY_FLAG_USE_DYNAMIC_UPDATE" value="67108864" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_MAX" value="9" enum="ArrayType">
- Represents the size of the [enum ArrayType] enum.
+ <constant name="ARRAY_FLAG_USE_8_BONE_WEIGHTS" value="134217728" enum="ArrayFormat">
</constant>
</constants>
</class>
diff --git a/doc/classes/MeshDataTool.xml b/doc/classes/MeshDataTool.xml
index dcc3bbf2a6..db7a3187f0 100644
--- a/doc/classes/MeshDataTool.xml
+++ b/doc/classes/MeshDataTool.xml
@@ -7,16 +7,44 @@
MeshDataTool provides access to individual vertices in a [Mesh]. It allows users to read and edit vertex data of meshes. It also creates an array of faces and edges.
To use MeshDataTool, load a mesh with [method create_from_surface]. When you are finished editing the data commit the data to a mesh with [method commit_to_surface].
Below is an example of how MeshDataTool may be used.
- [codeblock]
+ [codeblocks]
+ [gdscript]
+ var mesh = ArrayMesh.new()
+ mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, BoxMesh.new().get_mesh_arrays())
var mdt = MeshDataTool.new()
mdt.create_from_surface(mesh, 0)
for i in range(mdt.get_vertex_count()):
var vertex = mdt.get_vertex(i)
- ...
+ # In this example we extend the mesh by one unit, which results in seperated faces as it is flat shaded.
+ vertex += mdt.get_vertex_normal(i)
+ # Save your change.
mdt.set_vertex(i, vertex)
mesh.surface_remove(0)
mdt.commit_to_surface(mesh)
- [/codeblock]
+ var mi = MeshInstance.new()
+ mi.mesh = mesh
+ add_child(mi)
+ [/gdscript]
+ [csharp]
+ var mesh = new ArrayMesh();
+ mesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, new BoxMesh().GetMeshArrays());
+ var mdt = new MeshDataTool();
+ mdt.CreateFromSurface(mesh, 0);
+ for (var i = 0; i &lt; mdt.GetVertexCount(); i++)
+ {
+ Vector3 vertex = mdt.GetVertex(i);
+ // In this example we extend the mesh by one unit, which results in seperated faces as it is flat shaded.
+ vertex += mdt.GetVertexNormal(i);
+ // Save your change.
+ mdt.SetVertex(i, vertex);
+ }
+ mesh.SurfaceRemove(0);
+ mdt.CommitToSurface(mesh);
+ var mi = new MeshInstance();
+ mi.Mesh = mesh;
+ AddChild(mi);
+ [/csharp]
+ [/codeblocks]
See also [ArrayMesh], [ImmediateGeometry3D] and [SurfaceTool] for procedural geometry generation.
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
</description>
@@ -141,8 +169,8 @@
<return type="int">
</return>
<description>
- Returns the [Mesh]'s format. Format is an integer made up of [Mesh] format flags combined together. For example, a mesh containing both vertices and normals would return a format of [code]3[/code] because [constant ArrayMesh.ARRAY_FORMAT_VERTEX] is [code]1[/code] and [constant ArrayMesh.ARRAY_FORMAT_NORMAL] is [code]2[/code].
- See [enum ArrayMesh.ArrayFormat] for a list of format flags.
+ Returns the [Mesh]'s format. Format is an integer made up of [Mesh] format flags combined together. For example, a mesh containing both vertices and normals would return a format of [code]3[/code] because [constant Mesh.ARRAY_FORMAT_VERTEX] is [code]1[/code] and [constant Mesh.ARRAY_FORMAT_NORMAL] is [code]2[/code].
+ See [enum Mesh.ArrayFormat] for a list of format flags.
</description>
</method>
<method name="get_material" qualifiers="const">
diff --git a/doc/classes/MeshInstance3D.xml b/doc/classes/MeshInstance3D.xml
index c569da2df1..82cd392cd3 100644
--- a/doc/classes/MeshInstance3D.xml
+++ b/doc/classes/MeshInstance3D.xml
@@ -7,6 +7,10 @@
MeshInstance3D is a node that takes a [Mesh] resource and adds it to the current scenario by creating an instance of it. This is the class most often used render 3D geometry and can be used to instance a single [Mesh] in many places. This allows reuse of geometry which can save on resources. When a [Mesh] has to be instanced more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance3D] instead.
</description>
<tutorials>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="create_convex_collision">
diff --git a/doc/classes/MeshLibrary.xml b/doc/classes/MeshLibrary.xml
index ccf6172017..ad8bd6991d 100644
--- a/doc/classes/MeshLibrary.xml
+++ b/doc/classes/MeshLibrary.xml
@@ -7,6 +7,8 @@
A library of meshes. Contains a list of [Mesh] resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in [GridMap].
</description>
<tutorials>
+ <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
</tutorials>
<methods>
<method name="clear">
diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml
index e1b3ffa2e4..6ebfc946dc 100644
--- a/doc/classes/MultiMesh.xml
+++ b/doc/classes/MultiMesh.xml
@@ -65,7 +65,7 @@
<argument index="1" name="color" type="Color">
</argument>
<description>
- Sets the color of a specific instance.
+ Sets the color of a specific instance by [i]multiplying[/i] the mesh's existing vertex colors.
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.
</description>
</method>
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index 9c753818d9..fcc259fb44 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -75,16 +75,6 @@
Sends the given raw [code]bytes[/code] to a specific peer identified by [code]id[/code] (see [method NetworkedMultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers.
</description>
</method>
- <method name="set_root_node">
- <return type="void">
- </return>
- <argument index="0" name="node" type="Node">
- </argument>
- <description>
- Sets the base root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed.
- This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene.
- </description>
- </method>
</methods>
<members>
<member name="allow_object_decoding" type="bool" setter="set_allow_object_decoding" getter="is_object_decoding_allowed" default="false">
@@ -97,6 +87,10 @@
<member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections" default="false">
If [code]true[/code], the MultiplayerAPI's [member network_peer] refuses new incoming connections.
</member>
+ <member name="root_node" type="Node" setter="set_root_node" getter="get_root_node">
+ The root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed.
+ This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene.
+ </member>
</members>
<signals>
<signal name="connected_to_server">
diff --git a/doc/classes/Navigation2D.xml b/doc/classes/Navigation2D.xml
index dcbfbc2350..abac29bdb7 100644
--- a/doc/classes/Navigation2D.xml
+++ b/doc/classes/Navigation2D.xml
@@ -7,6 +7,7 @@
Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of [NavigationPolygon] resources. These are automatically collected from child [NavigationRegion2D] nodes.
</description>
<tutorials>
+ <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link>
</tutorials>
<methods>
<method name="get_closest_point" qualifiers="const">
diff --git a/doc/classes/Navigation3D.xml b/doc/classes/Navigation3D.xml
index 807f0ad309..e7a4fe3c43 100644
--- a/doc/classes/Navigation3D.xml
+++ b/doc/classes/Navigation3D.xml
@@ -7,6 +7,7 @@
Provides navigation and pathfinding within a collection of [NavigationMesh]es. These will be automatically collected from child [NavigationRegion3D] nodes. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on.
</description>
<tutorials>
+ <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link>
</tutorials>
<methods>
<method name="get_closest_point" qualifiers="const">
diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml
index 6deca4394f..dd7464ac0e 100644
--- a/doc/classes/NavigationMesh.xml
+++ b/doc/classes/NavigationMesh.xml
@@ -5,6 +5,7 @@
<description>
</description>
<tutorials>
+ <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link>
</tutorials>
<methods>
<method name="add_polygon">
@@ -80,14 +81,17 @@
<member name="agent/height" type="float" setter="set_agent_height" getter="get_agent_height" default="2.0">
</member>
<member name="agent/max_climb" type="float" setter="set_agent_max_climb" getter="get_agent_max_climb" default="0.9">
+ The maximum height difference between two areas for navigation to be generated between them.
</member>
<member name="agent/max_slope" type="float" setter="set_agent_max_slope" getter="get_agent_max_slope" default="45.0">
+ The maximum angle a slope can be at for navigation to be generated on it.
</member>
<member name="agent/radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="0.6">
</member>
<member name="cell/height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.2">
</member>
<member name="cell/size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.3">
+ The size of cells in the [NavigationMesh].
</member>
<member name="detail/sample_distance" type="float" setter="set_detail_sample_distance" getter="get_detail_sample_distance" default="6.0">
</member>
@@ -104,18 +108,25 @@
<member name="filter/low_hanging_obstacles" type="bool" setter="set_filter_low_hanging_obstacles" getter="get_filter_low_hanging_obstacles" default="false">
</member>
<member name="geometry/collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask">
+ The physics layers used to generate the [NavigationMesh].
</member>
<member name="geometry/parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" default="0">
+ What kind of geomerty is used to generate the [NavigationMesh].
</member>
<member name="geometry/source_geometry_mode" type="int" setter="set_source_geometry_mode" getter="get_source_geometry_mode" default="0">
+ Which geometry is used to generate the [NavigationMesh].
</member>
<member name="geometry/source_group_name" type="StringName" setter="set_source_group_name" getter="get_source_group_name">
+ The name of the group that is used to generate the [NavigationMesh].
</member>
<member name="polygon/verts_per_poly" type="float" setter="set_verts_per_poly" getter="get_verts_per_poly" default="6.0">
+ The number of vertices to use per polygon. Higher values will improve performance at the cost of lower precision.
</member>
<member name="region/merge_size" type="float" setter="set_region_merge_size" getter="get_region_merge_size" default="20.0">
+ If two adjacent regions' edges are separated by a distance lower than this value, the regions will be merged together.
</member>
<member name="region/min_size" type="float" setter="set_region_min_size" getter="get_region_min_size" default="8.0">
+ The minimum size of a region for it to be created.
</member>
<member name="sample_partition_type/sample_partition_type" type="int" setter="set_sample_partition_type" getter="get_sample_partition_type" default="0">
</member>
diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml
index b0f77dff83..38921078d7 100644
--- a/doc/classes/NavigationPolygon.xml
+++ b/doc/classes/NavigationPolygon.xml
@@ -6,24 +6,44 @@
<description>
There are two ways to create polygons. Either by using the [method add_outline] method, or using the [method add_polygon] method.
Using [method add_outline]:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var polygon = NavigationPolygon.new()
var outline = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)])
polygon.add_outline(outline)
polygon.make_polygons_from_outlines()
$NavigationRegion2D.navpoly = polygon
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var polygon = new NavigationPolygon();
+ var outline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) };
+ polygon.AddOutline(outline);
+ polygon.MakePolygonsFromOutlines();
+ GetNode&lt;NavigationRegion2D&gt;("NavigationRegion2D").Navpoly = polygon;
+ [/csharp]
+ [/codeblocks]
Using [method add_polygon] and indices of the vertices array.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var polygon = NavigationPolygon.new()
var vertices = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)])
- polygon.set_vertices(vertices)
+ polygon.vertices = vertices
var indices = PackedInt32Array(0, 3, 1)
polygon.add_polygon(indices)
$NavigationRegion2D.navpoly = polygon
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var polygon = new NavigationPolygon();
+ var vertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) };
+ polygon.Vertices = vertices;
+ var indices = new int[] { 0, 3, 1 };
+ polygon.AddPolygon(indices);
+ GetNode&lt;NavigationRegion2D&gt;("NavigationRegion2D").Navpoly = polygon;
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
+ <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link>
</tutorials>
<methods>
<method name="add_outline">
diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml
index 1b9099336c..5f0b04487e 100644
--- a/doc/classes/NavigationServer2D.xml
+++ b/doc/classes/NavigationServer2D.xml
@@ -7,6 +7,7 @@
NavigationServer2D is the server responsible for all 2D navigation. It creates the agents, maps, and regions for navigation to work as expected. This keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying.
</description>
<tutorials>
+ <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link>
</tutorials>
<methods>
<method name="agent_create" qualifiers="const">
diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml
index 1f621c3c81..95890c4b4c 100644
--- a/doc/classes/NavigationServer3D.xml
+++ b/doc/classes/NavigationServer3D.xml
@@ -7,6 +7,7 @@
NavigationServer3D is the server responsible for all 3D navigation. It creates the agents, maps, and regions for navigation to work as expected. This keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying.
</description>
<tutorials>
+ <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link>
</tutorials>
<methods>
<method name="agent_create" qualifiers="const">
diff --git a/doc/classes/NetworkedMultiplayerPeer.xml b/doc/classes/NetworkedMultiplayerPeer.xml
index 7e2a9af59f..954d31794a 100644
--- a/doc/classes/NetworkedMultiplayerPeer.xml
+++ b/doc/classes/NetworkedMultiplayerPeer.xml
@@ -8,6 +8,7 @@
</description>
<tutorials>
<link title="High-level multiplayer">https://docs.godotengine.org/en/latest/tutorials/networking/high_level_multiplayer.html</link>
+ <link title="WebRTC Signaling Demo">https://godotengine.org/asset-library/asset/537</link>
</tutorials>
<methods>
<method name="get_connection_status" qualifiers="const">
diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml
index 9c3acc9b0a..b2e0442be8 100644
--- a/doc/classes/NinePatchRect.xml
+++ b/doc/classes/NinePatchRect.xml
@@ -32,10 +32,10 @@
</methods>
<members>
<member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode" default="0">
- Doesn't do anything at the time of writing.
+ The stretch mode to use for horizontal stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values.
</member>
<member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode" default="0">
- Doesn't do anything at the time of writing.
+ The stretch mode to use for vertical stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values.
</member>
<member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true">
If [code]true[/code], draw the panel's center. Else, only draw the 9-slice's borders.
@@ -45,13 +45,13 @@
The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
</member>
<member name="patch_margin_left" type="int" setter="set_patch_margin" getter="get_patch_margin" default="0">
- The height of the 9-slice's left column.
+ The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
</member>
<member name="patch_margin_right" type="int" setter="set_patch_margin" getter="get_patch_margin" default="0">
- The height of the 9-slice's right column.
+ The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
</member>
<member name="patch_margin_top" type="int" setter="set_patch_margin" getter="get_patch_margin" default="0">
- The height of the 9-slice's top row.
+ The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
</member>
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture.
@@ -69,13 +69,15 @@
</signals>
<constants>
<constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode">
- Doesn't do anything at the time of writing.
+ Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted.
</constant>
<constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode">
- Doesn't do anything at the time of writing.
+ Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges.
+ [b]Note:[/b] Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like [constant AXIS_STRETCH_MODE_STRETCH].
</constant>
<constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode">
- Doesn't do anything at the time of writing.
+ Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than [constant AXIS_STRETCH_MODE_STRETCH]. The texture must be seamless for this to work without displaying artifacts between edges.
+ [b]Note:[/b] Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like [constant AXIS_STRETCH_MODE_STRETCH].
</constant>
</constants>
</class>
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 1548800901..62d88afa51 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -18,6 +18,7 @@
</description>
<tutorials>
<link title="Scenes and nodes">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scenes_and_nodes.html</link>
+ <link title="All Demos">https://github.com/godotengine/godot-demo-projects/</link>
</tutorials>
<methods>
<method name="_enter_tree" qualifiers="virtual">
@@ -129,11 +130,22 @@
Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
If [code]legible_unique_name[/code] is [code]true[/code], the child node will have an human-readable name based on the name of the node being instanced instead of its type.
[b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
+ var child_node = get_child(0)
if child_node.get_parent():
child_node.get_parent().remove_child(child_node)
add_child(child_node)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ Node childNode = GetChild(0);
+ if (childNode.GetParent() != null)
+ {
+ childNode.GetParent().RemoveChild(childNode);
+ }
+ AddChild(childNode);
+ [/csharp]
+ [/codeblocks]
If you need the child node to be added below a specific node in the list of children, use [method add_sibling] instead of this method.
[b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=https://godot.readthedocs.io/en/latest/tutorials/misc/running_code_in_the_editor.html]tool scripts[/url] and [url=https://godot.readthedocs.io/en/latest/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view.
</description>
@@ -274,12 +286,20 @@
/root/Swamp/Goblin
[/codeblock]
Possible paths are:
- [codeblock]
+ [codeblocks]
+ [gdscript]
get_node("Sword")
get_node("Backpack/Dagger")
get_node("../Swamp/Alligator")
get_node("/root/MyGame")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GetNode("Sword");
+ GetNode("Backpack/Dagger");
+ GetNode("../Swamp/Alligator");
+ GetNode("/root/MyGame");
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_node_and_resource">
@@ -291,11 +311,18 @@
Fetches a node and one of its resources as specified by the [NodePath]'s subname (e.g. [code]Area2D/CollisionShape2D:shape[/code]). If several nested resources are specified in the [NodePath], the last one will be fetched.
The return value is an array of size 3: the first index points to the [Node] (or [code]null[/code] if not found), the second index points to the [Resource] (or [code]null[/code] if not found), and the third index is the remaining [NodePath], if any.
For example, assuming that [code]Area2D/CollisionShape2D[/code] is a valid node and that its [code]shape[/code] property has been assigned a [RectangleShape2D] resource, one could have this kind of output:
- [codeblock]
+ [codeblocks]
+ [gdscript]
print(get_node_and_resource("Area2D/CollisionShape2D")) # [[CollisionShape2D:1161], Null, ]
print(get_node_and_resource("Area2D/CollisionShape2D:shape")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
print(get_node_and_resource("Area2D/CollisionShape2D:shape:extents")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.Print(GetNodeAndResource("Area2D/CollisionShape2D")); // [[CollisionShape2D:1161], Null, ]
+ GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
+ GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape:extents")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_node_or_null" qualifiers="const">
@@ -755,7 +782,8 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal [method _physics_process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). Only useful for advanced uses to manipulate built-in nodes' behaviour.
+ Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal [method _physics_process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). Only useful for advanced uses to manipulate built-in nodes' behavior.
+ [b]Warning:[/b] Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported.
</description>
</method>
<method name="set_process">
@@ -782,7 +810,8 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal [method _process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). Only useful for advanced uses to manipulate built-in nodes' behaviour.
+ Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal [method _process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). Only useful for advanced uses to manipulate built-in nodes' behavior.
+ [b]Warning:[/b] Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported.
</description>
</method>
<method name="set_process_unhandled_input">
@@ -833,6 +862,7 @@
</member>
<member name="name" type="StringName" setter="set_name" getter="get_name">
The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed.
+ [b]Note:[/b] Auto-generated names might include the [code]@[/code] character, which is reserved for unique names when using [method add_child]. When setting the name manually, any [code]@[/code] will be removed.
</member>
<member name="owner" type="Node" setter="set_owner" getter="get_owner">
The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using [PackedScene]), all the nodes it owns will be saved with it. This allows for the creation of complex [SceneTree]s, with instancing and subinstancing.
@@ -983,6 +1013,9 @@
Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
Implemented on desktop platforms.
</constant>
+ <constant name="NOTIFICATION_TEXT_SERVER_CHANGED" value="2018">
+ Notification received when text server is changed.
+ </constant>
<constant name="PAUSE_MODE_INHERIT" value="0" enum="PauseMode">
Inherits pause mode from the node's parent. For the root node, it is equivalent to [constant PAUSE_MODE_STOP]. Default.
</constant>
diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml
index 987a18f367..eed0ec8d7e 100644
--- a/doc/classes/Node2D.xml
+++ b/doc/classes/Node2D.xml
@@ -8,6 +8,7 @@
</description>
<tutorials>
<link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
+ <link title="All 2D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/2d</link>
</tutorials>
<methods>
<method name="apply_scale">
diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml
index 1ef875f606..f6ff514474 100644
--- a/doc/classes/Node3D.xml
+++ b/doc/classes/Node3D.xml
@@ -10,6 +10,7 @@
</description>
<tutorials>
<link title="Introduction to 3D">https://docs.godotengine.org/en/latest/tutorials/3d/introduction_to_3d.html</link>
+ <link title="All 3D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/3d</link>
</tutorials>
<methods>
<method name="force_update_transform">
@@ -83,13 +84,6 @@
Returns whether this node uses a scale of [code](1, 1, 1)[/code] or its local transformation scale.
</description>
</method>
- <method name="is_set_as_toplevel" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations.
- </description>
- </method>
<method name="is_transform_notification_enabled" qualifiers="const">
<return type="bool">
</return>
@@ -195,15 +189,6 @@
Scales the local transformation by given 3D scale factors in object-local coordinate system.
</description>
</method>
- <method name="set_as_toplevel">
- <return type="void">
- </return>
- <argument index="0" name="enable" type="bool">
- </argument>
- <description>
- Makes the node ignore its parents transformations. Node transformations are only in global space.
- </description>
- </method>
<method name="set_disable_scale">
<return type="void">
</return>
@@ -316,6 +301,9 @@
<member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3( 1, 1, 1 )">
Scale part of the local transformation.
</member>
+ <member name="top_level" type="bool" setter="set_as_top_level" getter="is_set_as_top_level" default="false">
+ If [code]true[/code], the node will not inherit its transformations from its parent. Node transformations are only in global space.
+ </member>
<member name="transform" type="Transform" setter="set_transform" getter="get_transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
Local space [Transform] of this node, with respect to the parent node.
</member>
diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml
index dc7fd1be3f..36835d9e94 100644
--- a/doc/classes/NodePath.xml
+++ b/doc/classes/NodePath.xml
@@ -22,9 +22,26 @@
[/codeblock]
</description>
<tutorials>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
</tutorials>
<methods>
- <method name="NodePath">
+ <method name="NodePath" qualifiers="constructor">
+ <return type="NodePath">
+ </return>
+ <description>
+ Constructs an empty [NodePath].
+ </description>
+ </method>
+ <method name="NodePath" qualifiers="constructor">
+ <return type="NodePath">
+ </return>
+ <argument index="0" name="from" type="NodePath">
+ </argument>
+ <description>
+ Constructs a [NodePath] as a copy of the given [NodePath].
+ </description>
+ </method>
+ <method name="NodePath" qualifiers="constructor">
<return type="NodePath">
</return>
<argument index="0" name="from" type="String">
@@ -34,7 +51,7 @@
The "subnames" optionally included after the path to the target node can point to resources or properties, and can also be nested.
Examples of valid NodePaths (assuming that those nodes exist and have the referenced resources or properties):
[codeblock]
- # Points to the Sprite2D node
+ # Points to the Sprite2D node.
"Path2D/PathFollow2D/Sprite2D"
# Points to the Sprite2D node and its "texture" resource.
# get_node() would retrieve "Sprite2D", while get_node_and_resource()
@@ -53,40 +70,63 @@
<return type="NodePath">
</return>
<description>
- Returns a node path with a colon character ([code]:[/code]) prepended, transforming it to a pure property path with no node name (defaults to resolving from the current node).
- [codeblock]
- # This will be parsed as a node path to the "x" property in the "position" node
+ Returns a node path with a colon character ([code]:[/code]) prepended, transforming it to a pure property path with no node name (defaults to resolving from the from the current node).
+ [codeblocks]
+ [gdscript]
+ # This will be parsed as a node path to the "x" property in the "position" node.
var node_path = NodePath("position:x")
- # This will be parsed as a node path to the "x" component of the "position" property in the current node
+ # This will be parsed as a node path to the "x" component of the "position" property in the current node.
var property_path = node_path.get_as_property_path()
print(property_path) # :position:x
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // This will be parsed as a node path to the "x" property in the "position" node.
+ var nodePath = new NodePath("position:x");
+ // This will be parsed as a node path to the "x" component of the "position" property in the current node.
+ NodePath propertyPath = nodePath.GetAsPropertyPath();
+ GD.Print(propertyPath); // :position:x
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_concatenated_subnames">
- <return type="String">
+ <return type="StringName">
</return>
<description>
Returns all subnames concatenated with a colon character ([code]:[/code]) as separator, i.e. the right side of the first colon in a node path.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var nodepath = NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path")
print(nodepath.get_concatenated_subnames()) # texture:load_path
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var nodepath = new NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path");
+ GD.Print(nodepath.GetConcatenatedSubnames()); // texture:load_path
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_name">
- <return type="String">
+ <return type="StringName">
</return>
<argument index="0" name="idx" type="int">
</argument>
<description>
Gets the node name indicated by [code]idx[/code] (0 to [method get_name_count]).
- [codeblock]
+ [codeblocks]
+ [gdscript]
var node_path = NodePath("Path2D/PathFollow2D/Sprite2D")
print(node_path.get_name(0)) # Path2D
print(node_path.get_name(1)) # PathFollow2D
print(node_path.get_name(2)) # Sprite
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var nodePath = new NodePath("Path2D/PathFollow2D/Sprite2D");
+ GD.Print(nodePath.GetName(0)); // Path2D
+ GD.Print(nodePath.GetName(1)); // PathFollow2D
+ GD.Print(nodePath.GetName(2)); // Sprite
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_name_count">
@@ -98,17 +138,24 @@
</description>
</method>
<method name="get_subname">
- <return type="String">
+ <return type="StringName">
</return>
<argument index="0" name="idx" type="int">
</argument>
<description>
Gets the resource or property name indicated by [code]idx[/code] (0 to [method get_subname_count]).
- [codeblock]
+ [codeblocks]
+ [gdscript]
var node_path = NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path")
print(node_path.get_subname(0)) # texture
print(node_path.get_subname(1)) # load_path
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var nodePath = new NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path");
+ GD.Print(nodePath.GetSubname(0)); // texture
+ GD.Print(nodePath.GetSubname(1)); // load_path
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_subname_count">
@@ -133,6 +180,22 @@
Returns [code]true[/code] if the node path is empty.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="NodePath">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="NodePath">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 26110df335..65a815a603 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -7,6 +7,7 @@
Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, date and time, timers, environment variables, execution of binaries, command line, etc.
</description>
<tutorials>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
<method name="can_use_threads" qualifiers="const">
@@ -84,18 +85,36 @@
If [code]blocking[/code] is [code]false[/code], the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so [code]output[/code] will be empty.
The return value also depends on the blocking mode. When blocking, the method will return an exit code of the process. When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). If the process forking (non-blocking) or opening (blocking) fails, the method will return [code]-1[/code] or another exit code.
Example of blocking mode and retrieving the shell output:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var output = []
var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var output = new Godot.Collections.Array();
+ int exitCode = OS.Execute("ls", new string[] {"-l", "/tmp"}, true, output);
+ [/csharp]
+ [/codeblocks]
Example of non-blocking mode, running another instance of the project and storing its process ID:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var pid = OS.execute(OS.get_executable_path(), [], false)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var pid = OS.Execute(OS.GetExecutablePath(), new string[] {}, false);
+ [/csharp]
+ [/codeblocks]
If you wish to access a shell built-in or perform a composite command, a platform-specific shell can be invoked. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
+ var output = []
OS.execute("CMD.exe", ["/C", "cd %TEMP% &amp;&amp; dir"], true, output)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var output = new Godot.Collections.Array();
+ OS.Execute("CMD.exe", new string[] {"/C", "cd %TEMP% &amp;&amp; dir"}, true, output);
+ [/csharp]
+ [/codeblocks]
[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
</description>
</method>
@@ -117,13 +136,26 @@
You can also incorporate environment variables using the [method get_environment] method.
You can set [code]editor/main_run_args[/code] in the Project Settings 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:
- [codeblock]
+ [codeblocks]
+ [gdscript]
var arguments = {}
for argument in OS.get_cmdline_args():
if argument.find("=") &gt; -1:
var key_value = argument.split("=")
arguments[key_value[0].lstrip("--")] = key_value[1]
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var arguments = new Godot.Collections.Dictionary();
+ foreach (var argument in OS.GetCmdlineArgs())
+ {
+ if (argument.Find("=") &gt; -1)
+ {
+ string[] keyValue = argument.Split("=");
+ arguments[keyValue[0].LStrip("--")] = keyValue[1];
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_connected_midi_inputs">
@@ -201,7 +233,12 @@
<return type="String">
</return>
<description>
- Returns the host OS locale.
+ Returns the host OS locale as a string of the form [code]language_Script_COUNTRY_VARIANT@extra[/code].
+ [code]language[/code] - 2 or 3 letter [url=https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes]language code[/url], in lower case.
+ [code]Script[/code] - optional, 4 letter [url=https://en.wikipedia.org/wiki/ISO_15924]script code[/url], in title case.
+ [code]COUNTRY[/code] - optional, 2 or 3 letter [url=https://en.wikipedia.org/wiki/ISO_3166-1]country code[/url], in upper case.
+ [code]VARIANT[/code] - optional, language variant, region and sort order. Variant can have any number of underscored key words.
+ [code]extra[/code] - optional, semicolon separated list of additional key words. Currency, calendar, sort order and numbering system information.
</description>
</method>
<method name="get_model_name" qualifiers="const">
@@ -234,13 +271,6 @@
Returns the number of threads available on the host machine.
</description>
</method>
- <method name="get_splash_tick_msec" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the amount of time in milliseconds it took for the boot logo to appear.
- </description>
- </method>
<method name="get_static_memory_peak_usage" qualifiers="const">
<return type="int">
</return>
@@ -326,6 +356,7 @@
</return>
<description>
Returns the current UNIX epoch timestamp.
+ [b]Important:[/b] This is the system clock that the user can manully set. [b]Never use[/b] this method for precise time calculation since its results are also subject to automatic adjustments by the operating system. [b]Always use[/b] [method get_ticks_usec] or [method get_ticks_msec] for precise time calculation instead, since they are guaranteed to be monotonic (i.e. never decrease).
</description>
</method>
<method name="get_unix_time_from_datetime" qualifiers="const">
diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml
index 8c4bbd6716..53309bae96 100644
--- a/doc/classes/OptionButton.xml
+++ b/doc/classes/OptionButton.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
</tutorials>
@@ -238,7 +239,10 @@
The horizontal space between the arrow icon and the right edge of the button.
</theme_item>
<theme_item name="disabled" type="StyleBox">
- [StyleBox] used when the [OptionButton] is disabled.
+ [StyleBox] used when the [OptionButton] is disabled (for left-to-right layouts).
+ </theme_item>
+ <theme_item name="disabled_mirrored" type="StyleBox">
+ [StyleBox] used when the [OptionButton] is disabled (for right-to-left layouts).
</theme_item>
<theme_item name="focus" type="StyleBox">
[StyleBox] used when the [OptionButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
@@ -258,17 +262,29 @@
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
Text [Color] used when the [OptionButton] is being pressed.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the [OptionButton]'s text.
+ </theme_item>
<theme_item name="hover" type="StyleBox">
- [StyleBox] used when the [OptionButton] is being hovered.
+ [StyleBox] used when the [OptionButton] is being hovered (for left-to-right layouts).
+ </theme_item>
+ <theme_item name="hover_mirrored" type="StyleBox">
+ [StyleBox] used when the [OptionButton] is being hovered (for right-to-left layouts).
</theme_item>
<theme_item name="hseparation" type="int" default="2">
The horizontal space between [OptionButton]'s icon and text.
</theme_item>
<theme_item name="normal" type="StyleBox">
- Default [StyleBox] for the [OptionButton].
+ Default [StyleBox] for the [OptionButton] (for left-to-right layouts).
+ </theme_item>
+ <theme_item name="normal_mirrored" type="StyleBox">
+ Default [StyleBox] for the [OptionButton] (for right-to-left layouts).
</theme_item>
<theme_item name="pressed" type="StyleBox">
- [StyleBox] used when the [OptionButton] is being pressed.
+ [StyleBox] used when the [OptionButton] is being pressed (for left-to-right layouts).
+ </theme_item>
+ <theme_item name="pressed_mirrored" type="StyleBox">
+ [StyleBox] used when the [OptionButton] is being pressed (for right-to-left layouts).
</theme_item>
</theme_items>
</class>
diff --git a/doc/classes/PCKPacker.xml b/doc/classes/PCKPacker.xml
index 6b500d5ac3..e3c78e08f1 100644
--- a/doc/classes/PCKPacker.xml
+++ b/doc/classes/PCKPacker.xml
@@ -5,12 +5,20 @@
</brief_description>
<description>
The [PCKPacker] is used to create packages that can be loaded into a running project using [method ProjectSettings.load_resource_pack].
- [codeblock]
+ [codeblocks]
+ [gdscript]
var packer = PCKPacker.new()
packer.pck_start("test.pck")
packer.add_file("res://text.txt", "text.txt")
packer.flush()
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var packer = new PCKPacker();
+ packer.PckStart("test.pck");
+ packer.AddFile("res://text.txt", "text.txt");
+ packer.Flush();
+ [/csharp]
+ [/codeblocks]
The above [PCKPacker] creates package [code]test.pck[/code], then adds a file named [code]text.txt[/code] at the root of the package.
</description>
<tutorials>
diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml
index 0fcfed0595..91d066260b 100644
--- a/doc/classes/PackedByteArray.xml
+++ b/doc/classes/PackedByteArray.xml
@@ -10,7 +10,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedByteArray">
+ <method name="PackedByteArray" qualifiers="constructor">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ Constructs an empty [PackedByteArray].
+ </description>
+ </method>
+ <method name="PackedByteArray" qualifiers="constructor">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="from" type="PackedByteArray">
+ </argument>
+ <description>
+ Constructs a [PackedByteArray] as a copy of the given [PackedByteArray].
+ </description>
+ </method>
+ <method name="PackedByteArray" qualifiers="constructor">
<return type="PackedByteArray">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +36,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="byte" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -66,9 +82,8 @@
</argument>
<description>
Returns a new [PackedByteArray] with the data decompressed. Set the compression mode using one of [enum File.CompressionMode]'s constants. [b]This method only accepts gzip and deflate compression modes.[/b]
- This method is potentially slower than [code]decompress[/code], as it may have to re-allocate it's output buffer multiple times while decompressing, where as [code]decompress[/code] knows it's output buffer size from the begining.
-
- GZIP has a maximal compression ratio of 1032:1, meaning it's very possible for a small compressed payload to decompress to a potentially very large output. To guard against this, you may provide a maximum size this function is allowed to allocate in bytes via [code]max_output_size[/code]. Passing -1 will allow for unbounded output. If any positive value is passed, and the decompression exceeds that ammount in bytes, then an error will be returned.
+ This method is potentially slower than [code]decompress[/code], as it may have to re-allocate it's output buffer multiple times while decompressing, where as [code]decompress[/code] knows it's output buffer size from the beginning.
+ GZIP has a maximal compression ratio of 1032:1, meaning it's very possible for a small compressed payload to decompress to a potentially very large output. To guard against this, you may provide a maximum size this function is allowed to allocate in bytes via [code]max_output_size[/code]. Passing -1 will allow for unbounded output. If any positive value is passed, and the decompression exceeds that amount in bytes, then an error will be returned.
</description>
</method>
<method name="empty">
@@ -89,21 +104,21 @@
<return type="String">
</return>
<description>
- Converts UTF-16 encoded array to [String]. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not vaild UTF-16 string.
+ Converts UTF-16 encoded array to [String]. If the BOM is missing, system endianness is assumed. Returns empty string if source array is not valid UTF-16 string.
</description>
</method>
<method name="get_string_from_utf32">
<return type="String">
</return>
<description>
- Converts UTF-32 encoded array to [String]. System endianness is assumed. Returns empty string if source array is not vaild UTF-32 string.
+ Converts UTF-32 encoded array to [String]. System endianness is assumed. Returns empty string if source array is not valid UTF-32 string.
</description>
</method>
<method name="get_string_from_utf8">
<return type="String">
</return>
<description>
- Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not vaild UTF-8 string.
+ Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string.
</description>
</method>
<method name="has">
@@ -120,18 +135,24 @@
</return>
<description>
Returns a hexadecimal representation of this array as a [String].
- [codeblock]
+ [codeblocks]
+ [gdscript]
var array = PackedByteArray([11, 46, 255])
print(array.hex_encode()) # Prints: 0b2eff
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var array = new byte[] {11, 46, 255};
+ GD.Print(array.HexEncode()); // Prints: 0b2eff
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="byte" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<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]idx == size()[/code]).
@@ -144,10 +165,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedByteArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedByteArray">
+ </return>
+ <argument index="0" name="right" type="PackedByteArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedByteArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="byte" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends an element at the end of the array.
@@ -156,16 +209,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -174,9 +227,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="byte" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Changes the byte at the given index.
diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml
index ec087e1b39..3065d16945 100644
--- a/doc/classes/PackedColorArray.xml
+++ b/doc/classes/PackedColorArray.xml
@@ -10,7 +10,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedColorArray">
+ <method name="PackedColorArray" qualifiers="constructor">
+ <return type="PackedColorArray">
+ </return>
+ <description>
+ Constructs an empty [PackedColorArray].
+ </description>
+ </method>
+ <method name="PackedColorArray" qualifiers="constructor">
+ <return type="PackedColorArray">
+ </return>
+ <argument index="0" name="from" type="PackedColorArray">
+ </argument>
+ <description>
+ Constructs a [PackedColorArray] as a copy of the given [PackedColorArray].
+ </description>
+ </method>
+ <method name="PackedColorArray" qualifiers="constructor">
<return type="PackedColorArray">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +36,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="color" type="Color">
+ <argument index="0" name="value" type="Color">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -56,9 +72,9 @@
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="color" type="Color">
+ <argument index="1" name="value" type="Color">
</argument>
<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]idx == size()[/code]).
@@ -71,10 +87,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedColorArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedColorArray">
+ </return>
+ <argument index="0" name="right" type="PackedColorArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedColorArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="color" type="Color">
+ <argument index="0" name="value" type="Color">
</argument>
<description>
Appends a value to the array.
@@ -83,16 +131,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -101,9 +149,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="color" type="Color">
+ <argument index="1" name="value" type="Color">
</argument>
<description>
Changes the [Color] at the given index.
@@ -123,6 +171,22 @@
Sorts the elements of the array in ascending order.
</description>
</method>
+ <method name="subarray">
+ <return type="PackedColorArray">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml
index a6b726944b..ab9594d2e3 100644
--- a/doc/classes/PackedFloat32Array.xml
+++ b/doc/classes/PackedFloat32Array.xml
@@ -11,7 +11,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedFloat32Array">
+ <method name="PackedFloat32Array" qualifiers="constructor">
+ <return type="PackedFloat32Array">
+ </return>
+ <description>
+ Constructs an empty [PackedFloat32Array].
+ </description>
+ </method>
+ <method name="PackedFloat32Array" qualifiers="constructor">
+ <return type="PackedFloat32Array">
+ </return>
+ <argument index="0" name="from" type="PackedFloat32Array">
+ </argument>
+ <description>
+ Constructs a [PackedFloat32Array] as a copy of the given [PackedFloat32Array].
+ </description>
+ </method>
+ <method name="PackedFloat32Array" qualifiers="constructor">
<return type="PackedFloat32Array">
</return>
<argument index="0" name="from" type="Array">
@@ -21,7 +37,7 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="value" type="float">
</argument>
@@ -57,7 +73,7 @@
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
<argument index="1" name="value" type="float">
</argument>
@@ -72,8 +88,32 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedFloat32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedFloat32Array">
+ </return>
+ <argument index="0" name="right" type="PackedFloat32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedFloat32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="value" type="float">
</argument>
@@ -84,16 +124,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -102,7 +142,7 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<argument index="1" name="value" type="float">
</argument>
@@ -124,6 +164,22 @@
Sorts the elements of the array in ascending order.
</description>
</method>
+ <method name="subarray">
+ <return type="PackedFloat32Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml
index f867cda3b6..3088aee483 100644
--- a/doc/classes/PackedFloat64Array.xml
+++ b/doc/classes/PackedFloat64Array.xml
@@ -11,7 +11,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedFloat64Array">
+ <method name="PackedFloat64Array" qualifiers="constructor">
+ <return type="PackedFloat64Array">
+ </return>
+ <description>
+ Constructs an empty [PackedFloat64Array].
+ </description>
+ </method>
+ <method name="PackedFloat64Array" qualifiers="constructor">
+ <return type="PackedFloat64Array">
+ </return>
+ <argument index="0" name="from" type="PackedFloat64Array">
+ </argument>
+ <description>
+ Constructs a [PackedFloat64Array] as a copy of the given [PackedFloat64Array].
+ </description>
+ </method>
+ <method name="PackedFloat64Array" qualifiers="constructor">
<return type="PackedFloat64Array">
</return>
<argument index="0" name="from" type="Array">
@@ -21,7 +37,7 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="value" type="float">
</argument>
@@ -57,7 +73,7 @@
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
<argument index="1" name="value" type="float">
</argument>
@@ -72,8 +88,40 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedFloat64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedFloat64Array">
+ </return>
+ <argument index="0" name="right" type="PackedFloat64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedFloat64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="value" type="float">
</argument>
@@ -84,16 +132,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -102,7 +150,7 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<argument index="1" name="value" type="float">
</argument>
@@ -124,6 +172,22 @@
Sorts the elements of the array in ascending order.
</description>
</method>
+ <method name="subarray">
+ <return type="PackedFloat64Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml
index b796d9cacb..eded545de8 100644
--- a/doc/classes/PackedInt32Array.xml
+++ b/doc/classes/PackedInt32Array.xml
@@ -11,7 +11,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedInt32Array">
+ <method name="PackedInt32Array" qualifiers="constructor">
+ <return type="PackedInt32Array">
+ </return>
+ <description>
+ Constructs an empty [PackedInt32Array].
+ </description>
+ </method>
+ <method name="PackedInt32Array" qualifiers="constructor">
+ <return type="PackedInt32Array">
+ </return>
+ <argument index="0" name="from" type="PackedInt32Array">
+ </argument>
+ <description>
+ Constructs a [PackedInt32Array] as a copy of the given [PackedInt32Array].
+ </description>
+ </method>
+ <method name="PackedInt32Array" qualifiers="constructor">
<return type="PackedInt32Array">
</return>
<argument index="0" name="from" type="Array">
@@ -21,9 +37,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="integer" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -57,9 +73,9 @@
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="integer" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
@@ -72,10 +88,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedInt32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedInt32Array">
+ </return>
+ <argument index="0" name="right" type="PackedInt32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedInt32Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="integer" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends a value to the array.
@@ -84,16 +132,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -102,9 +150,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="integer" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Changes the integer at the given index.
@@ -124,6 +172,22 @@
Sorts the elements of the array in ascending order.
</description>
</method>
+ <method name="subarray">
+ <return type="PackedInt32Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml
index 3d0d9a1360..83731b1023 100644
--- a/doc/classes/PackedInt64Array.xml
+++ b/doc/classes/PackedInt64Array.xml
@@ -11,7 +11,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedInt64Array">
+ <method name="PackedInt64Array" qualifiers="constructor">
+ <return type="PackedInt64Array">
+ </return>
+ <description>
+ Constructs an empty [PackedInt64Array].
+ </description>
+ </method>
+ <method name="PackedInt64Array" qualifiers="constructor">
+ <return type="PackedInt64Array">
+ </return>
+ <argument index="0" name="from" type="PackedInt64Array">
+ </argument>
+ <description>
+ Constructs a [PackedInt64Array] as a copy of the given [PackedInt64Array].
+ </description>
+ </method>
+ <method name="PackedInt64Array" qualifiers="constructor">
<return type="PackedInt64Array">
</return>
<argument index="0" name="from" type="Array">
@@ -21,9 +37,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="integer" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -57,9 +73,9 @@
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="integer" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
@@ -72,10 +88,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedInt64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedInt64Array">
+ </return>
+ <argument index="0" name="right" type="PackedInt64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedInt64Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="integer" type="int">
+ <argument index="0" name="value" type="int">
</argument>
<description>
Appends a value to the array.
@@ -84,16 +132,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -102,9 +150,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="integer" type="int">
+ <argument index="1" name="value" type="int">
</argument>
<description>
Changes the integer at the given index.
@@ -124,6 +172,22 @@
Sorts the elements of the array in ascending order.
</description>
</method>
+ <method name="subarray">
+ <return type="PackedInt64Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml
index bb56330248..d15bcfd114 100644
--- a/doc/classes/PackedScene.xml
+++ b/doc/classes/PackedScene.xml
@@ -8,14 +8,23 @@
Can be used to save a node to a file. When saving, the node as well as all the node it owns get saved (see [code]owner[/code] property on [Node]).
[b]Note:[/b] The node doesn't need to own itself.
[b]Example of loading a saved scene:[/b]
- [codeblock]
- # Use `load()` instead of `preload()` if the path isn't known at compile-time.
+ [codeblocks]
+ [gdscript]
+ # Use load() instead of preload() if the path isn't known at compile-time.
var scene = preload("res://scene.tscn").instance()
# Add the node as a child of the node the script is attached to.
add_child(scene)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // C# has no preload, so you have to always use ResourceLoader.Load&lt;PackedScene&gt;().
+ var scene = ResourceLoader.Load&lt;PackedScene&gt;("res://scene.tscn").Instance();
+ // Add the node as a child of the node the script is attached to.
+ AddChild(scene);
+ [/csharp]
+ [/codeblocks]
[b]Example of saving a node with different owners:[/b] The following example creates 3 objects: [code]Node2D[/code] ([code]node[/code]), [code]RigidBody2D[/code] ([code]rigid[/code]) and [code]CollisionObject2D[/code] ([code]collision[/code]). [code]collision[/code] is a child of [code]rigid[/code] which is a child of [code]node[/code]. Only [code]rigid[/code] is owned by [code]node[/code] and [code]pack[/code] will therefore only save those two nodes, but not [code]collision[/code].
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Create the objects.
var node = Node2D.new()
var rigid = RigidBody2D.new()
@@ -27,17 +36,44 @@
# Change owner of `rigid`, but not of `collision`.
rigid.owner = node
-
var scene = PackedScene.new()
+
# Only `node` and `rigid` are now packed.
var result = scene.pack(node)
if result == OK:
- var error = ResourceSaver.save("res://path/name.scn", scene) # Or "user://..."
+ var error = ResourceSaver.save("res://path/name.tscn", scene) # Or "user://..."
if error != OK:
push_error("An error occurred while saving the scene to disk.")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ // Create the objects.
+ var node = new Node2D();
+ var rigid = new RigidBody2D();
+ var collision = new CollisionShape2D();
+
+ // Create the object hierarchy.
+ rigid.AddChild(collision);
+ node.AddChild(rigid);
+
+ // Change owner of `rigid`, but not of `collision`.
+ rigid.Owner = node;
+ var scene = new PackedScene();
+
+ // Only `node` and `rigid` are now packed.
+ Error result = scene.Pack(node);
+ if (result == Error.Ok)
+ {
+ Error error = ResourceSaver.Save("res://path/name.tscn", scene); // Or "user://..."
+ if (error != Error.Ok)
+ {
+ GD.PushError("An error occurred while saving the scene to disk.");
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
</tutorials>
<methods>
<method name="can_instance" qualifiers="const">
diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml
index f36af66d6d..c71f5ffa7e 100644
--- a/doc/classes/PackedStringArray.xml
+++ b/doc/classes/PackedStringArray.xml
@@ -8,9 +8,26 @@
[b]Note:[/b] This type is passed by value and not by reference.
</description>
<tutorials>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
- <method name="PackedStringArray">
+ <method name="PackedStringArray" qualifiers="constructor">
+ <return type="PackedStringArray">
+ </return>
+ <description>
+ Constructs an empty [PackedStringArray].
+ </description>
+ </method>
+ <method name="PackedStringArray" qualifiers="constructor">
+ <return type="PackedStringArray">
+ </return>
+ <argument index="0" name="from" type="PackedStringArray">
+ </argument>
+ <description>
+ Constructs a [PackedStringArray] as a copy of the given [PackedStringArray].
+ </description>
+ </method>
+ <method name="PackedStringArray" qualifiers="constructor">
<return type="PackedStringArray">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +37,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="string" type="String">
+ <argument index="0" name="value" type="String">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -56,9 +73,9 @@
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="string" type="String">
+ <argument index="1" name="value" type="String">
</argument>
<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]idx == size()[/code]).
@@ -71,10 +88,42 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedStringArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedStringArray">
+ </return>
+ <argument index="0" name="right" type="PackedStringArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedStringArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="String">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="string" type="String">
+ <argument index="0" name="value" type="String">
</argument>
<description>
Appends a string element at end of the array.
@@ -83,16 +132,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -101,9 +150,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="string" type="String">
+ <argument index="1" name="value" type="String">
</argument>
<description>
Changes the [String] at the given index.
@@ -123,6 +172,22 @@
Sorts the elements of the array in ascending order.
</description>
</method>
+ <method name="subarray">
+ <return type="PackedStringArray">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml
index ecc535e488..5f68d9256d 100644
--- a/doc/classes/PackedVector2Array.xml
+++ b/doc/classes/PackedVector2Array.xml
@@ -8,9 +8,26 @@
[b]Note:[/b] This type is passed by value and not by reference.
</description>
<tutorials>
+ <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link>
</tutorials>
<methods>
- <method name="PackedVector2Array">
+ <method name="PackedVector2Array" qualifiers="constructor">
+ <return type="PackedVector2Array">
+ </return>
+ <description>
+ Constructs an empty [PackedVector2Array].
+ </description>
+ </method>
+ <method name="PackedVector2Array" qualifiers="constructor">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="from" type="PackedVector2Array">
+ </argument>
+ <description>
+ Constructs a [PackedVector2Array] as a copy of the given [PackedVector2Array].
+ </description>
+ </method>
+ <method name="PackedVector2Array" qualifiers="constructor">
<return type="PackedVector2Array">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +37,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="vector2" type="Vector2">
+ <argument index="0" name="value" type="Vector2">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -56,9 +73,9 @@
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="vector2" type="Vector2">
+ <argument index="1" name="value" type="Vector2">
</argument>
<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]idx == size()[/code]).
@@ -71,10 +88,50 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedVector2Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="right" type="PackedVector2Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedVector2Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="vector2" type="Vector2">
+ <argument index="0" name="value" type="Vector2">
</argument>
<description>
Inserts a [Vector2] at the end.
@@ -83,16 +140,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -101,9 +158,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="vector2" type="Vector2">
+ <argument index="1" name="value" type="Vector2">
</argument>
<description>
Changes the [Vector2] at the given index.
@@ -123,6 +180,22 @@
Sorts the elements of the array in ascending order.
</description>
</method>
+ <method name="subarray">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml
index f268fbcc83..e681e1deb7 100644
--- a/doc/classes/PackedVector3Array.xml
+++ b/doc/classes/PackedVector3Array.xml
@@ -10,7 +10,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="PackedVector3Array">
+ <method name="PackedVector3Array" qualifiers="constructor">
+ <return type="PackedVector3Array">
+ </return>
+ <description>
+ Constructs an empty [PackedVector3Array].
+ </description>
+ </method>
+ <method name="PackedVector3Array" qualifiers="constructor">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="from" type="PackedVector3Array">
+ </argument>
+ <description>
+ Constructs a [PackedVector3Array] as a copy of the given [PackedVector3Array].
+ </description>
+ </method>
+ <method name="PackedVector3Array" qualifiers="constructor">
<return type="PackedVector3Array">
</return>
<argument index="0" name="from" type="Array">
@@ -20,9 +36,9 @@
</description>
</method>
<method name="append">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="vector3" type="Vector3">
+ <argument index="0" name="value" type="Vector3">
</argument>
<description>
Appends an element at the end of the array (alias of [method push_back]).
@@ -56,9 +72,9 @@
<method name="insert">
<return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="at_index" type="int">
</argument>
- <argument index="1" name="vector3" type="Vector3">
+ <argument index="1" name="value" type="Vector3">
</argument>
<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]idx == size()[/code]).
@@ -71,10 +87,50 @@
Reverses the order of the elements in the array.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedVector3Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="right" type="PackedVector3Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="PackedVector3Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="push_back">
- <return type="void">
+ <return type="bool">
</return>
- <argument index="0" name="vector3" type="Vector3">
+ <argument index="0" name="value" type="Vector3">
</argument>
<description>
Inserts a [Vector3] at the end.
@@ -83,16 +139,16 @@
<method name="remove">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
<description>
Removes an element from the array by index.
</description>
</method>
<method name="resize">
- <return type="void">
+ <return type="int">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="new_size" type="int">
</argument>
<description>
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
@@ -101,9 +157,9 @@
<method name="set">
<return type="void">
</return>
- <argument index="0" name="idx" type="int">
+ <argument index="0" name="index" type="int">
</argument>
- <argument index="1" name="vector3" type="Vector3">
+ <argument index="1" name="value" type="Vector3">
</argument>
<description>
Changes the [Vector3] at the given index.
@@ -123,6 +179,22 @@
Sorts the elements of the array in ascending order.
</description>
</method>
+ <method name="subarray">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="to_byte_array">
+ <return type="PackedByteArray">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml
index 668655b725..d7cf6cc8c6 100644
--- a/doc/classes/PacketPeerUDP.xml
+++ b/doc/classes/PacketPeerUDP.xml
@@ -25,7 +25,7 @@
</argument>
<description>
Calling this method connects this UDP peer to the given [code]host[/code]/[code]port[/code] pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to [method set_dest_address] are not allowed). This method does not send any data to the remote peer, to do that, use [method PacketPeer.put_var] or [method PacketPeer.put_packet] as usual. See also [UDPServer].
- Note: Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information.
+ [b]Note:[/b] Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information.
</description>
</method>
<method name="get_packet_ip" qualifiers="const">
@@ -123,6 +123,37 @@
</return>
<description>
Waits for a packet to arrive on the listening port. See [method listen].
+ [b]Note:[/b] [method wait] can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this:
+ [codeblocks]
+ [gdscript]
+ socket = PacketPeerUDP.new()
+ # Server
+ socket.set_dest_address("127.0.0.1", 789)
+ socket.put_packet("Time to stop".to_ascii())
+
+ # Client
+ while socket.wait() == OK:
+ var data = socket.get_packet().get_string_from_ascii()
+ if data == "Time to stop":
+ return
+ [/gdscript]
+ [csharp]
+ var socket = new PacketPeerUDP();
+ // Server
+ socket.SetDestAddress("127.0.0.1", 789);
+ socket.PutPacket("Time To Stop".ToAscii());
+
+ // Client
+ while (socket.Wait() == OK)
+ {
+ string data = socket.GetPacket().GetStringFromASCII();
+ if (data == "Time to stop")
+ {
+ return;
+ }
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/Panel.xml b/doc/classes/Panel.xml
index 7285bc9e2e..b65c2c956d 100644
--- a/doc/classes/Panel.xml
+++ b/doc/classes/Panel.xml
@@ -7,6 +7,9 @@
Panel is a [Control] that displays an opaque background. It's commonly used as a parent and container for other types of [Control] nodes.
</description>
<tutorials>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
+ <link title="2D Finite State Machine Demo">https://godotengine.org/asset-library/asset/516</link>
+ <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/PanelContainer.xml b/doc/classes/PanelContainer.xml
index d39122c395..ad6080c780 100644
--- a/doc/classes/PanelContainer.xml
+++ b/doc/classes/PanelContainer.xml
@@ -7,6 +7,7 @@
Panel container type. This container fits controls inside of the delimited area of a stylebox. It's useful for giving controls an outline.
</description>
<tutorials>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml
index f6fa3cf38b..85058cb9d4 100644
--- a/doc/classes/ParticlesMaterial.xml
+++ b/doc/classes/ParticlesMaterial.xml
@@ -11,15 +11,6 @@
<tutorials>
</tutorials>
<methods>
- <method name="get_flag" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="flag" type="int" enum="ParticlesMaterial.Flags">
- </argument>
- <description>
- Returns [code]true[/code] if the specified flag is enabled.
- </description>
- </method>
<method name="get_param" qualifiers="const">
<return type="float">
</return>
@@ -47,15 +38,13 @@
Returns the [Texture2D] used by the specified parameter.
</description>
</method>
- <method name="set_flag">
- <return type="void">
+ <method name="get_particle_flag" qualifiers="const">
+ <return type="bool">
</return>
- <argument index="0" name="flag" type="int" enum="ParticlesMaterial.Flags">
- </argument>
- <argument index="1" name="enable" type="bool">
+ <argument index="0" name="particle_flag" type="int" enum="ParticlesMaterial.ParticleFlags">
</argument>
<description>
- If [code]true[/code], enables the specified flag. See [enum Flags] for options.
+ Returns [code]true[/code] if the specified particle flag is enabled. See [enum ParticleFlags] for options.
</description>
</method>
<method name="set_param">
@@ -91,11 +80,22 @@
Sets the [Texture2D] for the specified [enum Parameter].
</description>
</method>
+ <method name="set_particle_flag">
+ <return type="void">
+ </return>
+ <argument index="0" name="particle_flag" type="int" enum="ParticlesMaterial.ParticleFlags">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ If [code]true[/code], enables the specified particle flag. See [enum ParticleFlags] for options.
+ </description>
+ </method>
</methods>
<members>
<member name="angle" type="float" setter="set_param" getter="get_param" default="0.0">
Initial rotation applied to each particle, in degrees.
- Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES].
+ Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are [code]true[/code] or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES].
</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].
@@ -105,7 +105,7 @@
</member>
<member name="angular_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.
- Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES].
+ Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are [code]true[/code] or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES].
</member>
<member name="angular_velocity_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's angular velocity will vary along this [CurveTexture].
@@ -131,6 +131,16 @@
<member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
Animation speed randomness ratio.
</member>
+ <member name="attractor_interaction_enabled" type="bool" setter="set_attractor_interaction_enabled" getter="is_attractor_interaction_enabled" default="true">
+ </member>
+ <member name="collision_bounce" type="float" setter="set_collision_bounce" getter="get_collision_bounce" default="0.0">
+ </member>
+ <member name="collision_enabled" type="bool" setter="set_collision_enabled" getter="is_collision_enabled" default="true">
+ </member>
+ <member name="collision_friction" type="float" setter="set_collision_friction" getter="get_collision_friction" default="0.0">
+ </member>
+ <member name="collision_use_scale" type="bool" setter="set_collision_use_scale" getter="is_collision_using_scale" default="false">
+ </member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
Each particle's initial color. If the [GPUParticles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [BaseMaterial3D] make sure to set [member BaseMaterial3D.vertex_color_use_as_albedo] to [code]true[/code].
</member>
@@ -170,15 +180,6 @@
<member name="emission_sphere_radius" type="float" setter="set_emission_sphere_radius" getter="get_emission_sphere_radius">
The sphere's radius if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_SPHERE].
</member>
- <member name="flag_align_y" type="bool" setter="set_flag" getter="get_flag" default="false">
- Align Y axis of particle with the direction of its velocity.
- </member>
- <member name="flag_disable_z" type="bool" setter="set_flag" getter="get_flag" default="false">
- If [code]true[/code], particles will not move on the z axis.
- </member>
- <member name="flag_rotate_y" type="bool" setter="set_flag" getter="get_flag" default="false">
- If [code]true[/code], particles rotate around Y axis by [member angle].
- </member>
<member name="flatness" type="float" setter="set_flatness" getter="get_flatness" default="0.0">
Amount of [member spread] in Y/Z plane. A value of [code]1[/code] restricts particles to X/Z plane.
</member>
@@ -214,7 +215,7 @@
</member>
<member name="orbit_velocity" type="float" setter="set_param" getter="get_param">
Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.
- Only available when [member flag_disable_z] is [code]true[/code].
+ Only available when [member particle_flag_disable_z] is [code]true[/code].
</member>
<member name="orbit_velocity_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's orbital velocity will vary along this [CurveTexture].
@@ -222,6 +223,15 @@
<member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
Orbital velocity randomness ratio.
</member>
+ <member name="particle_flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
+ Align Y axis of particle with the direction of its velocity.
+ </member>
+ <member name="particle_flag_disable_z" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
+ If [code]true[/code], particles will not move on the z axis.
+ </member>
+ <member name="particle_flag_rotate_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
+ If [code]true[/code], particles rotate around Y axis by [member angle].
+ </member>
<member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0">
Radial acceleration applied to each particle. Makes particle accelerate away from origin.
</member>
@@ -301,17 +311,17 @@
<constant name="PARAM_MAX" value="12" enum="Parameter">
Represents the size of the [enum Parameter] enum.
</constant>
- <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags">
- Use with [method set_flag] to set [member flag_align_y].
+ <constant name="PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="ParticleFlags">
+ Use with [method set_particle_flag] to set [member particle_flag_align_y].
</constant>
- <constant name="FLAG_ROTATE_Y" value="1" enum="Flags">
- Use with [method set_flag] to set [member flag_rotate_y].
+ <constant name="PARTICLE_FLAG_ROTATE_Y" value="1" enum="ParticleFlags">
+ Use with [method set_particle_flag] to set [member particle_flag_rotate_y].
</constant>
- <constant name="FLAG_DISABLE_Z" value="2" enum="Flags">
- Use with [method set_flag] to set [member flag_disable_z].
+ <constant name="PARTICLE_FLAG_DISABLE_Z" value="2" enum="ParticleFlags">
+ Use with [method set_particle_flag] to set [member particle_flag_disable_z].
</constant>
- <constant name="FLAG_MAX" value="3" enum="Flags">
- Represents the size of the [enum Flags] enum.
+ <constant name="PARTICLE_FLAG_MAX" value="3" enum="ParticleFlags">
+ Represents the size of the [enum ParticleFlags] enum.
</constant>
<constant name="EMISSION_SHAPE_POINT" value="0" enum="EmissionShape">
All particles will be emitted from a single point.
diff --git a/doc/classes/PathFollow2D.xml b/doc/classes/PathFollow2D.xml
index bbaeca12da..4b55e7b781 100644
--- a/doc/classes/PathFollow2D.xml
+++ b/doc/classes/PathFollow2D.xml
@@ -29,8 +29,8 @@
<member name="offset" type="float" setter="set_offset" getter="get_offset" default="0.0">
The distance along the path in pixels.
</member>
- <member name="rotate" type="bool" setter="set_rotate" getter="is_rotating" default="true">
- If [code]true[/code], this node rotates to follow the path, making its descendants rotate.
+ <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.
</member>
<member name="unit_offset" type="float" setter="set_unit_offset" getter="get_unit_offset" 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 offset within the path, as the offset supplied is multiplied internally by the path's length.
diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml
index 0a9079ce71..9e9c5063ae 100644
--- a/doc/classes/Performance.xml
+++ b/doc/classes/Performance.xml
@@ -24,14 +24,53 @@
</argument>
<description>
Adds a custom monitor with name same as id. You can specify the category of monitor using '/' in id. If there are more than one '/' then default category is used. Default category is "Custom".
- [codeblock]
- Performance.add_custom_monitor("MyCategory/MyMonitor", some_callable) # Adds monitor with name "MyName" to category "MyCategory"
- Performance.add_custom_monitor("MyMonitor", some_callable) # Adds monitor with name "MyName" to category "Custom"
- # Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different ids so above code is valid
- Performance.add_custom_monitor("Custom/MyMonitor", some_callable) # Adds monitor with name "MyName" to category "Custom"
- # Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different ids so above code is valid
- Performance.add_custom_monitor("MyCategoryOne/MyCategoryTwo/MyMonitor", some_callable) # Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom"
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ func _ready():
+ var monitor_value = Callable(self, "get_monitor_value")
+
+ # Adds monitor with name "MyName" to category "MyCategory".
+ Performance.add_custom_monitor("MyCategory/MyMonitor", monitor_value)
+
+ # Adds monitor with name "MyName" to category "Custom".
+ # Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different ids so the code is valid.
+ Performance.add_custom_monitor("MyMonitor", monitor_value)
+
+ # Adds monitor with name "MyName" to category "Custom".
+ # Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different ids so the code is valid.
+ Performance.add_custom_monitor("Custom/MyMonitor", monitor_value)
+
+ # Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom".
+ Performance.add_custom_monitor("MyCategoryOne/MyCategoryTwo/MyMonitor", monitor_value)
+
+ func get_monitor_value():
+ return randi() % 25
+ [/gdscript]
+ [csharp]
+ public override void _Ready()
+ {
+ var monitorValue = new Callable(this, nameof(GetMonitorValue));
+
+ // Adds monitor with name "MyName" to category "MyCategory".
+ Performance.AddCustomMonitor("MyCategory/MyMonitor", monitorValue);
+ // Adds monitor with name "MyName" to category "Custom".
+ // Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different ids so the code is valid.
+ Performance.AddCustomMonitor("MyMonitor", monitorValue);
+
+ // Adds monitor with name "MyName" to category "Custom".
+ // Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different ids so the code is valid.
+ Performance.AddCustomMonitor("Custom/MyMonitor", monitorValue);
+
+ // Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom".
+ Performance.AddCustomMonitor("MyCategoryOne/MyCategoryTwo/MyMonitor", monitorValue);
+ }
+
+ public int GetMonitorValue()
+ {
+ return GD.Randi() % 25;
+ }
+ [/csharp]
+ [/codeblocks]
The debugger calls the callable to get the value of custom monitor. The callable must return a number.
Callables are called with arguments supplied in argument array.
[b]Note:[/b] It throws an error if given id is already present.
@@ -61,9 +100,14 @@
</argument>
<description>
Returns the value of one of the available monitors. You should provide one of the [enum Monitor] constants as the argument, like this:
- [codeblock]
- print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console
- [/codeblock]
+ [codeblocks]
+ [gdscript]
+ print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console.
+ [/gdscript]
+ [csharp]
+ GD.Print(Performance.GetMonitor(Performance.Monitor.TimeFps)); // Prints the FPS to the console.
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_monitor_modification_time">
diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml
index 0808e4a724..dcf24c1d32 100644
--- a/doc/classes/PhysicalBone3D.xml
+++ b/doc/classes/PhysicalBone3D.xml
@@ -117,9 +117,6 @@
<member name="mass" type="float" setter="set_mass" getter="get_mass" default="1.0">
The body's mass.
</member>
- <member name="weight" type="float" setter="set_weight" getter="get_weight" default="9.8">
- The body's weight based on its mass and the global 3D gravity. Global values are set in [b]Project &gt; Project Settings &gt; Physics &gt; 3d[/b].
- </member>
</members>
<constants>
<constant name="JOINT_TYPE_NONE" value="0" enum="JointType">
diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml
index ca42f5801a..9c3c47afba 100644
--- a/doc/classes/PhysicsBody2D.xml
+++ b/doc/classes/PhysicsBody2D.xml
@@ -86,9 +86,6 @@
The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable" override="true" default="false" />
- <member name="layers" type="int" setter="_set_layers" getter="_get_layers">
- Both [member collision_layer] and [member collision_mask]. Returns [member collision_layer] when accessed. Updates [member collision_layer] and [member collision_mask] when modified.
- </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/PhysicsDirectSpaceState2D.xml b/doc/classes/PhysicsDirectSpaceState2D.xml
index 676e33601a..c26cf0514c 100644
--- a/doc/classes/PhysicsDirectSpaceState2D.xml
+++ b/doc/classes/PhysicsDirectSpaceState2D.xml
@@ -64,13 +64,14 @@
<argument index="5" name="collide_with_areas" type="bool" default="false">
</argument>
<description>
- Checks whether a point is inside any shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields:
+ Checks whether a point is inside any solid shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields:
[code]collider[/code]: The colliding object.
[code]collider_id[/code]: The colliding object's ID.
[code]metadata[/code]: The intersecting shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data].
[code]rid[/code]: The intersecting object's [RID].
[code]shape[/code]: The shape index of the colliding shape.
Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with [PhysicsBody2D]s or [Area2D]s, respectively.
+ [b]Note:[/b] [ConcavePolygonShape2D]s and [CollisionPolygon2D]s in [code]Segments[/code] build mode are not solid shapes. Therefore, they will not be detected.
</description>
</method>
<method name="intersect_point_on_canvas">
diff --git a/doc/classes/PhysicsShapeQueryParameters2D.xml b/doc/classes/PhysicsShapeQueryParameters2D.xml
index 93ca684b95..4d7fc61517 100644
--- a/doc/classes/PhysicsShapeQueryParameters2D.xml
+++ b/doc/classes/PhysicsShapeQueryParameters2D.xml
@@ -34,19 +34,34 @@
</member>
<member name="shape_rid" type="RID" setter="set_shape_rid" getter="get_shape_rid">
The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API:
- [codeblock]
- var shape_rid = PhysicsServer2D.circle_shape_create()
- var radius = 64
- PhysicsServer2D.shape_set_data(shape_rid, radius)
+ [codeblocks]
+ [gdscript]
+ var shape_rid = PhysicsServer2D.circle_shape_create()
+ var radius = 64
+ PhysicsServer2D.shape_set_data(shape_rid, radius)
- var params = PhysicsShapeQueryParameters2D.new()
- params.shape_rid = shape_rid
+ var params = PhysicsShapeQueryParameters2D.new()
+ params.shape_rid = shape_rid
- # Execute physics queries here...
+ # Execute physics queries here...
- # Release the shape when done with physics queries.
- PhysicsServer2D.free_rid(shape_rid)
- [/codeblock]
+ # Release the shape when done with physics queries.
+ PhysicsServer2D.free_rid(shape_rid)
+ [/gdscript]
+ [csharp]
+ RID shapeRid = PhysicsServer2D.CircleShapeCreate();
+ int radius = 64;
+ PhysicsServer2D.ShapeSetData(shapeRid, radius);
+
+ var params = new PhysicsShapeQueryParameters2D();
+ params.ShapeRid = shapeRid;
+
+ // Execute physics queries here...
+
+ // Release the shape when done with physics queries.
+ PhysicsServer2D.FreeRid(shapeRid);
+ [/csharp]
+ [/codeblocks]
</member>
<member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
The queried shape's transform matrix.
diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml
index 167fb31bb3..4b43ea66fc 100644
--- a/doc/classes/PhysicsShapeQueryParameters3D.xml
+++ b/doc/classes/PhysicsShapeQueryParameters3D.xml
@@ -31,19 +31,34 @@
</member>
<member name="shape_rid" type="RID" setter="set_shape_rid" getter="get_shape_rid">
The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API:
- [codeblock]
- var shape_rid = PhysicsServer3D.shape_create(PhysicsServer3D.SHAPE_SPHERE)
- var radius = 2.0
- PhysicsServer3D.shape_set_data(shape_rid, radius)
+ [codeblocks]
+ [gdscript]
+ var shape_rid = PhysicsServer3D.shape_create(PhysicsServer3D.SHAPE_SPHERE)
+ var radius = 2.0
+ PhysicsServer3D.shape_set_data(shape_rid, radius)
- var params = PhysicsShapeQueryParameters3D.new()
- params.shape_rid = shape_rid
+ var params = PhysicsShapeQueryParameters3D.new()
+ params.shape_rid = shape_rid
- # Execute physics queries here...
+ # Execute physics queries here...
- # Release the shape when done with physics queries.
- PhysicsServer3D.free_rid(shape_rid)
- [/codeblock]
+ # Release the shape when done with physics queries.
+ PhysicsServer3D.free_rid(shape_rid)
+ [/gdscript]
+ [csharp]
+ RID shapeRid = PhysicsServer3D.ShapeCreate(PhysicsServer3D.ShapeType.Sphere);
+ float radius = 2.0f;
+ PhysicsServer3D.ShapeSetData(shapeRid, radius);
+
+ var params = new PhysicsShapeQueryParameters3D();
+ params.ShapeRid = shapeRid;
+
+ // Execute physics queries here...
+
+ // Release the shape when done with physics queries.
+ PhysicsServer3D.FreeRid(shapeRid);
+ [/csharp]
+ [/codeblocks]
</member>
<member name="transform" type="Transform" setter="set_transform" getter="get_transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
The queried shape's transform matrix.
diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml
index d420e6ccdc..e3242512c4 100644
--- a/doc/classes/Plane.xml
+++ b/doc/classes/Plane.xml
@@ -10,7 +10,23 @@
<link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
</tutorials>
<methods>
- <method name="Plane">
+ <method name="Plane" qualifiers="constructor">
+ <return type="Plane">
+ </return>
+ <description>
+ Constructs a default-initialized [Plane] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Plane" qualifiers="constructor">
+ <return type="Plane">
+ </return>
+ <argument index="0" name="from" type="Plane">
+ </argument>
+ <description>
+ Constructs a [Plane] as a copy of the given [Plane].
+ </description>
+ </method>
+ <method name="Plane" qualifiers="constructor">
<return type="Plane">
</return>
<argument index="0" name="a" type="float">
@@ -25,28 +41,39 @@
Creates a plane from the four parameters. The three components of the resulting plane's [member normal] are [code]a[/code], [code]b[/code] and [code]c[/code], and the plane has a distance of [code]d[/code] from the origin.
</description>
</method>
- <method name="Plane">
+ <method name="Plane" qualifiers="constructor">
<return type="Plane">
</return>
- <argument index="0" name="v1" type="Vector3">
+ <argument index="0" name="normal" type="Vector3">
</argument>
- <argument index="1" name="v2" type="Vector3">
+ <argument index="1" name="d" type="float">
</argument>
- <argument index="2" name="v3" type="Vector3">
+ <description>
+ Creates a plane from the normal and the plane's distance to the origin.
+ </description>
+ </method>
+ <method name="Plane" qualifiers="constructor">
+ <return type="Plane">
+ </return>
+ <argument index="0" name="point" type="Vector3">
+ </argument>
+ <argument index="1" name="normal" type="Vector3">
</argument>
<description>
- Creates a plane from the three points, given in clockwise order.
+ Creates a plane from the given position and a plane normal.
</description>
</method>
- <method name="Plane">
+ <method name="Plane" qualifiers="constructor">
<return type="Plane">
</return>
- <argument index="0" name="normal" type="Vector3">
+ <argument index="0" name="point1" type="Vector3">
</argument>
- <argument index="1" name="d" type="float">
+ <argument index="1" name="point2" type="Vector3">
+ </argument>
+ <argument index="2" name="point3" type="Vector3">
</argument>
<description>
- Creates a plane from the normal and the plane's distance to the origin.
+ Creates a plane from the three points, given in clockwise order.
</description>
</method>
<method name="center">
@@ -77,7 +104,7 @@
</description>
</method>
<method name="intersect_3">
- <return type="Vector3">
+ <return type="Variant">
</return>
<argument index="0" name="b" type="Plane">
</argument>
@@ -88,7 +115,7 @@
</description>
</method>
<method name="intersects_ray">
- <return type="Vector3">
+ <return type="Variant">
</return>
<argument index="0" name="from" type="Vector3">
</argument>
@@ -99,11 +126,11 @@
</description>
</method>
<method name="intersects_segment">
- <return type="Vector3">
+ <return type="Variant">
</return>
- <argument index="0" name="begin" type="Vector3">
+ <argument index="0" name="from" type="Vector3">
</argument>
- <argument index="1" name="end" type="Vector3">
+ <argument index="1" name="to" type="Vector3">
</argument>
<description>
Returns the intersection point of a segment from position [code]begin[/code] to position [code]end[/code] with this plane. If no intersection is found, [code]null[/code] is returned.
@@ -112,7 +139,7 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="plane" type="Plane">
+ <argument index="0" name="to_plane" type="Plane">
</argument>
<description>
Returns [code]true[/code] if this plane and [code]plane[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
@@ -121,7 +148,7 @@
<method name="is_point_over">
<return type="bool">
</return>
- <argument index="0" name="point" type="Vector3">
+ <argument index="0" name="plane" type="Vector3">
</argument>
<description>
Returns [code]true[/code] if [code]point[/code] is located above the plane.
@@ -134,6 +161,34 @@
Returns a copy of the plane, normalized.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Plane">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Plane">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Plane">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Plane">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="project">
<return type="Vector3">
</return>
diff --git a/doc/classes/PointLight2D.xml b/doc/classes/PointLight2D.xml
new file mode 100644
index 0000000000..9337bc8351
--- /dev/null
+++ b/doc/classes/PointLight2D.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="PointLight2D" inherits="Light2D" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="height" type="float" setter="set_height" getter="get_height" default="0.0">
+ The height of the light. Used with 2D normal mapping.
+ </member>
+ <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )">
+ The offset of the light's [member texture].
+ </member>
+ <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
+ [Texture2D] used for the light's appearance.
+ </member>
+ <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale" default="1.0">
+ The [member texture]'s scale factor.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml
index 335df1ac3f..3aca83658d 100644
--- a/doc/classes/Polygon2D.xml
+++ b/doc/classes/Polygon2D.xml
@@ -101,10 +101,6 @@
<member name="invert_enable" type="bool" setter="set_invert" getter="get_invert" default="false">
If [code]true[/code], polygon will be inverted, containing the area outside the defined points and extending to the [code]invert_border[/code].
</member>
- <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
- The normal map gives depth to the Polygon2D.
- [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
- </member>
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
The offset applied to each vertex.
</member>
@@ -114,14 +110,8 @@
</member>
<member name="polygons" type="Array" setter="set_polygons" getter="get_polygons" default="[ ]">
</member>
- <member name="shininess" type="float" setter="set_shininess" getter="get_shininess" default="1.0">
- </member>
<member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath(&quot;&quot;)">
</member>
- <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )">
- </member>
- <member name="specular_map" type="Texture2D" setter="set_specular_map" getter="get_specular_map">
- </member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
The polygon's fill texture. Use [code]uv[/code] to set texture coordinates.
</member>
diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml
index 6f77f3371d..b8d8a55412 100644
--- a/doc/classes/Popup.xml
+++ b/doc/classes/Popup.xml
@@ -12,6 +12,8 @@
</methods>
<members>
<member name="borderless" type="bool" setter="set_flag" getter="get_flag" override="true" default="true" />
+ <member name="close_on_parent_focus" type="bool" setter="set_close_on_parent_focus" getter="get_close_on_parent_focus" default="true">
+ </member>
<member name="transient" type="bool" setter="set_transient" getter="is_transient" override="true" default="true" />
<member name="unresizable" type="bool" setter="set_flag" getter="get_flag" override="true" default="true" />
<member name="visible" type="bool" setter="set_visible" getter="is_visible" override="true" default="false" />
diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml
index b1ec9a222a..04798c04e9 100644
--- a/doc/classes/PopupMenu.xml
+++ b/doc/classes/PopupMenu.xml
@@ -207,6 +207,7 @@
</argument>
<description>
Adds a separator between items. Separators also occupy an index.
+ A [code]label[/code] can optionally be provided, which will appear at the center of the separator.
</description>
</method>
<method name="add_shortcut">
@@ -244,6 +245,15 @@
Removes all items from the [PopupMenu].
</description>
</method>
+ <method name="clear_item_opentype_features">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Removes all OpenType features form the item's text.
+ </description>
+ </method>
<method name="get_current_index" qualifiers="const">
<return type="int">
</return>
@@ -293,6 +303,15 @@
Returns the index of the item containing the specified [code]id[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually.
</description>
</method>
+ <method name="get_item_language" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Returns item's text language code.
+ </description>
+ </method>
<method name="get_item_metadata" qualifiers="const">
<return type="Variant">
</return>
@@ -302,6 +321,17 @@
Returns the metadata of the specified item, which might be of any type. You can set it with [method set_item_metadata], which provides a simple way of assigning context data to items.
</description>
</method>
+ <method name="get_item_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code] of the item's text.
+ </description>
+ </method>
<method name="get_item_shortcut" qualifiers="const">
<return type="Shortcut">
</return>
@@ -329,6 +359,15 @@
Returns the text of the item at index [code]idx[/code].
</description>
</method>
+ <method name="get_item_text_direction" qualifiers="const">
+ <return type="int" enum="Control.TextDirection">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Returns item's text base writing direction.
+ </description>
+ </method>
<method name="get_item_tooltip" qualifiers="const">
<return type="String">
</return>
@@ -494,6 +533,17 @@
Sets the [code]id[/code] of the item at index [code]idx[/code].
</description>
</method>
+ <method name="set_item_language">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="language" type="String">
+ </argument>
+ <description>
+ Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+ </description>
+ </method>
<method name="set_item_metadata">
<return type="void">
</return>
@@ -516,6 +566,19 @@
Sets the state of an multistate item. See [method add_multistate_item] for details.
</description>
</method>
+ <method name="set_item_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <argument index="2" name="value" type="int">
+ </argument>
+ <description>
+ Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+ </description>
+ </method>
<method name="set_item_shortcut">
<return type="void">
</return>
@@ -562,6 +625,17 @@
Sets the text of the item at index [code]idx[/code].
</description>
</method>
+ <method name="set_item_text_direction">
+ <return type="void">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <argument index="1" name="direction" type="int" enum="Control.TextDirection">
+ </argument>
+ <description>
+ Sets item's text base writing direction.
+ </description>
+ </method>
<method name="set_item_tooltip">
<return type="void">
</return>
@@ -653,6 +727,12 @@
<theme_item name="font_color_hover" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
[Color] used for the hovered text.
</theme_item>
+ <theme_item name="font_color_separator" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
+ [Color] used for labeled separators' text. See [method add_separator].
+ </theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the menu items.
+ </theme_item>
<theme_item name="hover" type="StyleBox">
[StyleBox] displayed when the [PopupMenu] item is hovered.
</theme_item>
@@ -681,7 +761,10 @@
[StyleBox] used for the separators. See [method add_separator].
</theme_item>
<theme_item name="submenu" type="Texture2D">
- [Texture2D] icon for the submenu arrow.
+ [Texture2D] icon for the submenu arrow (for left-to-right layouts).
+ </theme_item>
+ <theme_item name="submenu_mirrored" type="Texture2D">
+ [Texture2D] icon for the submenu arrow (for right-to-left layouts).
</theme_item>
<theme_item name="unchecked" type="Texture2D">
[Texture2D] icon for the unchecked checkbox items.
diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml
index 9e7f26ed4f..25943f6d47 100644
--- a/doc/classes/PrimitiveMesh.xml
+++ b/doc/classes/PrimitiveMesh.xml
@@ -4,7 +4,7 @@
Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh.
</brief_description>
<description>
- Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. Examples include [CapsuleMesh], [CubeMesh], [CylinderMesh], [PlaneMesh], [PrismMesh], [QuadMesh], and [SphereMesh].
+ Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. Examples include [BoxMesh], [CapsuleMesh], [CylinderMesh], [PlaneMesh], [PrismMesh], [QuadMesh], and [SphereMesh].
</description>
<tutorials>
</tutorials>
@@ -14,11 +14,18 @@
</return>
<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:
- [codeblock]
- var c := CylinderMesh.new()
- var arr_mesh := ArrayMesh.new()
+ [codeblocks]
+ [gdscript]
+ var c = CylinderMesh.new()
+ var arr_mesh = ArrayMesh.new()
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays())
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ var c = new CylinderMesh();
+ var arrMesh = new ArrayMesh();
+ arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, c.GetMeshArrays());
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml
index c957d6f182..c05cbf4413 100644
--- a/doc/classes/ProgressBar.xml
+++ b/doc/classes/ProgressBar.xml
@@ -35,5 +35,8 @@
<theme_item name="font_color_shadow" type="Color" default="Color( 0, 0, 0, 1 )">
The color of the text's shadow.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size used to draw the fill percentage if [member percent_visible] is [code]true[/code].
+ </theme_item>
</theme_items>
</class>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index ed8eddda07..d0f2a927cb 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -9,6 +9,9 @@
[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.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
<method name="add_property_info">
@@ -22,7 +25,8 @@
- [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]
- [codeblock]
+ [codeblocks]
+ [gdscript]
ProjectSettings.set("category/property_name", 0)
var property_info = {
@@ -33,7 +37,21 @@
}
ProjectSettings.add_property_info(property_info)
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ ProjectSettings.Singleton.Set("category/property_name", 0);
+
+ var propertyInfo = new Godot.Collections.Dictionary
+ {
+ {"name", "category/propertyName"},
+ {"type", Variant.Type.Int},
+ {"hint", PropertyHint.Enum},
+ {"hint_string", "one,two,three"},
+ };
+
+ ProjectSettings.AddPropertyInfo(propertyInfo);
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="clear">
@@ -62,9 +80,14 @@
<description>
Returns the value of a setting.
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
print(ProjectSettings.get_setting("application/config/name"))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ GD.Print(ProjectSettings.GetSetting("application/config/name"));
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="globalize_path" qualifiers="const">
@@ -73,7 +96,21 @@
<argument index="0" name="path" type="String">
</argument>
<description>
- Converts a localized path ([code]res://[/code]) to a full native OS path.
+ Returns the absolute, native OS path corresponding to the localized [code]path[/code] (starting with [code]res://[/code] or [code]user://[/code]). The returned path will vary depending on the operating system and user preferences. See [url=https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html]File paths in Godot projects[/url] to see what those paths convert to. See also [method localize_path].
+ [b]Note:[/b] [method globalize_path] with [code]res://[/code] will not work in an exported project. Instead, prepend the executable's base directory to the path when running from an exported project:
+ [codeblock]
+ var path = ""
+ if OS.has_feature("editor"):
+ # Running from an editor binary.
+ # `path` will contain the absolute path to `hello.txt` located in the project root.
+ path = ProjectSettings.globalize_path("res://hello.txt")
+ else:
+ # Running from an exported project.
+ # `path` will contain the absolute path to `hello.txt` next to the executable.
+ # This is *not* identical to using `ProjectSettings.globalize_path()` with a `res://` path,
+ # but is close enough in spirit.
+ path = OS.get_executable_path().get_base_dir().plus_file("hello.txt")
+ [/codeblock]
</description>
</method>
<method name="has_setting" qualifiers="const">
@@ -106,7 +143,7 @@
<argument index="0" name="path" type="String">
</argument>
<description>
- Convert a path to a localized path ([code]res://[/code] path).
+ Returns the localized path (starting with [code]res://[/code]) corresponding to the absolute, native OS [code]path[/code]. See also [method globalize_path].
</description>
</method>
<method name="property_can_revert">
@@ -175,9 +212,14 @@
<description>
Sets the value of a setting.
[b]Example:[/b]
- [codeblock]
+ [codeblocks]
+ [gdscript]
ProjectSettings.set_setting("application/config/name", "Example")
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ ProjectSettings.SetSetting("application/config/name", "Example");
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>
@@ -227,6 +269,14 @@
<member name="application/run/disable_stdout" type="bool" setter="" getter="" default="false">
If [code]true[/code], disables printing to standard output in an exported build.
</member>
+ <member name="application/run/flush_stdout_on_print" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], flushes the standard output stream every time a line is printed. This affects both terminal logging and file logging.
+ When running a project, this setting must be enabled if you want logs to be collected by service managers such as systemd/journalctl. This setting is disabled by default on release builds, since flushing on every printed line will negatively affect performance if lots of lines are printed in a rapid succession. Also, if this setting is enabled, logged files will still be written successfully if the application crashes or is otherwise killed by the user (without being closed "normally").
+ [b]Note:[/b] Regardless of this setting, the standard error stream ([code]stderr[/code]) is always flushed when a line is printed to it.
+ </member>
+ <member name="application/run/flush_stdout_on_print.debug" type="bool" setter="" getter="" default="true">
+ Debug build override for [member application/run/flush_stdout_on_print], as performance is less important during debugging.
+ </member>
<member name="application/run/frame_delay_msec" type="int" setter="" getter="" default="0">
Forces a delay between frames in the main loop (in milliseconds). This may be useful if you plan to disable vertical synchronization.
</member>
@@ -425,6 +475,9 @@
<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/force_right_to_left_layout_direction" type="bool" setter="" getter="" default="false">
+ Force layout direction and text writing direction to RTL for all locales.
+ </member>
<member name="display/window/handheld/orientation" type="String" setter="" getter="" default="&quot;landscape&quot;">
Default orientation on mobile devices.
</member>
@@ -432,19 +485,24 @@
If [code]true[/code], the home indicator is hidden automatically. This only affects iOS devices without a physical home button.
</member>
<member name="display/window/size/always_on_top" type="bool" setter="" getter="" default="false">
- Force the window to be always on top.
+ Forces the main window to be always on top.
+ [b]Note:[/b] This setting is ignored on iOS, Android, and HTML5.
</member>
<member name="display/window/size/borderless" type="bool" setter="" getter="" default="false">
- Force the window to be borderless.
+ Forces the main window to be borderless.
+ [b]Note:[/b] This setting is ignored on iOS, Android, and HTML5.
</member>
<member name="display/window/size/fullscreen" type="bool" setter="" getter="" default="false">
- Sets the window to full screen when it starts.
+ Sets the main window to full screen when the project starts. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
+ Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
+ [b]Note:[/b] This setting is ignored on iOS, Android, and HTML5.
</member>
<member name="display/window/size/height" type="int" setter="" getter="" default="600">
Sets the game's main viewport height. On desktop platforms, this is the default window size. Stretch mode settings also use this as a reference when enabled.
</member>
<member name="display/window/size/resizable" type="bool" setter="" getter="" default="true">
Allows the window to be resizable by default.
+ [b]Note:[/b] This setting is ignored on iOS and Android.
</member>
<member name="display/window/size/test_height" type="int" setter="" getter="" default="0">
If greater than zero, overrides the window height when running the game. Useful for testing stretch modes.
@@ -458,6 +516,9 @@
<member name="display/window/tablet_driver" type="String" setter="" getter="">
Specifies the tablet driver to use. If left empty, the default driver will be used.
</member>
+ <member name="display/window/text_name" type="String" setter="" getter="" default="&quot;&quot;">
+ Specifies the [TextServer] to use. If left empty, the default will be used.
+ </member>
<member name="display/window/vsync/use_vsync" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If [code]false[/code], vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5).
</member>
@@ -466,7 +527,7 @@
[b]Note:[/b] This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it.
</member>
<member name="editor/script_templates_search_path" type="String" setter="" getter="" default="&quot;res://script_templates&quot;">
- Search path for project-specific script templates. Script templates will be search both in the editor-specific path and in this project-specific path.
+ Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path.
</member>
<member name="editor/search_in_file_extensions" type="PackedStringArray" setter="" getter="" default="PackedStringArray( &quot;gd&quot;, &quot;shader&quot; )">
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.
@@ -555,6 +616,9 @@
<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/pointing/ios/touch_delay" type="float" setter="" getter="" default="0.15">
+ Default delay for touch events. This only affects iOS devices.
+ </member>
<member name="layer_names/2d_physics/layer_1" type="String" setter="" getter="" default="&quot;&quot;">
Optional name for the 2D physics layer 1.
</member>
@@ -812,7 +876,9 @@
<member name="logging/file_logging/max_log_files" type="int" setter="" getter="" default="5">
Specifies the maximum amount of log files allowed (used for rotation).
</member>
- <member name="memory/limits/message_queue/max_size_kb" type="int" setter="" getter="" default="1024">
+ <member name="memory/limits/command_queue/multithreading_queue_size_kb" type="int" setter="" getter="" default="256">
+ </member>
+ <member name="memory/limits/message_queue/max_size_kb" type="int" setter="" getter="" default="4096">
Godot uses a message queue to defer some function calls. If you run out of space on it (you will see an error), you can increase the size here.
</member>
<member name="memory/limits/multithreaded_server/rid_pool_prealloc" type="int" setter="" getter="" default="60">
@@ -845,7 +911,7 @@
Maximum number of warnings allowed to be sent from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection.
</member>
<member name="network/limits/packet_peer_stream/max_buffer_po2" type="int" setter="" getter="" default="16">
- Default size of packet peer stream for deserializing Godot data. Over this size, data is dropped.
+ Default size of packet peer stream for deserializing Godot data (in bytes, specified as a power of two). The default value [code]16[/code] is equal to 65,536 bytes. Over this size, data is dropped.
</member>
<member name="network/limits/tcp/connect_timeout_seconds" type="int" setter="" getter="" default="30">
Timeout (in seconds) for connection attempts using TCP.
@@ -877,25 +943,39 @@
</member>
<member name="physics/2d/default_angular_damp" type="float" setter="" getter="" default="1.0">
The default angular damp in 2D.
+ [b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration.
</member>
<member name="physics/2d/default_gravity" type="int" setter="" getter="" default="98">
The default gravity strength in 2D.
[b]Note:[/b] This property is only read when the project starts. To change the default gravity at runtime, use the following code sample:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Set the default gravity strength to 98.
- PhysicsServer2D.area_set_param(get_viewport().find_world_2d().get_space(), PhysicsServer2D.AREA_PARAM_GRAVITY, 98)
- [/codeblock]
+ PhysicsServer2D.area_set_param(get_viewport().find_world_2d().space, PhysicsServer2D.AREA_PARAM_GRAVITY, 98)
+ [/gdscript]
+ [csharp]
+ // Set the default gravity strength to 98.
+ PhysicsServer2D.AreaSetParam(GetViewport().FindWorld2d().Space, PhysicsServer2D.AreaParameter.Gravity, 98);
+ [/csharp]
+ [/codeblocks]
</member>
<member name="physics/2d/default_gravity_vector" type="Vector2" setter="" getter="" default="Vector2( 0, 1 )">
The default gravity direction in 2D.
[b]Note:[/b] This property is only read when the project starts. To change the default gravity vector at runtime, use the following code sample:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Set the default gravity direction to `Vector2(0, 1)`.
- PhysicsServer2D.area_set_param(get_viewport().find_world_2d().get_space(), PhysicsServer2D.AREA_PARAM_GRAVITY_VECTOR, Vector2(0, 1))
- [/codeblock]
+ PhysicsServer2D.area_set_param(get_viewport().find_world_2d().space, PhysicsServer2D.AREA_PARAM_GRAVITY_VECTOR, Vector2.DOWN)
+ [/gdscript]
+ [csharp]
+ // Set the default gravity direction to `Vector2(0, 1)`.
+ PhysicsServer2D.AreaSetParam(GetViewport().FindWorld2d().Space, PhysicsServer2D.AreaParameter.GravityVector, Vector2.Down)
+ [/csharp]
+ [/codeblocks]
</member>
<member name="physics/2d/default_linear_damp" type="float" setter="" getter="" default="0.1">
The default linear damp in 2D.
+ [b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration.
</member>
<member name="physics/2d/large_object_surface_threshold_in_cells" type="int" setter="" getter="" default="512">
Threshold defining the surface size that constitutes a large object with regard to cells in the broad-phase 2D hash grid algorithm.
@@ -922,25 +1002,39 @@
</member>
<member name="physics/3d/default_angular_damp" type="float" setter="" getter="" default="0.1">
The default angular damp in 3D.
+ [b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration.
</member>
<member name="physics/3d/default_gravity" type="float" setter="" getter="" default="9.8">
The default gravity strength in 3D.
[b]Note:[/b] This property is only read when the project starts. To change the default gravity at runtime, use the following code sample:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Set the default gravity strength to 9.8.
- PhysicsServer3D.area_set_param(get_viewport().find_world().get_space(), PhysicsServer3D.AREA_PARAM_GRAVITY, 9.8)
- [/codeblock]
+ PhysicsServer3D.area_set_param(get_viewport().find_world().space, PhysicsServer3D.AREA_PARAM_GRAVITY, 9.8)
+ [/gdscript]
+ [csharp]
+ // Set the default gravity strength to 9.8.
+ PhysicsServer3D.AreaSetParam(GetViewport().FindWorld().Space, PhysicsServer3D.AreaParameter.Gravity, 9.8);
+ [/csharp]
+ [/codeblocks]
</member>
<member name="physics/3d/default_gravity_vector" type="Vector3" setter="" getter="" default="Vector3( 0, -1, 0 )">
The default gravity direction in 3D.
[b]Note:[/b] This property is only read when the project starts. To change the default gravity vector at runtime, use the following code sample:
- [codeblock]
+ [codeblocks]
+ [gdscript]
# Set the default gravity direction to `Vector3(0, -1, 0)`.
- PhysicsServer3D.area_set_param(get_viewport().find_world().get_space(), PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, Vector3(0, -1, 0))
- [/codeblock]
+ PhysicsServer3D.area_set_param(get_viewport().find_world().get_space(), PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, Vector3.DOWN)
+ [/gdscript]
+ [csharp]
+ // Set the default gravity direction to `Vector3(0, -1, 0)`.
+ PhysicsServer3D.AreaSetParam(GetViewport().FindWorld().Space, PhysicsServer3D.AreaParameter.GravityVector, Vector3.Down)
+ [/csharp]
+ [/codeblocks]
</member>
<member name="physics/3d/default_linear_damp" type="float" setter="" getter="" default="0.1">
The default linear damp in 3D.
+ [b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration.
</member>
<member name="physics/3d/physics_engine" type="String" setter="" getter="" default="&quot;DEFAULT&quot;">
Sets which physics engine to use for 3D physics.
@@ -994,8 +1088,15 @@
</member>
<member name="rendering/limits/time/time_rollover_secs" type="float" setter="" getter="" default="3600">
</member>
- <member name="rendering/quality/2d/use_pixel_snap" type="bool" setter="" getter="" default="false">
- If [code]true[/code], forces snapping of polygons to pixels in 2D rendering. May help in some pixel art styles.
+ <member name="rendering/quality/2d/snap_2d_transforms_to_pixel" type="bool" setter="" getter="" default="false">
+ </member>
+ <member name="rendering/quality/2d/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false">
+ </member>
+ <member name="rendering/quality/2d_sdf/oversize" type="int" setter="" getter="" default="1">
+ </member>
+ <member name="rendering/quality/2d_sdf/scale" type="int" setter="" getter="" default="1">
+ </member>
+ <member name="rendering/quality/2d_shadow_atlas/size" type="int" setter="" getter="" default="2048">
</member>
<member name="rendering/quality/depth_of_field/depth_of_field_bokeh_quality" type="int" setter="" getter="" default="2">
Sets the quality of the depth of field effect. Higher quality takes more samples, which is slower but looks smoother.
@@ -1092,6 +1193,8 @@
</member>
<member name="rendering/quality/screen_filters/screen_space_roughness_limiter_limit" type="float" setter="" getter="" default="0.18">
</member>
+ <member name="rendering/quality/screen_filters/use_debanding" type="bool" setter="" getter="" default="false">
+ </member>
<member name="rendering/quality/screen_space_reflection/roughness_quality" type="int" setter="" getter="" default="1">
Sets the quality for rough screen-space reflections. Turning off will make all screen space reflections sharp, while higher values make rough reflections look better.
</member>
diff --git a/doc/classes/ProximityGroup3D.xml b/doc/classes/ProximityGroup3D.xml
index 1714c1ec8d..512d55c9a0 100644
--- a/doc/classes/ProximityGroup3D.xml
+++ b/doc/classes/ProximityGroup3D.xml
@@ -12,7 +12,7 @@
<method name="broadcast">
<return type="void">
</return>
- <argument index="0" name="name" type="String">
+ <argument index="0" name="method" type="String">
</argument>
<argument index="1" name="parameters" type="Variant">
</argument>
@@ -30,7 +30,7 @@
</members>
<signals>
<signal name="broadcast">
- <argument index="0" name="group_name" type="String">
+ <argument index="0" name="method" type="String">
</argument>
<argument index="1" name="parameters" type="Array">
</argument>
diff --git a/doc/classes/QuadMesh.xml b/doc/classes/QuadMesh.xml
index 422add08d1..24a3d76ee2 100644
--- a/doc/classes/QuadMesh.xml
+++ b/doc/classes/QuadMesh.xml
@@ -7,6 +7,8 @@
Class representing a square [PrimitiveMesh]. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Y axes; this default rotation is more suited for use with billboarded materials. Unlike [PlaneMesh], this mesh doesn't provide subdivision options.
</description>
<tutorials>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
+ <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml
index 2218852dae..425e82c744 100644
--- a/doc/classes/Quat.xml
+++ b/doc/classes/Quat.xml
@@ -10,27 +10,36 @@
</description>
<tutorials>
<link title="Using 3D transforms">https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
- <method name="Quat">
+ <method name="Quat" qualifiers="constructor">
<return type="Quat">
</return>
- <argument index="0" name="from" type="Basis">
+ <description>
+ Constructs a default-initialized quaternion with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Quat" qualifiers="constructor">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="from" type="Quat">
</argument>
<description>
- Constructs a quaternion from the given [Basis].
+ Constructs a [Quat] as a copy of the given [Quat].
</description>
</method>
- <method name="Quat">
+ <method name="Quat" qualifiers="constructor">
<return type="Quat">
</return>
- <argument index="0" name="euler" type="Vector3">
+ <argument index="0" name="arc_from" type="Vector3">
+ </argument>
+ <argument index="1" name="arc_to" type="Vector3">
</argument>
<description>
- Constructs a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
</description>
</method>
- <method name="Quat">
+ <method name="Quat" qualifiers="constructor">
<return type="Quat">
</return>
<argument index="0" name="axis" type="Vector3">
@@ -41,7 +50,25 @@
Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
</description>
</method>
- <method name="Quat">
+ <method name="Quat" qualifiers="constructor">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="euler" type="Vector3">
+ </argument>
+ <description>
+ Constructs a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
+ </description>
+ </method>
+ <method name="Quat" qualifiers="constructor">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="from" type="Basis">
+ </argument>
+ <description>
+ Constructs a quaternion from the given [Basis].
+ </description>
+ </method>
+ <method name="Quat" qualifiers="constructor">
<return type="Quat">
</return>
<argument index="0" name="x" type="float">
@@ -65,16 +92,16 @@
</argument>
<argument index="2" name="post_b" type="Quat">
</argument>
- <argument index="3" name="t" type="float">
+ <argument index="3" name="weight" type="float">
</argument>
<description>
- Performs a cubic spherical interpolation between quaternions [code]preA[/code], this vector, [code]b[/code], and [code]postB[/code], by the given amount [code]t[/code].
+ Performs a cubic spherical interpolation between quaternions [code]pre_a[/code], this vector, [code]b[/code], and [code]post_b[/code], by the given amount [code]weight[/code].
</description>
</method>
<method name="dot">
<return type="float">
</return>
- <argument index="0" name="b" type="Quat">
+ <argument index="0" name="with" type="Quat">
</argument>
<description>
Returns the dot product of two quaternions.
@@ -97,7 +124,7 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="quat" type="Quat">
+ <argument index="0" name="to" type="Quat">
</argument>
<description>
Returns [code]true[/code] if this quaterion and [code]quat[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
@@ -131,56 +158,127 @@
Returns a copy of the quaternion, normalized to unit length.
</description>
</method>
- <method name="set_axis_angle">
- <return type="void">
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
</return>
- <argument index="0" name="axis" type="Vector3">
+ <argument index="0" name="right" type="Quat">
</argument>
- <argument index="1" name="angle" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="Quat">
</argument>
<description>
- Sets the quaternion to a rotation which rotates around axis by the specified angle, in radians. The axis must be a normalized vector.
</description>
</method>
- <method name="set_euler">
- <return type="void">
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
</return>
- <argument index="0" name="euler" type="Vector3">
+ <argument index="0" name="right" type="Vector3">
</argument>
<description>
- Sets the quaternion to a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
</description>
</method>
- <method name="slerp">
+ <method name="operator *" qualifiers="operator">
<return type="Quat">
</return>
- <argument index="0" name="b" type="Quat">
+ <argument index="0" name="right" type="float">
</argument>
- <argument index="1" name="t" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="int">
</argument>
<description>
- Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code].
- [b]Note:[/b] Both quaternions must be normalized.
</description>
</method>
- <method name="slerpni">
+ <method name="operator +" qualifiers="operator">
<return type="Quat">
</return>
- <argument index="0" name="b" type="Quat">
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="Quat">
</argument>
- <argument index="1" name="t" type="float">
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="Quat">
</argument>
<description>
- Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code], but without checking if the rotation path is not bigger than 90 degrees.
</description>
</method>
- <method name="xform">
- <return type="Vector3">
+ <method name="operator /" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
</return>
- <argument index="0" name="v" type="Vector3">
+ <argument index="0" name="right" type="Quat">
</argument>
<description>
- Returns a vector transformed (multiplied) by this quaternion.
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="slerp">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="to" type="Quat">
+ </argument>
+ <argument index="1" name="weight" type="float">
+ </argument>
+ <description>
+ Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code].
+ [b]Note:[/b] Both quaternions must be normalized.
+ </description>
+ </method>
+ <method name="slerpni">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="to" type="Quat">
+ </argument>
+ <argument index="1" name="weight" type="float">
+ </argument>
+ <description>
+ Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code], but without checking if the rotation path is not bigger than 90 degrees.
</description>
</method>
</methods>
diff --git a/doc/classes/RDTextureFormat.xml b/doc/classes/RDTextureFormat.xml
index 664d4cadff..e41ddff368 100644
--- a/doc/classes/RDTextureFormat.xml
+++ b/doc/classes/RDTextureFormat.xml
@@ -37,7 +37,7 @@
</member>
<member name="samples" type="int" setter="set_samples" getter="get_samples" enum="RenderingDevice.TextureSamples" default="0">
</member>
- <member name="type" type="int" setter="set_type" getter="get_type" enum="RenderingDevice.TextureType" default="1">
+ <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="RenderingDevice.TextureType" default="1">
</member>
<member name="usage_bits" type="int" setter="set_usage_bits" getter="get_usage_bits" default="0">
</member>
diff --git a/doc/classes/RDUniform.xml b/doc/classes/RDUniform.xml
index e5bace32af..bc8a21e985 100644
--- a/doc/classes/RDUniform.xml
+++ b/doc/classes/RDUniform.xml
@@ -31,7 +31,7 @@
<members>
<member name="binding" type="int" setter="set_binding" getter="get_binding" default="0">
</member>
- <member name="type" type="int" setter="set_type" getter="get_type" enum="RenderingDevice.UniformType" default="3">
+ <member name="uniform_type" type="int" setter="set_uniform_type" getter="get_uniform_type" enum="RenderingDevice.UniformType" default="3">
</member>
</members>
<constants>
diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml
index 644c427120..0ee34d4194 100644
--- a/doc/classes/RID.xml
+++ b/doc/classes/RID.xml
@@ -9,13 +9,20 @@
<tutorials>
</tutorials>
<methods>
- <method name="RID">
+ <method name="RID" qualifiers="constructor">
<return type="RID">
</return>
- <argument index="0" name="from" type="Object">
+ <description>
+ Constructs an empty [RID] with the invalid ID [code]0[/code].
+ </description>
+ </method>
+ <method name="RID" qualifiers="constructor">
+ <return type="RID">
+ </return>
+ <argument index="0" name="from" type="RID">
</argument>
<description>
- Creates a new RID instance with the ID of a given resource. When not handed a valid resource, silently stores the unused ID 0.
+ Constructs a [RID] as a copy of the given [RID].
</description>
</method>
<method name="get_id">
@@ -25,6 +32,54 @@
Returns the ID of the referenced resource.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/RandomNumberGenerator.xml b/doc/classes/RandomNumberGenerator.xml
index ec0f1a96b2..6312cd18aa 100644
--- a/doc/classes/RandomNumberGenerator.xml
+++ b/doc/classes/RandomNumberGenerator.xml
@@ -13,8 +13,10 @@
rng.randomize()
var my_random_number = rng.randf_range(-10.0, 10.0)
[/codeblock]
+ [b]Note:[/b] The default values of [member seed] and [member state] properties are pseudo-random, and changes when calling [method randomize]. The [code]0[/code] value documented here is a placeholder, and not the actual default seed.
</description>
<tutorials>
+ <link title="Random number generation">https://docs.godotengine.org/en/latest/tutorials/math/random_number_generation.html</link>
</tutorials>
<methods>
<method name="randf">
@@ -73,9 +75,27 @@
</method>
</methods>
<members>
- <member name="seed" type="int" setter="set_seed" getter="get_seed" default="-6398989897141750821">
- The seed used by the random number generator. A given seed will give a reproducible sequence of pseudo-random numbers.
+ <member name="seed" type="int" setter="set_seed" getter="get_seed" default="0">
+ Initializes the random number generator state based on the given seed value. A given seed will give a reproducible sequence of pseudo-random numbers.
[b]Note:[/b] The RNG does not have an avalanche effect, and can output similar random streams given similar seeds. Consider using a hash function to improve your seed quality if they're sourced externally.
+ [b]Note:[/b] Setting this property produces a side effect of changing the internal [member state], so make sure to initialize the seed [i]before[/i] modifying the [member state]:
+ [codeblock]
+ var rng = RandomNumberGenerator.new()
+ rng.seed = hash("Godot")
+ rng.state = 100 # Restore to some previously saved state.
+ [/codeblock]
+ </member>
+ <member name="state" type="int" setter="set_state" getter="get_state" default="0">
+ The current state of the random number generator. Save and restore this property to restore the generator to a previous state:
+ [codeblock]
+ var rng = RandomNumberGenerator.new()
+ print(rng.randf())
+ var saved_state = rng.state # Store current state.
+ print(rng.randf()) # Advance internal state.
+ rng.state = saved_state # Restore the state.
+ print(rng.randf()) # Prints the same value as in previous.
+ [/codeblock]
+ [b]Note:[/b] Do not set state to arbitrary values, since the random number generator requires the state to have certain qualities to behave properly. It should only be set to values that came from the state property itself. To initialize the random number generator with arbitrary input, use [member seed] instead.
</member>
</members>
<constants>
diff --git a/doc/classes/RayCast3D.xml b/doc/classes/RayCast3D.xml
index 1d8edf0adb..d24e86a08b 100644
--- a/doc/classes/RayCast3D.xml
+++ b/doc/classes/RayCast3D.xml
@@ -12,6 +12,7 @@
</description>
<tutorials>
<link title="Ray-casting">https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="add_exception">
diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml
index fe05f14fa1..5682e12b63 100644
--- a/doc/classes/Rect2.xml
+++ b/doc/classes/Rect2.xml
@@ -5,13 +5,41 @@
</brief_description>
<description>
[Rect2] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
- It uses floating point coordinates.
+ It uses floating-point coordinates. If you need integer coordinates, use [Rect2i] instead.
+ The 3D counterpart to [Rect2] is [AABB].
</description>
<tutorials>
<link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link>
</tutorials>
<methods>
- <method name="Rect2">
+ <method name="Rect2" qualifiers="constructor">
+ <return type="Rect2">
+ </return>
+ <description>
+ Constructs a default-initialized [Rect2] with default (zero) values of [member position] and [member size].
+ </description>
+ </method>
+ <method name="Rect2" qualifiers="constructor">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="from" type="Rect2">
+ </argument>
+ <description>
+ Constructs a [Rect2] as a copy of the given [Rect2].
+ </description>
+ </method>
+ <method name="Rect2" qualifiers="constructor">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="from" type="Rect2i">
+ </argument>
+ <description>
+ Constructs a [Rect2] from a [Rect2i].
+ </description>
+ </method>
+ <method name="Rect2" qualifiers="constructor">
<return type="Rect2">
</return>
<argument index="0" name="position" type="Vector2">
@@ -22,7 +50,7 @@
Constructs a [Rect2] by position and size.
</description>
</method>
- <method name="Rect2">
+ <method name="Rect2" qualifiers="constructor">
<return type="Rect2">
</return>
<argument index="0" name="x" type="float">
@@ -37,15 +65,6 @@
Constructs a [Rect2] by x, y, width, and height.
</description>
</method>
- <method name="Rect2">
- <return type="Rect2">
- </return>
- <argument index="0" name="from" type="Rect2i">
- </argument>
- <description>
- Constructs a [Rect2] from a [Rect2i].
- </description>
- </method>
<method name="abs">
<return type="Rect2">
</return>
@@ -53,7 +72,7 @@
Returns a [Rect2] with equivalent position and area, modified so that the top-left corner is the origin and [code]width[/code] and [code]height[/code] are positive.
</description>
</method>
- <method name="clip">
+ <method name="intersection">
<return type="Rect2">
</return>
<argument index="0" name="b" type="Rect2">
@@ -105,7 +124,7 @@
</argument>
<argument index="2" name="right" type="float">
</argument>
- <argument index="3" name=" bottom" type="float">
+ <argument index="3" name="bottom" type="float">
</argument>
<description>
Returns a copy of the [Rect2] grown a given amount of units towards each direction individually.
@@ -168,6 +187,30 @@
Returns a larger [Rect2] that contains this [Rect2] and [code]b[/code].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Rect2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Rect2">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="end" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml
index 2fdfe7c24b..ef12c8de1e 100644
--- a/doc/classes/Rect2i.xml
+++ b/doc/classes/Rect2i.xml
@@ -5,24 +5,50 @@
</brief_description>
<description>
[Rect2i] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
- It uses integer coordinates.
+ It uses integer coordinates. If you need floating-point coordinates, use [Rect2] instead.
</description>
<tutorials>
<link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
</tutorials>
<methods>
- <method name="Rect2i">
+ <method name="Rect2i" qualifiers="constructor">
<return type="Rect2i">
</return>
- <argument index="0" name="position" type="Vector2">
+ <description>
+ Constructs a default-initialized [Rect2i] with default (zero) values of [member position] and [member size].
+ </description>
+ </method>
+ <method name="Rect2i" qualifiers="constructor">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="from" type="Rect2i">
+ </argument>
+ <description>
+ Constructs a [Rect2i] as a copy of the given [Rect2i].
+ </description>
+ </method>
+ <method name="Rect2i" qualifiers="constructor">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="from" type="Rect2">
+ </argument>
+ <description>
+ Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated.
+ </description>
+ </method>
+ <method name="Rect2i" qualifiers="constructor">
+ <return type="Rect2i">
+ </return>
+ <argument index="0" name="position" type="Vector2i">
</argument>
- <argument index="1" name="size" type="Vector2">
+ <argument index="1" name="size" type="Vector2i">
</argument>
<description>
Constructs a [Rect2i] by position and size.
</description>
</method>
- <method name="Rect2i">
+ <method name="Rect2i" qualifiers="constructor">
<return type="Rect2i">
</return>
<argument index="0" name="x" type="int">
@@ -37,15 +63,6 @@
Constructs a [Rect2i] by x, y, width, and height.
</description>
</method>
- <method name="Rect2i">
- <return type="Rect2i">
- </return>
- <argument index="0" name="from" type="Rect2">
- </argument>
- <description>
- Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated.
- </description>
- </method>
<method name="abs">
<return type="Rect2i">
</return>
@@ -53,7 +70,7 @@
Returns a [Rect2i] with equivalent position and area, modified so that the top-left corner is the origin and [code]width[/code] and [code]height[/code] are positive.
</description>
</method>
- <method name="clip">
+ <method name="intersection">
<return type="Rect2i">
</return>
<argument index="0" name="b" type="Rect2i">
@@ -105,7 +122,7 @@
</argument>
<argument index="2" name="right" type="int">
</argument>
- <argument index="3" name=" bottom" type="int">
+ <argument index="3" name="bottom" type="int">
</argument>
<description>
Returns a copy of the [Rect2i] grown a given amount of units towards each direction individually.
@@ -157,6 +174,22 @@
Returns a larger [Rect2i] that contains this [Rect2i] and [code]b[/code].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Rect2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Rect2i">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="end" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )">
diff --git a/doc/classes/RectangleShape2D.xml b/doc/classes/RectangleShape2D.xml
index b42cc48d43..041416a24b 100644
--- a/doc/classes/RectangleShape2D.xml
+++ b/doc/classes/RectangleShape2D.xml
@@ -7,6 +7,8 @@
Rectangle shape for 2D collisions. This shape is useful for modeling box-like 2D objects.
</description>
<tutorials>
+ <link title="2D Pong Demo">https://godotengine.org/asset-library/asset/121</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Reference.xml b/doc/classes/Reference.xml
index 9c3d1d5d9d..44ee6fbda1 100644
--- a/doc/classes/Reference.xml
+++ b/doc/classes/Reference.xml
@@ -7,6 +7,7 @@
Base class for any object that keeps a reference count. [Resource] and many other helper objects inherit this class.
Unlike [Object]s, References keep an internal reference counter so that they are automatically released when no longer in use, and only then. References therefore do not need to be freed manually with [method Object.free].
In the vast majority of use cases, instantiating and using [Reference]-derived types is all you need to do. The methods provided in this class are only for advanced users, and can cause issues if misused.
+ [b]Note:[/b] In C#, references will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free references that are no longer in use. This means that unused references will linger on for a while before being removed.
</description>
<tutorials>
<link title="When and how to avoid using nodes for everything">https://docs.godotengine.org/en/latest/getting_started/workflow/best_practices/node_alternatives.html</link>
diff --git a/doc/classes/ReferenceRect.xml b/doc/classes/ReferenceRect.xml
index 4f8f71b3db..1a3fbbdfc5 100644
--- a/doc/classes/ReferenceRect.xml
+++ b/doc/classes/ReferenceRect.xml
@@ -4,7 +4,7 @@
Reference frame for GUI.
</brief_description>
<description>
- A rectangle box that displays only a [member border_color] border color around its rectangle. [ReferenceRect] has no fill [Color].
+ A rectangle box that displays only a [member border_color] border color around its rectangle. [ReferenceRect] has no fill [Color]. If you need to display a rectangle filled with a solid color, consider using [ColorRect] instead.
</description>
<tutorials>
</tutorials>
@@ -14,6 +14,9 @@
<member name="border_color" type="Color" setter="set_border_color" getter="get_border_color" default="Color( 1, 0, 0, 1 )">
Sets the border [Color] of the [ReferenceRect].
</member>
+ <member name="border_width" type="float" setter="set_border_width" getter="get_border_width" default="1.0">
+ Sets the border width of the [ReferenceRect]. The border grows both inwards and outwards with respect to the rectangle box.
+ </member>
<member name="editor_only" type="bool" setter="set_editor_only" getter="get_editor_only" default="true">
If set to [code]true[/code], the [ReferenceRect] will only be visible while in editor. Otherwise, [ReferenceRect] will be visible in game.
</member>
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 9c8c964967..74eb6a17e5 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -404,28 +404,6 @@
The mode of the light, see [enum CanvasLightMode] constants.
</description>
</method>
- <method name="canvas_light_set_scale">
- <return type="void">
- </return>
- <argument index="0" name="light" type="RID">
- </argument>
- <argument index="1" name="scale" type="float">
- </argument>
- <description>
- Sets the texture's scale factor of the light. Equivalent to [member Light2D.texture_scale].
- </description>
- </method>
- <method name="canvas_light_set_shadow_buffer_size">
- <return type="void">
- </return>
- <argument index="0" name="light" type="RID">
- </argument>
- <argument index="1" name="size" type="int">
- </argument>
- <description>
- Sets the width of the shadow buffer, size gets scaled to the next power of two for this.
- </description>
- </method>
<method name="canvas_light_set_shadow_color">
<return type="void">
</return>
@@ -478,7 +456,7 @@
<argument index="1" name="texture" type="RID">
</argument>
<description>
- Sets texture to be used by light. Equivalent to [member Light2D.texture].
+ Sets the texture to be used by a [PointLight2D]. Equivalent to [member PointLight2D.texture].
</description>
</method>
<method name="canvas_light_set_texture_offset">
@@ -489,7 +467,18 @@
<argument index="1" name="offset" type="Vector2">
</argument>
<description>
- Sets the offset of the light's texture. Equivalent to [member Light2D.offset].
+ Sets the offset of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.offset].
+ </description>
+ </method>
+ <method name="canvas_light_set_texture_scale">
+ <return type="void">
+ </return>
+ <argument index="0" name="light" type="RID">
+ </argument>
+ <argument index="1" name="scale" type="float">
+ </argument>
+ <description>
+ Sets the scale factor of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.texture_scale].
</description>
</method>
<method name="canvas_light_set_transform">
@@ -548,17 +537,6 @@
Sets the shape of the occluder polygon.
</description>
</method>
- <method name="canvas_occluder_polygon_set_shape_as_lines">
- <return type="void">
- </return>
- <argument index="0" name="occluder_polygon" type="RID">
- </argument>
- <argument index="1" name="shape" type="PackedVector2Array">
- </argument>
- <description>
- Sets the shape of the occluder polygon as lines.
- </description>
- </method>
<method name="canvas_set_item_mirroring">
<return type="void">
</return>
@@ -583,6 +561,12 @@
Modulates all colors in the given canvas.
</description>
</method>
+ <method name="create_local_rendering_device" qualifiers="const">
+ <return type="RenderingDevice">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="directional_light_create">
<return type="RID">
</return>
@@ -613,7 +597,9 @@
</argument>
<argument index="4" name="saturation" type="float">
</argument>
- <argument index="5" name="ramp" type="RID">
+ <argument index="5" name="use_1d_color_correction" type="bool">
+ </argument>
+ <argument index="6" name="color_correction" type="RID">
</argument>
<description>
Sets the values to be used with the "Adjustment" post-process effect. See [Environment] for more details.
@@ -702,6 +688,8 @@
</argument>
<argument index="7" name="height_density" type="float">
</argument>
+ <argument index="8" name="aerial_perspective" type="float">
+ </argument>
<description>
</description>
</method>
@@ -712,7 +700,7 @@
</argument>
<argument index="1" name="enable" type="bool">
</argument>
- <argument index="2" name="level_flags" type="int">
+ <argument index="2" name="levels" type="PackedFloat32Array">
</argument>
<argument index="3" name="intensity" type="float">
</argument>
@@ -1426,6 +1414,17 @@
Sets the shadow mode for this directional light. Equivalent to [member DirectionalLight3D.directional_shadow_mode]. See [enum LightDirectionalShadowMode] for options.
</description>
</method>
+ <method name="light_directional_set_sky_only">
+ <return type="void">
+ </return>
+ <argument index="0" name="light" type="RID">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ If [code]true[/code], this light will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon.
+ </description>
+ </method>
<method name="light_omni_set_shadow_mode">
<return type="void">
</return>
@@ -1615,26 +1614,6 @@
Sets a shader material's shader.
</description>
</method>
- <method name="mesh_add_surface_from_arrays">
- <return type="void">
- </return>
- <argument index="0" name="mesh" type="RID">
- </argument>
- <argument index="1" name="primitive" type="int" enum="RenderingServer.PrimitiveType">
- </argument>
- <argument index="2" name="arrays" type="Array">
- </argument>
- <argument index="3" name="blend_shapes" type="Array" default="[ ]">
- </argument>
- <argument index="4" name="lods" type="Dictionary" default="{
-
-}">
- </argument>
- <argument index="5" name="compress_format" type="int" default="31744">
- </argument>
- <description>
- </description>
- </method>
<method name="mesh_clear">
<return type="void">
</return>
@@ -1733,32 +1712,46 @@
Returns a mesh's surface's arrays for blend shapes.
</description>
</method>
- <method name="mesh_surface_get_format_offset" qualifiers="const">
+ <method name="mesh_surface_get_format_attribute_stride" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="format" type="int">
</argument>
- <argument index="1" name="vertex_len" type="int">
+ <argument index="1" name="vertex_count" type="int">
</argument>
- <argument index="2" name="index_len" type="int">
+ <description>
+ </description>
+ </method>
+ <method name="mesh_surface_get_format_offset" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="format" type="int">
+ </argument>
+ <argument index="1" name="vertex_count" type="int">
</argument>
- <argument index="3" name="array_index" type="int">
+ <argument index="2" name="array_index" type="int">
</argument>
<description>
- Function is unused in Godot 3.x.
</description>
</method>
- <method name="mesh_surface_get_format_stride" qualifiers="const">
+ <method name="mesh_surface_get_format_skin_stride" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="format" type="int">
</argument>
- <argument index="1" name="vertex_len" type="int">
+ <argument index="1" name="vertex_count" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="mesh_surface_get_format_vertex_stride" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="format" type="int">
</argument>
- <argument index="2" name="index_len" type="int">
+ <argument index="1" name="vertex_count" type="int">
</argument>
<description>
- Function is unused in Godot 3.x.
</description>
</method>
<method name="mesh_surface_get_material" qualifiers="const">
@@ -2960,6 +2953,16 @@
Sets when the viewport should be updated. See [enum ViewportUpdateMode] constants for options.
</description>
</method>
+ <method name="viewport_set_use_debanding">
+ <return type="void">
+ </return>
+ <argument index="0" name="viewport" type="RID">
+ </argument>
+ <argument index="1" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="viewport_set_use_xr">
<return type="void">
</return>
@@ -3065,16 +3068,24 @@
<constant name="ARRAY_TEX_UV2" value="5" enum="ArrayType">
Array is an UV coordinates array for the second UV coordinates.
</constant>
- <constant name="ARRAY_BONES" value="6" enum="ArrayType">
+ <constant name="ARRAY_CUSTOM0" value="6" enum="ArrayType">
+ </constant>
+ <constant name="ARRAY_CUSTOM1" value="7" enum="ArrayType">
+ </constant>
+ <constant name="ARRAY_CUSTOM2" value="8" enum="ArrayType">
+ </constant>
+ <constant name="ARRAY_CUSTOM3" value="9" enum="ArrayType">
+ </constant>
+ <constant name="ARRAY_BONES" value="10" enum="ArrayType">
Array contains bone information.
</constant>
- <constant name="ARRAY_WEIGHTS" value="7" enum="ArrayType">
+ <constant name="ARRAY_WEIGHTS" value="11" enum="ArrayType">
Array is weight information.
</constant>
- <constant name="ARRAY_INDEX" value="8" enum="ArrayType">
+ <constant name="ARRAY_INDEX" value="12" enum="ArrayType">
Array is index array.
</constant>
- <constant name="ARRAY_MAX" value="9" enum="ArrayType">
+ <constant name="ARRAY_MAX" value="13" enum="ArrayType">
Represents the size of the [enum ArrayType] enum.
</constant>
<constant name="ARRAY_FORMAT_VERTEX" value="1" enum="ArrayFormat">
@@ -3095,40 +3106,45 @@
<constant name="ARRAY_FORMAT_TEX_UV2" value="32" enum="ArrayFormat">
Flag used to mark an UV coordinates array for the second UV coordinates.
</constant>
- <constant name="ARRAY_FORMAT_BONES" value="64" enum="ArrayFormat">
+ <constant name="ARRAY_FORMAT_CUSTOM0" value="64" enum="ArrayFormat">
+ </constant>
+ <constant name="ARRAY_FORMAT_CUSTOM1" value="128" enum="ArrayFormat">
+ </constant>
+ <constant name="ARRAY_FORMAT_CUSTOM2" value="256" enum="ArrayFormat">
+ </constant>
+ <constant name="ARRAY_FORMAT_CUSTOM3" value="512" enum="ArrayFormat">
+ </constant>
+ <constant name="ARRAY_FORMAT_BONES" value="1024" enum="ArrayFormat">
Flag used to mark a bone information array.
</constant>
- <constant name="ARRAY_FORMAT_WEIGHTS" value="128" enum="ArrayFormat">
+ <constant name="ARRAY_FORMAT_WEIGHTS" value="2048" enum="ArrayFormat">
Flag used to mark a weights array.
</constant>
- <constant name="ARRAY_FORMAT_INDEX" value="256" enum="ArrayFormat">
+ <constant name="ARRAY_FORMAT_INDEX" value="4096" enum="ArrayFormat">
Flag used to mark an index array.
</constant>
- <constant name="ARRAY_COMPRESS_NORMAL" value="1024" enum="ArrayFormat">
- Flag used to mark a compressed (half float) normal array.
+ <constant name="ARRAY_FORMAT_BLEND_SHAPE_MASK" value="2147475463" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_TANGENT" value="2048" enum="ArrayFormat">
- Flag used to mark a compressed (half float) tangent array.
+ <constant name="ARRAY_FORMAT_CUSTOM_BASE" value="13" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_COLOR" value="4096" enum="ArrayFormat">
- Flag used to mark a compressed (half float) color array.
+ <constant name="ARRAY_FORMAT_CUSTOM0_SHIFT" value="13" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_TEX_UV" value="8192" enum="ArrayFormat">
- Flag used to mark a compressed (half float) UV coordinates array.
+ <constant name="ARRAY_FORMAT_CUSTOM1_SHIFT" value="16" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_TEX_UV2" value="16384" enum="ArrayFormat">
- Flag used to mark a compressed (half float) UV coordinates array for the second UV coordinates.
+ <constant name="ARRAY_FORMAT_CUSTOM2_SHIFT" value="19" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_INDEX" value="131072" enum="ArrayFormat">
- Flag used to mark a compressed index array.
+ <constant name="ARRAY_FORMAT_CUSTOM3_SHIFT" value="22" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_COMPRESS_DEFAULT" value="31744" enum="ArrayFormat">
- Used to set flags [constant ARRAY_COMPRESS_NORMAL], [constant ARRAY_COMPRESS_TANGENT], [constant ARRAY_COMPRESS_COLOR], [constant ARRAY_COMPRESS_TEX_UV] and [constant ARRAY_COMPRESS_TEX_UV2] quickly.
+ <constant name="ARRAY_FORMAT_CUSTOM_MASK" value="7" enum="ArrayFormat">
</constant>
- <constant name="ARRAY_FLAG_USE_2D_VERTICES" value="262144" enum="ArrayFormat">
+ <constant name="ARRAY_COMPRESS_FLAGS_BASE" value="25" enum="ArrayFormat">
+ </constant>
+ <constant name="ARRAY_FLAG_USE_2D_VERTICES" value="33554432" enum="ArrayFormat">
Flag used to mark that the array contains 2D vertices.
</constant>
- <constant name="ARRAY_FLAG_USE_DYNAMIC_UPDATE" value="1048576" enum="ArrayFormat">
+ <constant name="ARRAY_FLAG_USE_DYNAMIC_UPDATE" value="67108864" enum="ArrayFormat">
+ </constant>
+ <constant name="ARRAY_FLAG_USE_8_BONE_WEIGHTS" value="134217728" enum="ArrayFormat">
</constant>
<constant name="PRIMITIVE_POINTS" value="0" enum="PrimitiveType">
Primitive to draw consists of points.
@@ -3359,7 +3375,8 @@
Objects are displayed with only light information.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_OVERDRAW" value="3" enum="ViewportDebugDraw">
- Objects are displayed semi-transparent with additive blending so you can see where they are drawing over top of one another. A higher overdraw means you are wasting performance on drawing pixels that are being hidden behind others.
+ Objects are displayed semi-transparent with additive blending so you can see where they are drawing over top of one another. A higher overdraw (represented by brighter colors) means you are wasting performance on drawing pixels that are being hidden behind others.
+ [b]Note:[/b] When using this debug draw mode, custom shaders will be ignored. This means vertex displacement won't be visible anymore.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_WIREFRAME" value="4" enum="ViewportDebugDraw">
Debug draw draws objects in wireframe.
@@ -3574,22 +3591,24 @@
<constant name="INSTANCE_PARTICLES" value="4" enum="InstanceType">
The instance is a particle emitter.
</constant>
- <constant name="INSTANCE_LIGHT" value="5" enum="InstanceType">
+ <constant name="INSTANCE_PARTICLES_COLLISION" value="5" enum="InstanceType">
+ </constant>
+ <constant name="INSTANCE_LIGHT" value="6" enum="InstanceType">
The instance is a light.
</constant>
- <constant name="INSTANCE_REFLECTION_PROBE" value="6" enum="InstanceType">
+ <constant name="INSTANCE_REFLECTION_PROBE" value="7" enum="InstanceType">
The instance is a reflection probe.
</constant>
- <constant name="INSTANCE_DECAL" value="7" enum="InstanceType">
+ <constant name="INSTANCE_DECAL" value="8" enum="InstanceType">
The instance is a decal.
</constant>
- <constant name="INSTANCE_GI_PROBE" value="8" enum="InstanceType">
+ <constant name="INSTANCE_GI_PROBE" value="9" enum="InstanceType">
The instance is a GI probe.
</constant>
- <constant name="INSTANCE_LIGHTMAP" value="9" enum="InstanceType">
+ <constant name="INSTANCE_LIGHTMAP" value="10" enum="InstanceType">
The instance is a lightmap.
</constant>
- <constant name="INSTANCE_MAX" value="10" enum="InstanceType">
+ <constant name="INSTANCE_MAX" value="11" enum="InstanceType">
Represents the size of the [enum InstanceType] enum.
</constant>
<constant name="INSTANCE_GEOMETRY_MASK" value="30" enum="InstanceType">
@@ -3667,18 +3686,25 @@
<constant name="CANVAS_ITEM_TEXTURE_REPEAT_MAX" value="4" enum="CanvasItemTextureRepeat">
Max value for [enum CanvasItemTextureRepeat] enum.
</constant>
- <constant name="CANVAS_LIGHT_MODE_ADD" value="0" enum="CanvasLightMode">
+ <constant name="CANVAS_GROUP_MODE_DISABLED" value="0" enum="CanvasGroupMode">
+ </constant>
+ <constant name="CANVAS_GROUP_MODE_OPAQUE" value="1" enum="CanvasGroupMode">
+ </constant>
+ <constant name="CANVAS_GROUP_MODE_TRANSPARENT" value="2" enum="CanvasGroupMode">
+ </constant>
+ <constant name="CANVAS_LIGHT_MODE_POINT" value="0" enum="CanvasLightMode">
+ </constant>
+ <constant name="CANVAS_LIGHT_MODE_DIRECTIONAL" value="1" enum="CanvasLightMode">
+ </constant>
+ <constant name="CANVAS_LIGHT_BLEND_MODE_ADD" value="0" enum="CanvasLightBlendMode">
Adds light color additive to the canvas.
</constant>
- <constant name="CANVAS_LIGHT_MODE_SUB" value="1" enum="CanvasLightMode">
+ <constant name="CANVAS_LIGHT_BLEND_MODE_SUB" value="1" enum="CanvasLightBlendMode">
Adds light color subtractive to the canvas.
</constant>
- <constant name="CANVAS_LIGHT_MODE_MIX" value="2" enum="CanvasLightMode">
+ <constant name="CANVAS_LIGHT_BLEND_MODE_MIX" value="2" enum="CanvasLightBlendMode">
The light adds color depending on transparency.
</constant>
- <constant name="CANVAS_LIGHT_MODE_MASK" value="3" enum="CanvasLightMode">
- The light adds color depending on mask.
- </constant>
<constant name="CANVAS_LIGHT_FILTER_NONE" value="0" enum="CanvasLightShadowFilter">
Do not apply a filter to canvas light shadows.
</constant>
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index e79a2e0ea9..54984b7785 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Unlike [Object]s, they are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a [Node], which is not reference-counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource.
+ [b]Note:[/b] In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed.
</description>
<tutorials>
<link title="Resources">https://docs.godotengine.org/en/latest/getting_started/step_by_step/resources.html</link>
@@ -75,6 +76,7 @@
<signal name="changed">
<description>
Emitted whenever the resource changes.
+ [b]Note:[/b] This signal is not emitted automatically for custom resources, which means that you need to create a setter and emit the signal yourself.
</description>
</signal>
</signals>
diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml
index 1cf775f389..c55a51c7ae 100644
--- a/doc/classes/ResourceLoader.xml
+++ b/doc/classes/ResourceLoader.xml
@@ -6,9 +6,9 @@
<description>
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.
- GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios.
</description>
<tutorials>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
<method name="exists">
@@ -20,7 +20,7 @@
</argument>
<description>
Returns whether a recognized resource exists for the given [code]path[/code].
- An optional [code]type_hint[/code] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader].
+ An optional [code]type_hint[/code] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image].
</description>
</method>
<method name="get_dependencies">
@@ -63,9 +63,10 @@
<description>
Loads a resource at the given [code]path[/code], caching the result for further access.
The registered [ResourceFormatLoader]s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted.
- An optional [code]type_hint[/code] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader].
+ An optional [code]type_hint[/code] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image].
If [code]no_cache[/code] is [code]true[/code], the resource cache will be bypassed and the resource will be loaded anew. Otherwise, the cached resource will be returned if it exists.
- Returns an empty resource if no ResourceFormatLoader could handle the file.
+ Returns an empty resource if no [ResourceFormatLoader] could handle the file.
+ GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios.
</description>
</method>
<method name="load_threaded_get">
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index dc3c7c7dc0..0fd440fa75 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -10,6 +10,8 @@
</description>
<tutorials>
<link title="BBCode in RichTextLabel">https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link>
+ <link title="GUI Rich Text/BBcode Demo">https://godotengine.org/asset-library/asset/132</link>
+ <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
</tutorials>
<methods>
<method name="add_image">
@@ -23,6 +25,8 @@
</argument>
<argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
</argument>
+ <argument index="4" name="inline_align" type="int" enum="VAlign" default="0">
+ </argument>
<description>
Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image and a [code]color[/code] to tint the image.
If [code]width[/code] or [code]height[/code] is set to 0, the image size will be adjusted in order to keep the original aspect ratio.
@@ -44,6 +48,7 @@
</argument>
<description>
Parses [code]bbcode[/code] and adds tags to the tag stack as needed. Returns the result of the parsing, [constant OK] if successful.
+ [b]Note:[/b] Using this method, you can't close a tag that was opened in a previous [method append_bbcode] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member bbcode_text] instead of using [method append_bbcode].
</description>
</method>
<method name="clear">
@@ -129,15 +134,6 @@
Terminates the current tag. Use after [code]push_*[/code] methods to close BBCodes manually. Does not need to follow [code]add_*[/code] methods.
</description>
</method>
- <method name="push_align">
- <return type="void">
- </return>
- <argument index="0" name="align" type="int" enum="RichTextLabel.Align">
- </argument>
- <description>
- Adds an [code][align][/code] tag based on the given [code]align[/code] value. See [enum Align] for possible values.
- </description>
- </method>
<method name="push_bold">
<return type="void">
</return>
@@ -177,6 +173,24 @@
Adds a [code][font][/code] tag to the tag stack. Overrides default fonts for its duration.
</description>
</method>
+ <method name="push_font_features">
+ <return type="void">
+ </return>
+ <argument index="0" name="opentype_features" type="Dictionary">
+ </argument>
+ <description>
+ Adds a [code][ot_feature][/code] tag to the tag stack. Overrides default OpenType font feature for its duration.
+ </description>
+ </method>
+ <method name="push_font_size">
+ <return type="void">
+ </return>
+ <argument index="0" name="font_size" type="int">
+ </argument>
+ <description>
+ Adds a [code][font_size][/code] tag to the tag stack. Overrides default font size for its duration.
+ </description>
+ </method>
<method name="push_indent">
<return type="void">
</return>
@@ -196,10 +210,14 @@
<method name="push_list">
<return type="void">
</return>
- <argument index="0" name="type" type="int" enum="RichTextLabel.ListType">
+ <argument index="0" name="level" type="int">
+ </argument>
+ <argument index="1" name="type" type="int" enum="RichTextLabel.ListType">
+ </argument>
+ <argument index="2" name="capitalize" type="bool">
</argument>
<description>
- Adds a [code][list][/code] tag to the tag stack. Similar to the BBCodes [code][ol][/code] or [code][ul][/code], but supports more list types. Not fully implemented!
+ Adds [code][ol][/code] or [code][ul][/code] tag to the tag stack. Multiplies [code]level[/code] by current [member tab_size] to determine new margin length.
</description>
</method>
<method name="push_meta">
@@ -225,6 +243,39 @@
Adds a [code][font][/code] tag with a normal font to the tag stack.
</description>
</method>
+ <method name="push_outline_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ Adds a [code][outline_color][/code] tag to the tag stack. Adds text outline for its duration.
+ </description>
+ </method>
+ <method name="push_outline_size">
+ <return type="void">
+ </return>
+ <argument index="0" name="outline_size" type="int">
+ </argument>
+ <description>
+ Adds a [code][outline_size][/code] tag to the tag stack. Overrides default text outline size for its duration.
+ </description>
+ </method>
+ <method name="push_paragraph">
+ <return type="void">
+ </return>
+ <argument index="0" name="align" type="int" enum="RichTextLabel.Align">
+ </argument>
+ <argument index="1" name="base_direction" type="int" enum="Control.TextDirection" default="0">
+ </argument>
+ <argument index="2" name="language" type="String" default="&quot;&quot;">
+ </argument>
+ <argument index="3" name="st_parser" type="int" enum="Control.StructuredTextParser" default="0">
+ </argument>
+ <description>
+ Adds a [code][p][/code] tag to the tag stack.
+ </description>
+ </method>
<method name="push_strikethrough">
<return type="void">
</return>
@@ -237,8 +288,10 @@
</return>
<argument index="0" name="columns" type="int">
</argument>
+ <argument index="1" name="inline_align" type="int" enum="VAlign" default="0">
+ </argument>
<description>
- Adds a [code][table=columns][/code] tag to the tag stack.
+ Adds a [code][table=columns,inline_align][/code] tag to the tag stack.
</description>
</method>
<method name="push_underline">
@@ -267,6 +320,46 @@
Scrolls the window's top line to match [code]line[/code].
</description>
</method>
+ <method name="set_cell_border_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ Sets color of a table cell border.
+ </description>
+ </method>
+ <method name="set_cell_padding">
+ <return type="void">
+ </return>
+ <argument index="0" name="padding" type="Rect2">
+ </argument>
+ <description>
+ Sets inner padding of a table cell.
+ </description>
+ </method>
+ <method name="set_cell_row_background_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="odd_row_bg" type="Color">
+ </argument>
+ <argument index="1" name="even_row_bg" type="Color">
+ </argument>
+ <description>
+ Sets color of a table cell. Separate colors for alternating rows can be specified.
+ </description>
+ </method>
+ <method name="set_cell_size_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="min_size" type="Vector2">
+ </argument>
+ <argument index="1" name="max_size" type="Vector2">
+ </argument>
+ <description>
+ Sets minimum and maximum size overrides for a table cell.
+ </description>
+ </method>
<method name="set_table_column_expand">
<return type="void">
</return>
@@ -289,7 +382,7 @@
</member>
<member name="bbcode_text" type="String" setter="set_bbcode" getter="get_bbcode" default="&quot;&quot;">
The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited.
- [b]Note:[/b] It is unadvised to use [code]+=[/code] operator with [code]bbcode_text[/code] (e.g. [code]bbcode_text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_bbcode] for adding text instead.
+ [b]Note:[/b] It is unadvised to use the [code]+=[/code] operator with [code]bbcode_text[/code] (e.g. [code]bbcode_text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. Use [method append_bbcode] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
</member>
<member name="custom_effects" type="Array" setter="set_effects" getter="get_effects" default="[ ]">
The currently installed custom effects. This is an array of [RichTextEffect]s.
@@ -299,6 +392,9 @@
If [code]true[/code], the label's height will be automatically updated to fit its content.
[b]Note:[/b] This property is used as a workaround to fix issues with [RichTextLabel] in [Container]s, but it's unreliable in some cases and will be removed in future versions.
</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">
If [code]true[/code], the label underlines meta tags such as [code][url]{text}[/url][/code].
</member>
@@ -319,6 +415,12 @@
<member name="selection_enabled" type="bool" setter="set_selection_enabled" getter="is_selection_enabled" default="false">
If [code]true[/code], the label allows text selection.
</member>
+ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
+ Set BiDi algorithm override for the structured text.
+ </member>
+ <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]">
+ Set additional options for BiDi override.
+ </member>
<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>
@@ -326,6 +428,9 @@
The raw text of the label.
When set, clears the tag stack and adds a raw text tag to the top of it. Does not parse BBCodes. Does not modify [member bbcode_text].
</member>
+ <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="visible_characters" type="int" setter="set_visible_characters" getter="get_visible_characters" default="-1">
The restricted number of characters to display in the label. If [code]-1[/code], all characters will be displayed.
</member>
@@ -372,7 +477,10 @@
<constant name="LIST_LETTERS" value="1" enum="ListType">
Each list item has a letter marker.
</constant>
- <constant name="LIST_DOTS" value="2" enum="ListType">
+ <constant name="LIST_ROMAN" value="2" enum="ListType">
+ Each list item has a roman number marker.
+ </constant>
+ <constant name="LIST_DOTS" value="3" enum="ListType">
Each list item has a filled circle marker.
</constant>
<constant name="ITEM_FRAME" value="0" enum="ItemType">
@@ -385,42 +493,56 @@
</constant>
<constant name="ITEM_FONT" value="4" enum="ItemType">
</constant>
- <constant name="ITEM_COLOR" value="5" enum="ItemType">
+ <constant name="ITEM_FONT_SIZE" value="5" enum="ItemType">
+ </constant>
+ <constant name="ITEM_FONT_FEATURES" value="6" enum="ItemType">
</constant>
- <constant name="ITEM_UNDERLINE" value="6" enum="ItemType">
+ <constant name="ITEM_COLOR" value="7" enum="ItemType">
</constant>
- <constant name="ITEM_STRIKETHROUGH" value="7" enum="ItemType">
+ <constant name="ITEM_OUTLINE_SIZE" value="8" enum="ItemType">
</constant>
- <constant name="ITEM_ALIGN" value="8" enum="ItemType">
+ <constant name="ITEM_OUTLINE_COLOR" value="9" enum="ItemType">
</constant>
- <constant name="ITEM_INDENT" value="9" enum="ItemType">
+ <constant name="ITEM_UNDERLINE" value="10" enum="ItemType">
</constant>
- <constant name="ITEM_LIST" value="10" enum="ItemType">
+ <constant name="ITEM_STRIKETHROUGH" value="11" enum="ItemType">
</constant>
- <constant name="ITEM_TABLE" value="11" enum="ItemType">
+ <constant name="ITEM_PARAGRAPH" value="12" enum="ItemType">
</constant>
- <constant name="ITEM_FADE" value="12" enum="ItemType">
+ <constant name="ITEM_INDENT" value="13" enum="ItemType">
</constant>
- <constant name="ITEM_SHAKE" value="13" enum="ItemType">
+ <constant name="ITEM_LIST" value="14" enum="ItemType">
</constant>
- <constant name="ITEM_WAVE" value="14" enum="ItemType">
+ <constant name="ITEM_TABLE" value="15" enum="ItemType">
</constant>
- <constant name="ITEM_TORNADO" value="15" enum="ItemType">
+ <constant name="ITEM_FADE" value="16" enum="ItemType">
</constant>
- <constant name="ITEM_RAINBOW" value="16" enum="ItemType">
+ <constant name="ITEM_SHAKE" value="17" enum="ItemType">
</constant>
- <constant name="ITEM_CUSTOMFX" value="18" enum="ItemType">
+ <constant name="ITEM_WAVE" value="18" enum="ItemType">
</constant>
- <constant name="ITEM_META" value="17" enum="ItemType">
+ <constant name="ITEM_TORNADO" value="19" enum="ItemType">
+ </constant>
+ <constant name="ITEM_RAINBOW" value="20" enum="ItemType">
+ </constant>
+ <constant name="ITEM_CUSTOMFX" value="22" enum="ItemType">
+ </constant>
+ <constant name="ITEM_META" value="21" enum="ItemType">
</constant>
</constants>
<theme_items>
<theme_item name="bold_font" type="Font">
The font used for bold text.
</theme_item>
+ <theme_item name="bold_font_size" type="int">
+ The font size used for bold text.
+ </theme_item>
<theme_item name="bold_italics_font" type="Font">
The font used for bold italics text.
</theme_item>
+ <theme_item name="bold_italics_font_size" type="int">
+ The font size used for bold italics text.
+ </theme_item>
<theme_item name="default_color" type="Color" default="Color( 1, 1, 1, 1 )">
The default text color.
</theme_item>
@@ -436,18 +558,27 @@
<theme_item name="italics_font" type="Font">
The font used for italics text.
</theme_item>
+ <theme_item name="italics_font_size" type="int">
+ The font size used for italics text.
+ </theme_item>
<theme_item name="line_separation" type="int" default="1">
The vertical space between lines.
</theme_item>
<theme_item name="mono_font" type="Font">
The font used for monospace text.
</theme_item>
+ <theme_item name="mono_font_size" type="int">
+ The font size used for monospace text.
+ </theme_item>
<theme_item name="normal" type="StyleBox">
The normal background for the [RichTextLabel].
</theme_item>
<theme_item name="normal_font" type="Font">
The default text font.
</theme_item>
+ <theme_item name="normal_font_size" type="int">
+ The default text font size.
+ </theme_item>
<theme_item name="selection_color" type="Color" default="Color( 0.1, 0.1, 1, 0.8 )">
The color of the selection box.
</theme_item>
@@ -460,9 +591,18 @@
<theme_item name="shadow_offset_y" type="int" default="1">
The vertical offset of the font's shadow.
</theme_item>
+ <theme_item name="table_border" type="Color" default="Color( 0, 0, 0, 0 )">
+ The default cell border color.
+ </theme_item>
+ <theme_item name="table_even_row_bg" type="Color" default="Color( 0, 0, 0, 0 )">
+ The default background color for even rows.
+ </theme_item>
<theme_item name="table_hseparation" type="int" default="3">
The horizontal separation of elements in a table.
</theme_item>
+ <theme_item name="table_odd_row_bg" type="Color" default="Color( 0, 0, 0, 0 )">
+ The default background color for odd rows.
+ </theme_item>
<theme_item name="table_vseparation" type="int" default="3">
The vertical separation of elements in a table.
</theme_item>
diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml
index f3d43b193e..2a0b44f3f3 100644
--- a/doc/classes/RigidBody2D.xml
+++ b/doc/classes/RigidBody2D.xml
@@ -12,6 +12,8 @@
The center of mass is always located at the node's origin without taking into account the [CollisionShape2D] centroid offsets.
</description>
<tutorials>
+ <link title="2D Physics Platformer Demo">https://godotengine.org/asset-library/asset/119</link>
+ <link title="Instancing Demo">https://godotengine.org/asset-library/asset/148</link>
</tutorials>
<methods>
<method name="_integrate_forces" qualifiers="virtual">
@@ -117,6 +119,7 @@
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="-1.0">
Damps the body's [member angular_velocity]. If [code]-1[/code], the body will use the [b]Default Angular Damp[/b] defined in [b]Project &gt; Project Settings &gt; Physics &gt; 2d[/b].
+ See [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping.
</member>
<member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity" default="0.0">
The body's rotational velocity.
@@ -136,7 +139,7 @@
</member>
<member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" default="0">
The maximum number of contacts that will be recorded. Requires [member contact_monitor] to be set to [code]true[/code].
- [b]Note:[/b] The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner).
+ [b]Note:[/b] The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end).
</member>
<member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" enum="RigidBody2D.CCDMode" default="0">
Continuous collision detection mode.
@@ -153,6 +156,7 @@
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="-1.0">
Damps the body's [member linear_velocity]. If [code]-1[/code], the body will use the [b]Default Linear Damp[/b] in [b]Project &gt; Project Settings &gt; Physics &gt; 2d[/b].
+ See [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping.
</member>
<member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2( 0, 0 )">
The body's linear velocity.
@@ -170,9 +174,6 @@
<member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false">
If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method add_force] methods.
</member>
- <member name="weight" type="float" setter="set_weight" getter="get_weight" default="9.8">
- The body's weight based on its mass and the [b]Default Gravity[/b] value in [b]Project &gt; Project Settings &gt; Physics &gt; 2d[/b].
- </member>
</members>
<signals>
<signal name="body_entered">
diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml
index e9ebf33aa7..21321d4de0 100644
--- a/doc/classes/RigidBody3D.xml
+++ b/doc/classes/RigidBody3D.xml
@@ -12,6 +12,8 @@
</description>
<tutorials>
<link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
+ <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
<method name="_integrate_forces" qualifiers="virtual">
@@ -132,6 +134,7 @@
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="-1.0">
Damps RigidBody3D's rotational forces.
+ See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping.
</member>
<member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3( 0, 0, 0 )">
RigidBody3D's rotational velocity.
@@ -177,6 +180,7 @@
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="-1.0">
The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0, any linear damp derived from the world or areas will be overridden.
+ See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping.
</member>
<member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3( 0, 0, 0 )">
The body's linear velocity. Can be used sporadically, but [b]don't set this every frame[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state.
@@ -194,9 +198,6 @@
<member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false">
If [code]true[/code], the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method add_force] methods.
</member>
- <member name="weight" type="float" setter="set_weight" getter="get_weight" default="9.8">
- The body's weight based on its mass and the global 3D gravity. Global values are set in [b]Project &gt; Project Settings &gt; Physics &gt; 3d[/b].
- </member>
</members>
<signals>
<signal name="body_entered">
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index 4ea457047f..a95ce6c663 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -181,7 +181,7 @@
<argument index="0" name="exit_code" type="int" default="-1">
</argument>
<description>
- Quits the application. A process [code]exit_code[/code] can optionally be passed as an argument. If this argument is [code]0[/code] or greater, it will override the [member OS.exit_code] defined before quitting the application.
+ Quits the application at the end of the current iteration. A process [code]exit_code[/code] can optionally be passed as an argument. If this argument is [code]0[/code] or greater, it will override the [member OS.exit_code] defined before quitting the application.
</description>
</method>
<method name="reload_current_scene">
diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml
index 20b0750431..d5a32dd20c 100644
--- a/doc/classes/ScriptEditor.xml
+++ b/doc/classes/ScriptEditor.xml
@@ -86,6 +86,7 @@
<argument index="1" name="base_path" type="String">
</argument>
<description>
+ Opens the script create dialog. The script will extend [code]base_name[/code]. The file extension can be omitted from [code]base_path[/code]. It will be added based on the selected scripting language.
</description>
</method>
<method name="register_syntax_highlighter">
diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml
index 1a05c02b60..b7a2258fc1 100644
--- a/doc/classes/Signal.xml
+++ b/doc/classes/Signal.xml
@@ -8,15 +8,31 @@
<tutorials>
</tutorials>
<methods>
- <method name="Signal">
+ <method name="Signal" qualifiers="constructor">
+ <return type="Signal">
+ </return>
+ <description>
+ Constructs a null [Signal] with no object nor signal name bound.
+ </description>
+ </method>
+ <method name="Signal" qualifiers="constructor">
+ <return type="Signal">
+ </return>
+ <argument index="0" name="from" type="Signal">
+ </argument>
+ <description>
+ Constructs a [Signal] as a copy of the given [Signal].
+ </description>
+ </method>
+ <method name="Signal" qualifiers="constructor">
<return type="Signal">
</return>
<argument index="0" name="object" type="Object">
</argument>
- <argument index="1" name="signal_name" type="StringName">
+ <argument index="1" name="signal" type="StringName">
</argument>
<description>
- Creates a new signal named [code]signal_name[/code] in the given object.
+ Creates a new [Signal] with the name [code]signal[/code] in the specified [code]object[/code].
</description>
</method>
<method name="connect">
@@ -33,7 +49,7 @@
</description>
</method>
<method name="disconnect">
- <return type="Variant">
+ <return type="void">
</return>
<argument index="0" name="callable" type="Callable">
</argument>
@@ -91,6 +107,22 @@
<description>
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Signal">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Signal">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml
index 7ec8fe12fb..fe2cc1f5ad 100644
--- a/doc/classes/Skeleton3D.xml
+++ b/doc/classes/Skeleton3D.xml
@@ -9,6 +9,8 @@
Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone.
</description>
<tutorials>
+ <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="add_bone">
diff --git a/doc/classes/SkeletonIK3D.xml b/doc/classes/SkeletonIK3D.xml
index de83847403..5193109447 100644
--- a/doc/classes/SkeletonIK3D.xml
+++ b/doc/classes/SkeletonIK3D.xml
@@ -5,6 +5,7 @@
<description>
</description>
<tutorials>
+ <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link>
</tutorials>
<methods>
<method name="get_parent_skeleton" qualifiers="const">
diff --git a/doc/classes/SphereShape3D.xml b/doc/classes/SphereShape3D.xml
index 1eaf890639..e90493fca2 100644
--- a/doc/classes/SphereShape3D.xml
+++ b/doc/classes/SphereShape3D.xml
@@ -7,6 +7,7 @@
Sphere shape for 3D collisions, which can be set into a [PhysicsBody3D] or [Area3D]. This shape is useful for modeling sphere-like 3D objects.
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/SpotLight3D.xml b/doc/classes/SpotLight3D.xml
index fc849baa8d..f868503bbd 100644
--- a/doc/classes/SpotLight3D.xml
+++ b/doc/classes/SpotLight3D.xml
@@ -8,6 +8,7 @@
</description>
<tutorials>
<link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml
index f218631038..c56596423d 100644
--- a/doc/classes/Sprite2D.xml
+++ b/doc/classes/Sprite2D.xml
@@ -7,6 +7,7 @@
A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation.
</description>
<tutorials>
+ <link title="Instancing Demo">https://godotengine.org/asset-library/asset/148</link>
</tutorials>
<methods>
<method name="get_rect" qualifiers="const">
@@ -52,10 +53,6 @@
<member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1">
The number of columns in the sprite sheet.
</member>
- <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
- The normal map gives depth to the Sprite2D.
- [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
- </member>
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
The texture's drawing offset.
</member>
@@ -68,15 +65,6 @@
<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].
</member>
- <member name="shininess" type="float" setter="set_shininess" getter="get_shininess" default="1.0">
- Strength of the specular light effect of this [Sprite2D].
- </member>
- <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color( 1, 1, 1, 1 )">
- The color of the specular light effect.
- </member>
- <member name="specular_map" type="Texture2D" setter="set_specular_map" getter="get_specular_map">
- The specular map is used for more control on the shininess effect.
- </member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
[Texture2D] object to draw.
</member>
diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml
index 934471c445..f9b947fa3d 100644
--- a/doc/classes/Sprite3D.xml
+++ b/doc/classes/Sprite3D.xml
@@ -4,8 +4,7 @@
2D sprite node in a 3D world.
</brief_description>
<description>
- A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation.
- [b]Note:[/b] There are [url=https://github.com/godotengine/godot/issues/20855]known performance issues[/url] when using [Sprite3D]. Consider using a [MeshInstance3D] with a [QuadMesh] as the mesh instead. You can still have billboarding by enabling billboard properties in the QuadMesh's [StandardMaterial3D].
+ A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. See also [SpriteBase3D] where properties such as the billboard mode are defined.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml
index 479dc5f94c..44b08408c1 100644
--- a/doc/classes/SpriteBase3D.xml
+++ b/doc/classes/SpriteBase3D.xml
@@ -4,7 +4,7 @@
2D sprite node in 3D environment.
</brief_description>
<description>
- A node that displays 2D texture information in a 3D environment.
+ A node that displays 2D texture information in a 3D environment. See also [Sprite3D] where many other properties are defined.
</description>
<tutorials>
</tutorials>
@@ -13,6 +13,7 @@
<return type="TriangleMesh">
</return>
<description>
+ Returns a [TriangleMesh] with the sprite's vertices following its current configuration (such as its [member axis] and [member pixel_size]).
</description>
</method>
<method name="get_draw_flag" qualifiers="const">
@@ -39,17 +40,19 @@
<argument index="1" name="enabled" type="bool">
</argument>
<description>
- If [code]true[/code], the specified flag will be enabled.
+ If [code]true[/code], the specified flag will be enabled. See [enum SpriteBase3D.DrawFlags] for a list of flags.
</description>
</method>
</methods>
<members>
<member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="SpriteBase3D.AlphaCutMode" default="0">
+ The alpha cutting mode to use for the sprite. See [enum AlphaCutMode] for possible values.
</member>
<member name="axis" type="int" setter="set_axis" getter="get_axis" enum="Vector3.Axis" default="2">
The direction in which the front of the texture faces.
</member>
<member name="billboard" type="int" setter="set_billboard_mode" getter="get_billboard_mode" enum="BaseMaterial3D.BillboardMode" default="0">
+ The billboard mode to use for the sprite. See [enum BaseMaterial3D.BillboardMode] for possible values.
</member>
<member name="centered" type="bool" setter="set_centered" getter="is_centered" default="true">
If [code]true[/code], texture will be centered.
@@ -90,16 +93,19 @@
If set, lights in the environment affect the sprite.
</constant>
<constant name="FLAG_DOUBLE_SIDED" value="2" enum="DrawFlags">
- If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind.
+ If set, texture can be seen from the back as well. If not, the texture is invisible when looking at it from behind.
</constant>
<constant name="FLAG_MAX" value="3" enum="DrawFlags">
Represents the size of the [enum DrawFlags] enum.
</constant>
<constant name="ALPHA_CUT_DISABLED" value="0" enum="AlphaCutMode">
+ This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping.
</constant>
<constant name="ALPHA_CUT_DISCARD" value="1" enum="AlphaCutMode">
+ This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [member ProjectSettings.rendering/quality/screen_filters/screen_space_aa]). On the bright side, this mode doesn't suffer from transparency sorting issues when multiple transparent materials are overlapping. This mode is also known as [i]alpha testing[/i] or [i]1-bit transparency[/i].
</constant>
<constant name="ALPHA_CUT_OPAQUE_PREPASS" value="2" enum="AlphaCutMode">
+ This mode draws fully opaque pixels in the depth prepass. This is slower than [constant ALPHA_CUT_DISABLED] or [constant ALPHA_CUT_DISCARD], but it allows displaying translucent areas and smooth edges while using proper sorting.
</constant>
</constants>
</class>
diff --git a/doc/classes/StaticBody3D.xml b/doc/classes/StaticBody3D.xml
index c896efc314..63a15cbe1d 100644
--- a/doc/classes/StaticBody3D.xml
+++ b/doc/classes/StaticBody3D.xml
@@ -8,6 +8,9 @@
Additionally, a constant linear or angular velocity can be set for the static body, so even if it doesn't move, it affects other bodies as if it was moving (this is useful for simulating conveyor belts or conveyor wheels).
</description>
<tutorials>
+ <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/StreamPeerTCP.xml b/doc/classes/StreamPeerTCP.xml
index dbd53f8ba0..bb85d94bf9 100644
--- a/doc/classes/StreamPeerTCP.xml
+++ b/doc/classes/StreamPeerTCP.xml
@@ -52,7 +52,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if this peer is currently connected to a host, [code]false[/code] otherwise.
+ Returns [code]true[/code] if this peer is currently connected or is connecting to a host, [code]false[/code] otherwise.
</description>
</method>
<method name="set_no_delay">
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 40fff25fc4..4ee9dbf1f9 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -10,160 +10,23 @@
<link title="GDScript format strings">https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_format_string.html</link>
</tutorials>
<methods>
- <method name="String">
+ <method name="String" qualifiers="constructor">
<return type="String">
</return>
- <argument index="0" name="from" type="bool">
- </argument>
<description>
- Constructs a new String from the given [bool].
+ Constructs an empty [String] ([code]""[/code]).
</description>
</method>
- <method name="String">
+ <method name="String" qualifiers="constructor">
<return type="String">
</return>
- <argument index="0" name="from" type="int">
+ <argument index="0" name="from" type="String">
</argument>
<description>
- Constructs a new String from the given [int].
+ Constructs a [String] as a copy of the given [String].
</description>
</method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="float">
- </argument>
- <description>
- Constructs a new String from the given [float].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Vector2">
- </argument>
- <description>
- Constructs a new String from the given [Vector2].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Vector2i">
- </argument>
- <description>
- Constructs a new String from the given [Vector2i].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Rect2">
- </argument>
- <description>
- Constructs a new String from the given [Rect2].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Rect2i">
- </argument>
- <description>
- Constructs a new String from the given [Rect2i].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Vector3">
- </argument>
- <description>
- Constructs a new String from the given [Vector3].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Vector3i">
- </argument>
- <description>
- Constructs a new String from the given [Vector3i].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Transform2D">
- </argument>
- <description>
- Constructs a new String from the given [Transform2D].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Plane">
- </argument>
- <description>
- Constructs a new String from the given [Plane].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Quat">
- </argument>
- <description>
- Constructs a new String from the given [Quat].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="AABB">
- </argument>
- <description>
- Constructs a new String from the given [AABB].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Basis">
- </argument>
- <description>
- Constructs a new String from the given [Basis].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Transform">
- </argument>
- <description>
- Constructs a new String from the given [Transform].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Color">
- </argument>
- <description>
- Constructs a new String from the given [Color].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="StringName">
- </argument>
- <description>
- Constructs a new String from the given [StringName].
- </description>
- </method>
- <method name="String">
+ <method name="String" qualifiers="constructor">
<return type="String">
</return>
<argument index="0" name="from" type="NodePath">
@@ -172,130 +35,13 @@
Constructs a new String from the given [NodePath].
</description>
</method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="RID">
- </argument>
- <description>
- Constructs a new String from the given [RID].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Callable">
- </argument>
- <description>
- Constructs a new String from the given [Callable].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Signal">
- </argument>
- <description>
- Constructs a new String from the given [Signal].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Dictionary">
- </argument>
- <description>
- Constructs a new String from the given [Dictionary].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="Array">
- </argument>
- <description>
- Constructs a new String from the given [Array].
- </description>
- </method>
- <method name="String">
+ <method name="String" qualifiers="constructor">
<return type="String">
</return>
- <argument index="0" name="from" type="PackedByteArray">
- </argument>
- <description>
- Constructs a new String from the given [PackedByteArray].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedInt32Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedInt32Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedInt64Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedInt64Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedFloat32Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedFloat32Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedFloat64Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedFloat64Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedStringArray">
- </argument>
- <description>
- Constructs a new String from the given [PackedStringArray].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedVector2Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedVector2Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedVector3Array">
- </argument>
- <description>
- Constructs a new String from the given [PackedVector3Array].
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
- <argument index="0" name="from" type="PackedColorArray">
+ <argument index="0" name="from" type="StringName">
</argument>
<description>
- Constructs a new String from the given [PackedColorArray].
+ Constructs a new String from the given [StringName].
</description>
</method>
<method name="begins_with">
@@ -314,6 +60,14 @@
Returns the bigrams (pairs of consecutive letters) of this string.
</description>
</method>
+ <method name="bin_to_int">
+ <return type="int">
+ </return>
+ <argument index="0" name="with_prefix" type="bool" default="true">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="c_escape">
<return type="String">
</return>
@@ -342,7 +96,10 @@
<argument index="0" name="to" type="String">
</argument>
<description>
- Performs a case-sensitive comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal.
+ Performs a case-sensitive comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/code] of each string, which roughly matches the alphabetical order.
+ [b]Behavior with different string lengths:[/b] Returns [code]1[/code] if the "base" string is longer than the [code]to[/code] string or [code]-1[/code] if the "base" string is shorter than the [code]to[/code] string. Keep in mind this length is determined by the number of Unicode codepoints, [i]not[/i] the actual visible characters.
+ [b]Behavior with empty strings:[/b] Returns [code]-1[/code] if the "base" string is empty, [code]1[/code] if the [code]to[/code] string is empty or [code]0[/code] if both strings are empty.
+ To get a boolean result from a string comparison, use the [code]==[/code] operator instead. See also [method nocasecmp_to] and [method naturalnocasecmp_to].
</description>
</method>
<method name="count">
@@ -394,17 +151,6 @@
Returns [code]true[/code] if the string ends with the given string.
</description>
</method>
- <method name="erase">
- <return type="void">
- </return>
- <argument index="0" name="position" type="int">
- </argument>
- <argument index="1" name="chars" type="int">
- </argument>
- <description>
- Erases [code]chars[/code] characters from the string starting from [code]position[/code].
- </description>
- </method>
<method name="find">
<return type="int">
</return>
@@ -482,10 +228,13 @@
<method name="hex_to_int">
<return type="int">
</return>
+ <argument index="0" name="with_prefix" type="bool" default="true">
+ </argument>
<description>
- Converts a string containing a hexadecimal number into an integer. Hexadecimal strings are expected to be prefixed with "[code]0x[/code]" otherwise [code]0[/code] is returned.
+ Converts a string containing a hexadecimal number into a decimal integer. If [code]with_prefix[/code] is [code]true[/code], the hexadecimal string should start with the [code]0x[/code] prefix, otherwise [code]0[/code] is returned.
[codeblock]
print("0xff".hex_to_int()) # Print "255"
+ print("ab".hex_to_int(false)) # Print "171"
[/codeblock]
</description>
</method>
@@ -509,20 +258,6 @@
[/codeblock]
</description>
</method>
- <method name="humanize_size">
- <return type="String">
- </return>
- <argument index="0" name="size" type="int">
- </argument>
- <description>
- Converts [code]size[/code] represented as number of bytes to human-readable format using internationalized set of data size units, namely: B, KiB, MiB, GiB, TiB, PiB, EiB. Note that the next smallest unit is picked automatically to hold at most 1024 units.
- [codeblock]
- var bytes = 133790307
- var size = String.humanize_size(bytes)
- print(size) # prints "127.5 MiB"
- [/codeblock]
- </description>
- </method>
<method name="insert">
<return type="String">
</return>
@@ -615,7 +350,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if this string contains a valid IP address.
+ Returns [code]true[/code] if this string contains only 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] as valid.
</description>
</method>
<method name="join">
@@ -712,7 +447,11 @@
<argument index="0" name="to" type="String">
</argument>
<description>
- Performs a case-insensitive natural order comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal.
+ Performs a case-insensitive [i]natural order[/i] comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/code] of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison.
+ When used for sorting, natural order comparison will order suites of numbers as expected by most people. If you sort the numbers from 1 to 10 using natural order, you will get [code][1, 2, 3, ...][/code] instead of [code][1, 10, 2, 3, ...][/code].
+ [b]Behavior with different string lengths:[/b] Returns [code]1[/code] if the "base" string is longer than the [code]to[/code] string or [code]-1[/code] if the "base" string is shorter than the [code]to[/code] string. Keep in mind this length is determined by the number of Unicode codepoints, [i]not[/i] the actual visible characters.
+ [b]Behavior with empty strings:[/b] Returns [code]-1[/code] if the "base" string is empty, [code]1[/code] if the [code]to[/code] string is empty or [code]0[/code] if both strings are empty.
+ To get a boolean result from a string comparison, use the [code]==[/code] operator instead. See also [method nocasecmp_to] and [method casecmp_to].
</description>
</method>
<method name="nocasecmp_to">
@@ -721,7 +460,90 @@
<argument index="0" name="to" type="String">
</argument>
<description>
- Performs a case-insensitive comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal.
+ Performs a case-insensitive comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or [code]0[/code] if equal. "less than" or "greater than" are determined by the [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/code] of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison.
+ [b]Behavior with different string lengths:[/b] Returns [code]1[/code] if the "base" string is longer than the [code]to[/code] string or [code]-1[/code] if the "base" string is shorter than the [code]to[/code] string. Keep in mind this length is determined by the number of Unicode codepoints, [i]not[/i] the actual visible characters.
+ [b]Behavior with empty strings:[/b] Returns [code]-1[/code] if the "base" string is empty, [code]1[/code] if the [code]to[/code] string is empty or [code]0[/code] if both strings are empty.
+ To get a boolean result from a string comparison, use the [code]==[/code] operator instead. See also [method casecmp_to] and [method naturalnocasecmp_to].
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="StringName">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="String">
+ </return>
+ <argument index="0" name="right" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="String">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="StringName">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
</description>
</method>
<method name="ord_at">
@@ -980,11 +802,11 @@
Returns part of the string from the position [code]from[/code] with length [code]len[/code]. Argument [code]len[/code] is optional and using [code]-1[/code] will return remaining characters from given position.
</description>
</method>
- <method name="to_ascii">
+ <method name="to_ascii_buffer">
<return type="PackedByteArray">
</return>
<description>
- Converts the String (which is a character array) to ASCII/Latin-1 encoded [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8], as this method assumes that all the characters in the String are ASCII/Latin-1 characters, unsupported characters are replaced with spaces.
+ Converts the String (which is a character array) to ASCII/Latin-1 encoded [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8_buffer], as this method assumes that all the characters in the String are ASCII/Latin-1 characters, unsupported characters are replaced with spaces.
</description>
</method>
<method name="to_float">
@@ -1015,25 +837,25 @@
Returns the string converted to uppercase.
</description>
</method>
- <method name="to_utf16">
+ <method name="to_utf16_buffer">
<return type="PackedByteArray">
</return>
<description>
Converts the String (which is an array of characters) to UTF-16 encoded [PackedByteArray] (which is an array of bytes).
</description>
</method>
- <method name="to_utf32">
+ <method name="to_utf32_buffer">
<return type="PackedByteArray">
</return>
<description>
Converts the String (which is an array of characters) to UTF-32 encoded [PackedByteArray] (which is an array of bytes).
</description>
</method>
- <method name="to_utf8">
+ <method name="to_utf8_buffer">
<return type="PackedByteArray">
</return>
<description>
- Converts the String (which is an array of characters) to UTF-8 encode [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii].
+ Converts the String (which is an array of characters) to UTF-8 encode [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii_buffer], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii_buffer].
</description>
</method>
<method name="trim_prefix">
@@ -1057,8 +879,10 @@
<method name="xml_escape">
<return type="String">
</return>
+ <argument index="0" name="escape_quotes" type="bool" default="false">
+ </argument>
<description>
- Returns a copy of the string with special characters escaped using the XML standard.
+ Returns a copy of the string with special characters escaped using the XML standard. If [code]escape_quotes[/code] is [code]true[/code], the single quote ([code]'[/code]) and double quote ([code]"[/code]) characters are also escaped.
</description>
</method>
<method name="xml_unescape">
diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml
index 5d8ac6fdcc..af0074f080 100644
--- a/doc/classes/StringName.xml
+++ b/doc/classes/StringName.xml
@@ -9,7 +9,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="StringName">
+ <method name="StringName" qualifiers="constructor">
+ <return type="StringName">
+ </return>
+ <description>
+ Constructs an empty [StringName].
+ </description>
+ </method>
+ <method name="StringName" qualifiers="constructor">
+ <return type="StringName">
+ </return>
+ <argument index="0" name="from" type="StringName">
+ </argument>
+ <description>
+ Constructs a [StringName] as a copy of the given [StringName].
+ </description>
+ </method>
+ <method name="StringName" qualifiers="constructor">
<return type="StringName">
</return>
<argument index="0" name="from" type="String">
@@ -18,6 +34,38 @@
Creates a new [StringName] from the given [String].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="StringName">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="StringName">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/StyleBox.xml b/doc/classes/StyleBox.xml
index 0e848a1bf6..04f8eb9d13 100644
--- a/doc/classes/StyleBox.xml
+++ b/doc/classes/StyleBox.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
StyleBox is [Resource] that provides an abstract base class for drawing stylized boxes for the UI. StyleBoxes are used for drawing the styles of buttons, line edit backgrounds, tree backgrounds, etc. and also for testing a transparency mask for pointer signals. If mask test fails on a StyleBox assigned as mask to a control, clicks and motion signals will go through it to the one below.
+ [b]Note:[/b] For children of [Control] that have [i]Theme Properties[/i], the [code]focus[/code] [StyleBox] is displayed over the [code]normal[/code], [code]hover[/code] or [code]pressed[/code] [StyleBox]. This makes the [code]focus[/code] [StyleBox] more reusable across different nodes.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml
index f8aa14cb2b..6f5577b61b 100644
--- a/doc/classes/StyleBoxTexture.xml
+++ b/doc/classes/StyleBoxTexture.xml
@@ -119,10 +119,6 @@
<member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )">
Modulates the color of the texture when this style box is drawn.
</member>
- <member name="normal_map" type="Texture2D" setter="set_normal_map" getter="get_normal_map">
- The normal map to use when drawing this style box.
- [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
- </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.
diff --git a/doc/classes/SubViewport.xml b/doc/classes/SubViewport.xml
index c9c7589631..376082f417 100644
--- a/doc/classes/SubViewport.xml
+++ b/doc/classes/SubViewport.xml
@@ -1,10 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SubViewport" inherits="Viewport" version="4.0">
<brief_description>
+ Creates a sub-view into the screen.
</brief_description>
<description>
</description>
<tutorials>
+ <link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
+ <link title="Viewports tutorial index">https://docs.godotengine.org/en/latest/tutorials/viewports/index.html</link>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
+ <link title="3D in 2D Demo">https://godotengine.org/asset-library/asset/128</link>
+ <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link>
+ <link title="Screen Capture Demo">https://godotengine.org/asset-library/asset/130</link>
+ <link title="Dynamic Split Screen Demo">https://godotengine.org/asset-library/asset/541</link>
+ <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link>
</tutorials>
<methods>
</methods>
@@ -36,8 +45,8 @@
<constant name="CLEAR_MODE_NEVER" value="1" enum="ClearMode">
Never clear the render target.
</constant>
- <constant name="CLEAR_MODE_ONLY_NEXT_FRAME" value="2" enum="ClearMode">
- Clear the render target next frame, then switch to [constant CLEAR_MODE_NEVER].
+ <constant name="CLEAR_MODE_ONCE" value="2" enum="ClearMode">
+ Clear the render target on the next frame, then switch to [constant CLEAR_MODE_NEVER].
</constant>
<constant name="UPDATE_DISABLED" value="0" enum="UpdateMode">
Do not update the render target.
@@ -49,7 +58,7 @@
Update the render target only when it is visible. This is the default value.
</constant>
<constant name="UPDATE_WHEN_PARENT_VISIBLE" value="3" enum="UpdateMode">
- Update the render target only when the its parent is visible.
+ Update the render target only when its parent is visible.
</constant>
<constant name="UPDATE_ALWAYS" value="4" enum="UpdateMode">
Always update the render target.
diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml
index eeb6b6cd9d..82ffe86251 100644
--- a/doc/classes/SurfaceTool.xml
+++ b/doc/classes/SurfaceTool.xml
@@ -8,37 +8,20 @@
[codeblock]
var st = SurfaceTool.new()
st.begin(Mesh.PRIMITIVE_TRIANGLES)
- st.add_color(Color(1, 0, 0))
- st.add_uv(Vector2(0, 0))
- st.add_vertex(Vector3(0, 0, 0))
+ st.set_color(Color(1, 0, 0))
+ st.set_uv(Vector2(0, 0))
+ st.set_vertex(Vector3(0, 0, 0))
[/codeblock]
- The above [SurfaceTool] now contains one vertex of a triangle which has a UV coordinate and a specified [Color]. If another vertex were added without calling [method add_uv] or [method add_color], then the last values would be used.
+ The above [SurfaceTool] now contains one vertex of a triangle which has a UV coordinate and a specified [Color]. If another vertex were added without calling [method set_uv] or [method set_color], then the last values would be used.
Vertex attributes must be passed [b]before[/b] calling [method add_vertex]. Failure to do so will result in an error when committing the vertex information to a mesh.
Additionally, the attributes used before the first vertex is added determine the format of the mesh. For example, if you only add UVs to the first vertex, you cannot add color to any of the subsequent vertices.
See also [ArrayMesh], [ImmediateGeometry3D] and [MeshDataTool] for procedural geometry generation.
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
- <method name="add_bones">
- <return type="void">
- </return>
- <argument index="0" name="bones" type="PackedInt32Array">
- </argument>
- <description>
- Adds an array of bones for the next vertex to use. [code]bones[/code] must contain 4 integers.
- </description>
- </method>
- <method name="add_color">
- <return type="void">
- </return>
- <argument index="0" name="color" type="Color">
- </argument>
- <description>
- Specifies a [Color] for the next vertex to use.
- </description>
- </method>
<method name="add_index">
<return type="void">
</return>
@@ -48,15 +31,6 @@
Adds an index to index array if you are using indexed vertices. Does not need to be called before adding vertices.
</description>
</method>
- <method name="add_normal">
- <return type="void">
- </return>
- <argument index="0" name="normal" type="Vector3">
- </argument>
- <description>
- Specifies a normal for the next vertex to use.
- </description>
- </method>
<method name="add_smooth_group">
<return type="void">
</return>
@@ -66,15 +40,6 @@
Specifies whether the current vertex (if using only vertex arrays) or current index (if also using index arrays) should use smooth normals for normal calculation.
</description>
</method>
- <method name="add_tangent">
- <return type="void">
- </return>
- <argument index="0" name="tangent" type="Plane">
- </argument>
- <description>
- Specifies a tangent for the next vertex to use.
- </description>
- </method>
<method name="add_triangle_fan">
<return type="void">
</return>
@@ -95,24 +60,6 @@
Requires the primitive type be set to [constant Mesh.PRIMITIVE_TRIANGLES].
</description>
</method>
- <method name="add_uv">
- <return type="void">
- </return>
- <argument index="0" name="uv" type="Vector2">
- </argument>
- <description>
- Specifies a set of UV coordinates to use for the next vertex.
- </description>
- </method>
- <method name="add_uv2">
- <return type="void">
- </return>
- <argument index="0" name="uv2" type="Vector2">
- </argument>
- <description>
- Specifies an optional second set of UV coordinates to use for the next vertex.
- </description>
- </method>
<method name="add_vertex">
<return type="void">
</return>
@@ -122,15 +69,6 @@
Specifies the position of current vertex. Should be called after specifying other vertex properties (e.g. Color, UV).
</description>
</method>
- <method name="add_weights">
- <return type="void">
- </return>
- <argument index="0" name="weights" type="PackedFloat32Array">
- </argument>
- <description>
- Specifies weight values for next vertex to use. [code]weights[/code] must contain 4 values.
- </description>
- </method>
<method name="append_from">
<return type="void">
</return>
@@ -165,11 +103,11 @@
</return>
<argument index="0" name="existing" type="ArrayMesh" default="null">
</argument>
- <argument index="1" name="flags" type="int" default="31744">
+ <argument index="1" name="flags" type="int" default="0">
</argument>
<description>
Returns a constructed [ArrayMesh] from current information passed in. If an existing [ArrayMesh] is passed in as an argument, will add an extra surface to the existing [ArrayMesh].
- Default flag is [constant Mesh.ARRAY_COMPRESS_DEFAULT]. See [code]ARRAY_COMPRESS_*[/code] constants in [enum Mesh.ArrayFormat] for other flags.
+ [b]FIXME:[/b] Document possible values for [code]flags[/code], it changed in 4.0. Likely some combinations of [enum Mesh.ArrayFormat].
</description>
</method>
<method name="commit_to_arrays">
@@ -227,6 +165,20 @@
Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already.
</description>
</method>
+ <method name="get_custom_format" qualifiers="const">
+ <return type="int" enum="SurfaceTool.CustomFormat">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_skin_weight_count" qualifiers="const">
+ <return type="int" enum="SurfaceTool.SkinWeightCount">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="index">
<return type="void">
</return>
@@ -234,6 +186,45 @@
Shrinks the vertex array by creating an index array (avoids reusing vertices).
</description>
</method>
+ <method name="set_bones">
+ <return type="void">
+ </return>
+ <argument index="0" name="bones" type="PackedInt32Array">
+ </argument>
+ <description>
+ Specifies an array of bones for the next vertex to use. [code]bones[/code] must contain 4 integers.
+ </description>
+ </method>
+ <method name="set_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ Specifies a [Color] for the next vertex to use.
+ [b]Note:[/b] The material must have [member BaseMaterial3D.vertex_color_use_as_albedo] enabled for the vertex color to be visible.
+ </description>
+ </method>
+ <method name="set_custom">
+ <return type="void">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="custom" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_custom_format">
+ <return type="void">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="format" type="int" enum="SurfaceTool.CustomFormat">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_material">
<return type="void">
</return>
@@ -243,7 +234,82 @@
Sets [Material] to be used by the [Mesh] you are constructing.
</description>
</method>
+ <method name="set_normal">
+ <return type="void">
+ </return>
+ <argument index="0" name="normal" type="Vector3">
+ </argument>
+ <description>
+ Specifies a normal for the next vertex to use.
+ </description>
+ </method>
+ <method name="set_skin_weight_count">
+ <return type="void">
+ </return>
+ <argument index="0" name="count" type="int" enum="SurfaceTool.SkinWeightCount">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_tangent">
+ <return type="void">
+ </return>
+ <argument index="0" name="tangent" type="Plane">
+ </argument>
+ <description>
+ Specifies a tangent for the next vertex to use.
+ </description>
+ </method>
+ <method name="set_uv">
+ <return type="void">
+ </return>
+ <argument index="0" name="uv" type="Vector2">
+ </argument>
+ <description>
+ Specifies a set of UV coordinates to use for the next vertex.
+ </description>
+ </method>
+ <method name="set_uv2">
+ <return type="void">
+ </return>
+ <argument index="0" name="uv2" type="Vector2">
+ </argument>
+ <description>
+ Specifies an optional second set of UV coordinates to use for the next vertex.
+ </description>
+ </method>
+ <method name="set_weights">
+ <return type="void">
+ </return>
+ <argument index="0" name="weights" type="PackedFloat32Array">
+ </argument>
+ <description>
+ Specifies weight values for next vertex to use. [code]weights[/code] must contain 4 values.
+ </description>
+ </method>
</methods>
<constants>
+ <constant name="CUSTOM_RGBA8_UNORM" value="0" enum="CustomFormat">
+ </constant>
+ <constant name="CUSTOM_RGBA8_SNORM" value="1" enum="CustomFormat">
+ </constant>
+ <constant name="CUSTOM_RG_HALF" value="2" enum="CustomFormat">
+ </constant>
+ <constant name="CUSTOM_RGBA_HALF" value="3" enum="CustomFormat">
+ </constant>
+ <constant name="CUSTOM_R_FLOAT" value="4" enum="CustomFormat">
+ </constant>
+ <constant name="CUSTOM_RG_FLOAT" value="5" enum="CustomFormat">
+ </constant>
+ <constant name="CUSTOM_RGB_FLOAT" value="6" enum="CustomFormat">
+ </constant>
+ <constant name="CUSTOM_RGBA_FLOAT" value="7" enum="CustomFormat">
+ </constant>
+ <constant name="CUSTOM_MAX" value="8" enum="CustomFormat">
+ </constant>
+ <constant name="SKIN_4_WEIGHTS" value="0" enum="SkinWeightCount">
+ </constant>
+ <constant name="SKIN_8_WEIGHTS" value="1" enum="SkinWeightCount">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml
index d56781105b..c9ed1aaec9 100644
--- a/doc/classes/TabContainer.xml
+++ b/doc/classes/TabContainer.xml
@@ -149,6 +149,9 @@
<member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible" default="true">
If [code]true[/code], tabs are visible. If [code]false[/code], tabs' content and titles are hidden.
</member>
+ <member name="all_tabs_in_front" type="bool" setter="set_all_tabs_in_front" getter="is_all_tabs_in_front" default="false">
+ If [code]true[/code], all tabs are drawn in front of the panel. If [code]false[/code], inactive tabs are drawn behind the panel.
+ </member>
<member name="use_hidden_tabs_for_min_size" type="bool" setter="set_use_hidden_tabs_for_min_size" getter="get_use_hidden_tabs_for_min_size" default="false">
If [code]true[/code], children [Control] nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one.
</member>
@@ -204,6 +207,9 @@
<theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
Font color of the currently selected tab.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the tab names.
+ </theme_item>
<theme_item name="icon_separation" type="int" default="4">
Space between tab's name and its icon.
</theme_item>
diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml
index ef1f370185..47cf869fe9 100644
--- a/doc/classes/Tabs.xml
+++ b/doc/classes/Tabs.xml
@@ -4,7 +4,7 @@
Tabs control.
</brief_description>
<description>
- Simple tabs control, similar to [TabContainer] but is only in charge of drawing tabs, not interact with children.
+ Simple tabs control, similar to [TabContainer] but is only in charge of drawing tabs, not interacting with children.
</description>
<tutorials>
</tutorials>
@@ -20,6 +20,15 @@
Adds a new tab.
</description>
</method>
+ <method name="clear_tab_opentype_features">
+ <return type="void">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <description>
+ Removes all OpenType features from the tab title.
+ </description>
+ </method>
<method name="ensure_tab_visible">
<return type="void">
</return>
@@ -75,6 +84,15 @@
Returns the [Texture2D] for the tab at index [code]tab_idx[/code] or [code]null[/code] if the tab has no [Texture2D].
</description>
</method>
+ <method name="get_tab_language" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <description>
+ Returns tab title language code.
+ </description>
+ </method>
<method name="get_tab_offset" qualifiers="const">
<return type="int">
</return>
@@ -82,6 +100,17 @@
Returns the number of hidden tabs offsetted to the left.
</description>
</method>
+ <method name="get_tab_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code] of the tab title.
+ </description>
+ </method>
<method name="get_tab_rect" qualifiers="const">
<return type="Rect2">
</return>
@@ -91,6 +120,15 @@
Returns tab [Rect2] with local position and size.
</description>
</method>
+ <method name="get_tab_text_direction" qualifiers="const">
+ <return type="int" enum="Control.TextDirection">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <description>
+ Returns tab title text base writing direction.
+ </description>
+ </method>
<method name="get_tab_title" qualifiers="const">
<return type="String">
</return>
@@ -159,6 +197,41 @@
Sets an [code]icon[/code] for the tab at index [code]tab_idx[/code].
</description>
</method>
+ <method name="set_tab_language">
+ <return type="void">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <argument index="1" name="language" type="String">
+ </argument>
+ <description>
+ Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+ </description>
+ </method>
+ <method name="set_tab_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <argument index="2" name="values" type="int">
+ </argument>
+ <description>
+ Sets OpenType feature [code]tag[/code] for the tab title. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+ </description>
+ </method>
+ <method name="set_tab_text_direction">
+ <return type="void">
+ </return>
+ <argument index="0" name="tab_idx" type="int">
+ </argument>
+ <argument index="1" name="direction" type="int" enum="Control.TextDirection">
+ </argument>
+ <description>
+ Sets tab title base writing direction.
+ </description>
+ </method>
<method name="set_tab_title">
<return type="void">
</return>
@@ -226,14 +299,14 @@
Emitted when a tab is clicked, even if it is the current tab.
</description>
</signal>
- <signal name="tab_close">
+ <signal name="tab_closed">
<argument index="0" name="tab" type="int">
</argument>
<description>
Emitted when a tab is closed.
</description>
</signal>
- <signal name="tab_hover">
+ <signal name="tab_hovered">
<argument index="0" name="tab" type="int">
</argument>
<description>
@@ -295,6 +368,9 @@
<theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
Font color of the currently selected tab.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the tab names.
+ </theme_item>
<theme_item name="hseparation" type="int" default="4">
The horizontal separation between the tabs.
</theme_item>
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index a23a4936f8..eedf3b848f 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -33,6 +33,13 @@
Centers the viewport on the line the editing cursor is at. This also resets the [member scroll_horizontal] value to [code]0[/code].
</description>
</method>
+ <method name="clear_opentype_features">
+ <return type="void">
+ </return>
+ <description>
+ Removes all OpenType features.
+ </description>
+ </method>
<method name="clear_undo_history">
<return type="void">
</return>
@@ -213,6 +220,21 @@
Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit].
</description>
</method>
+ <method name="get_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code].
+ </description>
+ </method>
+ <method name="get_selection_column" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_selection_from_column" qualifiers="const">
<return type="int">
</return>
@@ -227,6 +249,18 @@
Returns the selection begin line.
</description>
</method>
+ <method name="get_selection_line" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_selection_mode" qualifiers="const">
+ <return type="int" enum="TextEdit.SelectionMode">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_selection_text" qualifiers="const">
<return type="String">
</return>
@@ -252,7 +286,7 @@
<return type="String">
</return>
<description>
- Returns a [String] text with the word under the mouse cursor location.
+ Returns a [String] text with the word under the caret (text cursor) location.
</description>
</method>
<method name="insert_text_at_cursor">
@@ -555,6 +589,29 @@
<description>
</description>
</method>
+ <method name="set_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="tag" type="String">
+ </argument>
+ <argument index="1" name="value" type="int">
+ </argument>
+ <description>
+ Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+ </description>
+ </method>
+ <method name="set_selection_mode">
+ <return type="void">
+ </return>
+ <argument index="0" name="mode" type="int" enum="TextEdit.SelectionMode">
+ </argument>
+ <argument index="1" name="line" type="int" default="-1">
+ </argument>
+ <argument index="2" name="column" type="int" default="-1">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="toggle_fold_line">
<return type="void">
</return>
@@ -599,6 +656,10 @@
If [code]true[/code], the caret displays as a rectangle.
If [code]false[/code], the caret displays as a bar.
</member>
+ <member name="caret_mid_grapheme" type="bool" setter="set_mid_grapheme_caret_enabled" getter="get_mid_grapheme_caret_enabled" default="false">
+ Allow moving caret, selecting and removing the individual composite character components.
+ Note: [kbd]Backspace[/kbd] is always removing individual composite character components.
+ </member>
<member name="caret_moving_by_right_click" type="bool" setter="set_right_click_moves_caret" getter="is_right_click_moving_caret" default="true">
If [code]true[/code], a right-click moves the cursor at the mouse position before displaying the context menu.
If [code]false[/code], the context menu disregards mouse location.
@@ -606,6 +667,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="draw_control_chars" type="bool" setter="set_draw_control_chars" getter="get_draw_control_chars" default="false">
+ If [code]true[/code], control characters are displayed.
+ </member>
<member name="draw_spaces" type="bool" setter="set_draw_spaces" getter="is_drawing_spaces" default="false">
If [code]true[/code], the "space" character will have a visible representation.
</member>
@@ -622,6 +686,9 @@
<member name="highlight_current_line" type="bool" setter="set_highlight_current_line" getter="is_highlight_current_line_enabled" default="false">
If [code]true[/code], the line containing the cursor is highlighted.
</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="minimap_draw" type="bool" setter="draw_minimap" getter="is_drawing_minimap" default="false">
If [code]true[/code], a minimap is shown, providing an outline of your source code.
</member>
@@ -651,11 +718,20 @@
<member name="smooth_scrolling" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled" default="false">
If [code]true[/code], sets the [code]step[/code] of the scrollbars to [code]0.25[/code] which results in smoother scrolling.
</member>
+ <member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
+ Set BiDi algorithm override for the structured text.
+ </member>
+ <member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]">
+ Set additional options for BiDi override.
+ </member>
<member name="syntax_highlighter" type="SyntaxHighlighter" setter="set_syntax_highlighter" getter="get_syntax_highlighter">
</member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
String value of the [TextEdit].
</member>
+ <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="v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed" default="80.0">
Vertical scroll sensitivity.
</member>
@@ -732,6 +808,16 @@
<constant name="SEARCH_BACKWARDS" value="4" enum="SearchFlags">
Search from end to beginning.
</constant>
+ <constant name="SELECTION_MODE_NONE" value="0" enum="SelectionMode">
+ </constant>
+ <constant name="SELECTION_MODE_SHIFT" value="1" enum="SelectionMode">
+ </constant>
+ <constant name="SELECTION_MODE_POINTER" value="2" enum="SelectionMode">
+ </constant>
+ <constant name="SELECTION_MODE_WORD" value="3" enum="SelectionMode">
+ </constant>
+ <constant name="SELECTION_MODE_LINE" value="4" enum="SelectionMode">
+ </constant>
<constant name="GUTTER_TYPE_STRING" value="0" enum="GutterType">
</constant>
<constant name="GUTTER_TPYE_ICON" value="1" enum="GutterType">
@@ -759,7 +845,70 @@
<constant name="MENU_REDO" value="6" enum="MenuItems">
Redoes the previous action.
</constant>
- <constant name="MENU_MAX" value="7" enum="MenuItems">
+ <constant name="MENU_DIR_INHERITED" value="7" enum="MenuItems">
+ Sets text direction to inherited.
+ </constant>
+ <constant name="MENU_DIR_AUTO" value="8" enum="MenuItems">
+ Sets text direction to automatic.
+ </constant>
+ <constant name="MENU_DIR_LTR" value="9" enum="MenuItems">
+ Sets text direction to left-to-right.
+ </constant>
+ <constant name="MENU_DIR_RTL" value="10" enum="MenuItems">
+ Sets text direction to right-to-left.
+ </constant>
+ <constant name="MENU_DISPLAY_UCC" value="11" enum="MenuItems">
+ Toggles control character display.
+ </constant>
+ <constant name="MENU_INSERT_LRM" value="12" enum="MenuItems">
+ Inserts left-to-right mark (LRM) character.
+ </constant>
+ <constant name="MENU_INSERT_RLM" value="13" enum="MenuItems">
+ Inserts right-to-left mark (RLM) character.
+ </constant>
+ <constant name="MENU_INSERT_LRE" value="14" enum="MenuItems">
+ Inserts start of left-to-right embedding (LRE) character.
+ </constant>
+ <constant name="MENU_INSERT_RLE" value="15" enum="MenuItems">
+ Inserts start of right-to-left embedding (RLE) character.
+ </constant>
+ <constant name="MENU_INSERT_LRO" value="16" enum="MenuItems">
+ Inserts start of left-to-right override (LRO) character.
+ </constant>
+ <constant name="MENU_INSERT_RLO" value="17" enum="MenuItems">
+ Inserts start of right-to-left override (RLO) character.
+ </constant>
+ <constant name="MENU_INSERT_PDF" value="18" enum="MenuItems">
+ Inserts pop direction formatting (PDF) character.
+ </constant>
+ <constant name="MENU_INSERT_ALM" value="19" enum="MenuItems">
+ Inserts Arabic letter mark (ALM) character.
+ </constant>
+ <constant name="MENU_INSERT_LRI" value="20" enum="MenuItems">
+ Inserts left-to-right isolate (LRI) character.
+ </constant>
+ <constant name="MENU_INSERT_RLI" value="21" enum="MenuItems">
+ Inserts right-to-left isolate (RLI) character.
+ </constant>
+ <constant name="MENU_INSERT_FSI" value="22" enum="MenuItems">
+ Inserts first strong isolate (FSI) character.
+ </constant>
+ <constant name="MENU_INSERT_PDI" value="23" enum="MenuItems">
+ Inserts pop direction isolate (PDI) character.
+ </constant>
+ <constant name="MENU_INSERT_ZWJ" value="24" enum="MenuItems">
+ Inserts zero width joiner (ZWJ) character.
+ </constant>
+ <constant name="MENU_INSERT_ZWNJ" value="25" enum="MenuItems">
+ Inserts zero width non-joiner (ZWNJ) character.
+ </constant>
+ <constant name="MENU_INSERT_WJ" value="26" enum="MenuItems">
+ Inserts word joiner (WJ) character.
+ </constant>
+ <constant name="MENU_INSERT_SHY" value="27" enum="MenuItems">
+ Inserts soft hyphen (SHY) character.
+ </constant>
+ <constant name="MENU_MAX" value="28" enum="MenuItems">
Represents the size of the [enum MenuItems] enum.
</constant>
</constants>
@@ -809,6 +958,9 @@
<theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )">
Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Sets default font size.
+ </theme_item>
<theme_item name="line_spacing" type="int" default="4">
Sets the spacing between the lines.
</theme_item>
@@ -825,6 +977,7 @@
Sets the highlight [Color] of text selections.
</theme_item>
<theme_item name="space" type="Texture2D">
+ Sets a custom [Texture2D] for space text characters.
</theme_item>
<theme_item name="tab" type="Texture2D">
Sets a custom [Texture2D] for tab text characters.
diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml
new file mode 100644
index 0000000000..c21da09edb
--- /dev/null
+++ b/doc/classes/TextLine.xml
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="TextLine" inherits="Reference" version="4.0">
+ <brief_description>
+ Holds a line of text.
+ </brief_description>
+ <description>
+ Abstraction over [TextServer] for handling single line of text.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_object">
+ <return type="bool">
+ </return>
+ <argument index="0" name="key" type="Variant">
+ </argument>
+ <argument index="1" name="size" type="Vector2">
+ </argument>
+ <argument index="2" name="inline_align" type="int" enum="VAlign" default="1">
+ </argument>
+ <argument index="3" name="length" type="int" default="1">
+ </argument>
+ <description>
+ Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
+ </description>
+ </method>
+ <method name="add_string">
+ <return type="bool">
+ </return>
+ <argument index="0" name="text" type="String">
+ </argument>
+ <argument index="1" name="fonts" type="Font">
+ </argument>
+ <argument index="2" name="size" type="int">
+ </argument>
+ <argument index="3" name="opentype_features" type="Dictionary" default="{
+}">
+ </argument>
+ <argument index="4" name="language" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ Adds text span and font to draw it.
+ </description>
+ </method>
+ <method name="clear">
+ <return type="void">
+ </return>
+ <description>
+ Clears text line (removes text and inline objects).
+ </description>
+ </method>
+ <method name="draw" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="canvas" type="RID">
+ </argument>
+ <argument index="1" name="pos" type="Vector2">
+ </argument>
+ <argument index="2" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+ </description>
+ </method>
+ <method name="draw_outline" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="canvas" type="RID">
+ </argument>
+ <argument index="1" name="pos" type="Vector2">
+ </argument>
+ <argument index="2" name="outline_size" type="int" default="1">
+ </argument>
+ <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+ </description>
+ </method>
+ <method name="get_line_ascent" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
+ </description>
+ </method>
+ <method name="get_line_descent" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
+ </description>
+ </method>
+ <method name="get_line_underline_position" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns pixel offset of the underline below the baseline.
+ </description>
+ </method>
+ <method name="get_line_underline_thickness" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns thickness of the underline.
+ </description>
+ </method>
+ <method name="get_line_width" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns width (for horizontal layout) or height (for vertical) of the text.
+ </description>
+ </method>
+ <method name="get_object_rect" qualifiers="const">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="key" type="Variant">
+ </argument>
+ <description>
+ Returns bounding rectangle of the inline object.
+ </description>
+ </method>
+ <method name="get_objects" qualifiers="const">
+ <return type="Array">
+ </return>
+ <description>
+ Returns array of inline objects.
+ </description>
+ </method>
+ <method name="get_rid" qualifiers="const">
+ <return type="RID">
+ </return>
+ <description>
+ Returns TextServer buffer RID.
+ </description>
+ </method>
+ <method name="get_size" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ Returns size of the bounding box of the text.
+ </description>
+ </method>
+ <method name="hit_test" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="coords" type="float">
+ </argument>
+ <description>
+ Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
+ </description>
+ </method>
+ <method name="resize_object">
+ <return type="bool">
+ </return>
+ <argument index="0" name="key" type="Variant">
+ </argument>
+ <argument index="1" name="size" type="Vector2">
+ </argument>
+ <argument index="2" name="inline_align" type="int" enum="VAlign" default="1">
+ </argument>
+ <description>
+ Sets new size and alignment of embedded object.
+ </description>
+ </method>
+ <method name="set_bidi_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="override" type="Array">
+ </argument>
+ <description>
+ Overrides BiDi for the structured text.
+ Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
+ </description>
+ </method>
+ <method name="tab_align">
+ <return type="void">
+ </return>
+ <argument index="0" name="tab_stops" type="PackedFloat32Array">
+ </argument>
+ <description>
+ Aligns text to the given tab-stops.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="align" type="int" setter="set_align" getter="get_align" enum="HAlign" default="0">
+ Text horizontal alignment.
+ </member>
+ <member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0">
+ Text writing direction.
+ </member>
+ <member name="flags" type="int" setter="set_flags" getter="get_flags" default="3">
+ Line Alignment rules. For more info see [TextServer].
+ </member>
+ <member name="orientation" type="int" setter="set_orientation" getter="get_orientation" enum="TextServer.Orientation" default="0">
+ Text orientation.
+ </member>
+ <member name="preserve_control" type="bool" setter="set_preserve_control" getter="get_preserve_control" default="false">
+ If set to [code]true[/code] text will display control characters.
+ </member>
+ <member name="preserve_invalid" type="bool" setter="set_preserve_invalid" getter="get_preserve_invalid" default="true">
+ If set to [code]true[/code] text will display invalid characters.
+ </member>
+ <member name="width" type="float" setter="set_width" getter="get_width" default="-1.0">
+ Text line width.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml
new file mode 100644
index 0000000000..fabf22eef7
--- /dev/null
+++ b/doc/classes/TextParagraph.xml
@@ -0,0 +1,299 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="TextParagraph" inherits="Reference" version="4.0">
+ <brief_description>
+ Holds a paragraph of text.
+ </brief_description>
+ <description>
+ Abstraction over [TextServer] for handling paragraph of text.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_object">
+ <return type="bool">
+ </return>
+ <argument index="0" name="key" type="Variant">
+ </argument>
+ <argument index="1" name="size" type="Vector2">
+ </argument>
+ <argument index="2" name="inline_align" type="int" enum="VAlign" default="1">
+ </argument>
+ <argument index="3" name="length" type="int" default="1">
+ </argument>
+ <description>
+ Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
+ </description>
+ </method>
+ <method name="add_string">
+ <return type="bool">
+ </return>
+ <argument index="0" name="text" type="String">
+ </argument>
+ <argument index="1" name="fonts" type="Font">
+ </argument>
+ <argument index="2" name="size" type="int">
+ </argument>
+ <argument index="3" name="opentype_features" type="Dictionary" default="{
+}">
+ </argument>
+ <argument index="4" name="language" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ Adds text span and font to draw it.
+ </description>
+ </method>
+ <method name="clear">
+ <return type="void">
+ </return>
+ <description>
+ Clears text paragraph (removes text and inline objects).
+ </description>
+ </method>
+ <method name="draw" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="canvas" type="RID">
+ </argument>
+ <argument index="1" name="pos" type="Vector2">
+ </argument>
+ <argument index="2" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+ </description>
+ </method>
+ <method name="draw_line" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="canvas" type="RID">
+ </argument>
+ <argument index="1" name="pos" type="Vector2">
+ </argument>
+ <argument index="2" name="line" type="int">
+ </argument>
+ <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draw single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+ </description>
+ </method>
+ <method name="draw_line_outline" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="canvas" type="RID">
+ </argument>
+ <argument index="1" name="pos" type="Vector2">
+ </argument>
+ <argument index="2" name="line" type="int">
+ </argument>
+ <argument index="3" name="outline_size" type="int" default="1">
+ </argument>
+ <argument index="4" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draw outline of the single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+ </description>
+ </method>
+ <method name="draw_outline" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="canvas" type="RID">
+ </argument>
+ <argument index="1" name="outline_size" type="Vector2">
+ </argument>
+ <argument index="2" name="color" type="int" default="1">
+ </argument>
+ <argument index="3" name="arg3" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draw outline of the text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+ </description>
+ </method>
+ <method name="get_line_ascent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ Returns the text line ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
+ </description>
+ </method>
+ <method name="get_line_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns number of lines in the paragraph.
+ </description>
+ </method>
+ <method name="get_line_descent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ Returns the text line descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
+ </description>
+ </method>
+ <method name="get_line_object_rect" qualifiers="const">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="key" type="Variant">
+ </argument>
+ <description>
+ Returns bounding rectangle of the inline object.
+ </description>
+ </method>
+ <method name="get_line_objects" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ Returns array of inline objects in the line.
+ </description>
+ </method>
+ <method name="get_line_range" qualifiers="const">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ Returns character range of the line.
+ </description>
+ </method>
+ <method name="get_line_rid" qualifiers="const">
+ <return type="RID">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ Returns TextServer line buffer RID.
+ </description>
+ </method>
+ <method name="get_line_size" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ Returns size of the bounding box of the line of text.
+ </description>
+ </method>
+ <method name="get_line_underline_position" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ Returns pixel offset of the underline below the baseline.
+ </description>
+ </method>
+ <method name="get_line_underline_thickness" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ Returns thickness of the underline.
+ </description>
+ </method>
+ <method name="get_line_width" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ Returns width (for horizontal layout) or height (for vertical) of the line of text.
+ </description>
+ </method>
+ <method name="get_non_wraped_size" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ Returns the size of the bounding box of the paragraph, without line breaks.
+ </description>
+ </method>
+ <method name="get_rid" qualifiers="const">
+ <return type="RID">
+ </return>
+ <description>
+ Returns TextServer full string buffer RID.
+ </description>
+ </method>
+ <method name="get_size" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ Returns the size of the bounding box of the paragraph.
+ </description>
+ </method>
+ <method name="hit_test" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="coords" type="Vector2">
+ </argument>
+ <description>
+ Returns caret character offset at the specified coordinates. This function always returns a valid position.
+ </description>
+ </method>
+ <method name="resize_object">
+ <return type="bool">
+ </return>
+ <argument index="0" name="key" type="Variant">
+ </argument>
+ <argument index="1" name="size" type="Vector2">
+ </argument>
+ <argument index="2" name="inline_align" type="int" enum="VAlign" default="1">
+ </argument>
+ <description>
+ Sets new size and alignment of embedded object.
+ </description>
+ </method>
+ <method name="set_bidi_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="override" type="Array">
+ </argument>
+ <description>
+ Overrides BiDi for the structured text.
+ Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
+ </description>
+ </method>
+ <method name="tab_align">
+ <return type="void">
+ </return>
+ <argument index="0" name="tab_stops" type="PackedFloat32Array">
+ </argument>
+ <description>
+ Aligns paragraph to the given tab-stops.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="align" type="int" setter="set_align" getter="get_align" enum="HAlign" default="0">
+ Paragraph horizontal alignment.
+ </member>
+ <member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0">
+ Text writing direction.
+ </member>
+ <member name="flags" type="int" setter="set_flags" getter="get_flags" default="51">
+ Line breaking and alignment rules. For more info see [TextServer].
+ </member>
+ <member name="orientation" type="int" setter="set_orientation" getter="get_orientation" enum="TextServer.Orientation" default="0">
+ Text orientation.
+ </member>
+ <member name="preserve_control" type="bool" setter="set_preserve_control" getter="get_preserve_control" default="false">
+ If set to [code]true[/code] text will display control characters.
+ </member>
+ <member name="preserve_invalid" type="bool" setter="set_preserve_invalid" getter="get_preserve_invalid" default="true">
+ If set to [code]true[/code] text will display invalid characters.
+ </member>
+ <member name="width" type="float" setter="set_width" getter="get_width" default="-1.0">
+ Paragraph width.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
new file mode 100644
index 0000000000..791646000b
--- /dev/null
+++ b/doc/classes/TextServer.xml
@@ -0,0 +1,1207 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="TextServer" inherits="Object" version="4.0">
+ <brief_description>
+ Interface for the fonts and complex text layouts.
+ </brief_description>
+ <description>
+ [TextServer] is the API backend for managing fonts, and rendering complex text.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="create_font_memory">
+ <return type="RID">
+ </return>
+ <argument index="0" name="data" type="PackedByteArray">
+ </argument>
+ <argument index="1" name="type" type="String">
+ </argument>
+ <argument index="2" name="base_size" type="int" default="16">
+ </argument>
+ <description>
+ Creates new font from the data in memory. To free the resulting font, use [method free_rid] method.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method font_get_base_size] to check actual font size.
+ </description>
+ </method>
+ <method name="create_font_resource">
+ <return type="RID">
+ </return>
+ <argument index="0" name="filename" type="String">
+ </argument>
+ <argument index="1" name="base_size" type="int" default="16">
+ </argument>
+ <description>
+ Creates new font from the file. To free the resulting font, use [method free_rid] method.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method font_get_base_size] to check actual font size.
+ </description>
+ </method>
+ <method name="create_font_system">
+ <return type="RID">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="base_size" type="int" default="16">
+ </argument>
+ <description>
+ Creates new font from the system font. To free the resulting font, use [method free_rid] method.
+ Note: This method is supported by servers with the [code]FEATURE_FONT_SYSTEM[/code] feature.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method font_get_base_size] to check actual font size.
+ </description>
+ </method>
+ <method name="create_shaped_text">
+ <return type="RID">
+ </return>
+ <argument index="0" name="direction" type="int" enum="TextServer.Direction" default="0">
+ </argument>
+ <argument index="1" name="orientation" type="int" enum="TextServer.Orientation" default="0">
+ </argument>
+ <description>
+ Creates new buffer for complex text layout, with the given [code]direction[/code] and [code]orientation[/code]. To free the resulting buffer, use [method free_rid] method.
+ Note: Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature.
+ Note: Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature.
+ </description>
+ </method>
+ <method name="draw_hex_code_box" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="canvas" type="RID">
+ </argument>
+ <argument index="1" name="size" type="int">
+ </argument>
+ <argument index="2" name="pos" type="Vector2">
+ </argument>
+ <argument index="3" name="index" type="int">
+ </argument>
+ <argument index="4" name="color" type="Color">
+ </argument>
+ <description>
+ Draws box displaying character hexadecimal code. Used for replacing missing characters.
+ </description>
+ </method>
+ <method name="font_draw_glyph" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="canvas" type="RID">
+ </argument>
+ <argument index="2" name="size" type="int">
+ </argument>
+ <argument index="3" name="pos" type="Vector2">
+ </argument>
+ <argument index="4" name="index" type="int">
+ </argument>
+ <argument index="5" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
+ Note: Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index].
+ </description>
+ </method>
+ <method name="font_draw_glyph_outline" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="canvas" type="RID">
+ </argument>
+ <argument index="2" name="size" type="int">
+ </argument>
+ <argument index="3" name="outline_size" type="int">
+ </argument>
+ <argument index="4" name="pos" type="Vector2">
+ </argument>
+ <argument index="5" name="index" type="int">
+ </argument>
+ <argument index="6" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
+ Note: Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index].
+ </description>
+ </method>
+ <method name="font_get_antialiased" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns [code]true[/code], if font anti-aliasing is supported and enabled.
+ </description>
+ </method>
+ <method name="font_get_ascent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="size" type="int">
+ </argument>
+ <description>
+ Returns the font ascent (number of pixels above the baseline).
+ </description>
+ </method>
+ <method name="font_get_base_size" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns the default size of the font.
+ </description>
+ </method>
+ <method name="font_get_descent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="size" type="int">
+ </argument>
+ <description>
+ Returns the font descent (number of pixels below the baseline).
+ </description>
+ </method>
+ <method name="font_get_distance_field_hint" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns [code]true[/code], if distance field hint is enabled.
+ </description>
+ </method>
+ <method name="font_get_feature_list" qualifiers="const">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns list of OpenType features supported by font.
+ </description>
+ </method>
+ <method name="font_get_force_autohinter" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns [code]true[/code], if autohinter is supported and enabled.
+ </description>
+ </method>
+ <method name="font_get_glyph_advance" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="index" type="int">
+ </argument>
+ <argument index="2" name="size" type="int">
+ </argument>
+ <description>
+ Returns advance of the glyph.
+ </description>
+ </method>
+ <method name="font_get_glyph_index" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="char" type="int">
+ </argument>
+ <argument index="2" name="variation_selector" type="int" default="0">
+ </argument>
+ <description>
+ Returns the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
+ </description>
+ </method>
+ <method name="font_get_glyph_kerning" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="index_a" type="int">
+ </argument>
+ <argument index="2" name="index_b" type="int">
+ </argument>
+ <argument index="3" name="size" type="int">
+ </argument>
+ <description>
+ Returns a kerning of the pair of glyphs.
+ </description>
+ </method>
+ <method name="font_get_height" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="size" type="int">
+ </argument>
+ <description>
+ Returns the total font height (ascent plus descent) in pixels.
+ </description>
+ </method>
+ <method name="font_get_hinting" qualifiers="const">
+ <return type="int" enum="TextServer.Hinting">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns the font hinting.
+ </description>
+ </method>
+ <method name="font_get_language_support_override">
+ <return type="bool">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="language" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code] if support override is enabled for the [code]language[/code].
+ </description>
+ </method>
+ <method name="font_get_language_support_overrides">
+ <return type="PackedStringArray">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns list of language support overrides.
+ </description>
+ </method>
+ <method name="font_get_oversampling" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the font oversampling factor, shared by all fonts in the TextServer.
+ </description>
+ </method>
+ <method name="font_get_script_support_override">
+ <return type="bool">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="script" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code] if support override is enabled for the [code]script[/code].
+ </description>
+ </method>
+ <method name="font_get_script_support_overrides">
+ <return type="PackedStringArray">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns list of script support overrides.
+ </description>
+ </method>
+ <method name="font_get_supported_chars" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns a string containing all the characters available in the font.
+ </description>
+ </method>
+ <method name="font_get_underline_position" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="size" type="int">
+ </argument>
+ <description>
+ Returns underline offset (number of pixels below the baseline).
+ </description>
+ </method>
+ <method name="font_get_underline_thickness" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="size" type="int">
+ </argument>
+ <description>
+ Returns underline thickness in pixels.
+ </description>
+ </method>
+ <method name="font_get_variation" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <description>
+ Returns variation coordinate [code]tag[/code].
+ </description>
+ </method>
+ <method name="font_get_variation_list" qualifiers="const">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code].
+ Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant.
+ </description>
+ </method>
+ <method name="font_has_char" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="char" type="int">
+ </argument>
+ <description>
+ Returns [code]true[/code] if [code]char[/code] is available in the font.
+ </description>
+ </method>
+ <method name="font_has_outline" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <description>
+ Returns [code]true[/code], if font supports glyph outlines.
+ </description>
+ </method>
+ <method name="font_is_language_supported" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="language" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code], if font supports given language (ISO 639 code).
+ </description>
+ </method>
+ <method name="font_is_script_supported" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="script" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code], if font supports given script (ISO 15924 code).
+ </description>
+ </method>
+ <method name="font_remove_language_support_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="language" type="String">
+ </argument>
+ <description>
+ Remove language support override.
+ </description>
+ </method>
+ <method name="font_remove_script_support_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="script" type="String">
+ </argument>
+ <description>
+ Removes script support override.
+ </description>
+ </method>
+ <method name="font_set_antialiased">
+ <return type="void">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="antialiased" type="bool">
+ </argument>
+ <description>
+ Sets font anti-aliasing.
+ </description>
+ </method>
+ <method name="font_set_distance_field_hint">
+ <return type="void">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="distance_field" type="bool">
+ </argument>
+ <description>
+ Sets font distance field hint.
+ </description>
+ </method>
+ <method name="font_set_force_autohinter">
+ <return type="void">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="enabeld" type="bool">
+ </argument>
+ <description>
+ Enables/disables default autohinter.
+ </description>
+ </method>
+ <method name="font_set_hinting">
+ <return type="void">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="hinting" type="int" enum="TextServer.Hinting">
+ </argument>
+ <description>
+ Sets font hinting.
+ </description>
+ </method>
+ <method name="font_set_language_support_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="language" type="String">
+ </argument>
+ <argument index="2" name="supported" type="bool">
+ </argument>
+ <description>
+ Adds override for [method font_is_language_supported].
+ </description>
+ </method>
+ <method name="font_set_oversampling">
+ <return type="void">
+ </return>
+ <argument index="0" name="oversampling" type="float">
+ </argument>
+ <description>
+ Sets oversampling factor, shared by all font in the TextServer.
+ </description>
+ </method>
+ <method name="font_set_script_support_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="script" type="String">
+ </argument>
+ <argument index="2" name="supported" type="bool">
+ </argument>
+ <description>
+ Adds override for [method font_is_script_supported].
+ </description>
+ </method>
+ <method name="font_set_variation">
+ <return type="void">
+ </return>
+ <argument index="0" name="font" type="RID">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <argument index="2" name="value" type="float">
+ </argument>
+ <description>
+ Sets variation coordinate [code]name[/code]. Unsupported coordinates will be silently ignored.
+ </description>
+ </method>
+ <method name="format_number" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="number" type="String">
+ </argument>
+ <argument index="1" name="language" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ Converts a number from the Western Arabic (0..9) to the numeral systems used in [code]language[/code].
+ </description>
+ </method>
+ <method name="free_rid">
+ <return type="void">
+ </return>
+ <argument index="0" name="rid" type="RID">
+ </argument>
+ <description>
+ Frees an object created by this [TextServer].
+ </description>
+ </method>
+ <method name="get_hex_code_box_size" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="size" type="int">
+ </argument>
+ <argument index="1" name="index" type="int">
+ </argument>
+ <description>
+ Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
+ </description>
+ </method>
+ <method name="get_name" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Returns the name of the server interface.
+ </description>
+ </method>
+ <method name="get_system_fonts" qualifiers="const">
+ <return type="PackedStringArray">
+ </return>
+ <description>
+ Returns list of available system fonts.
+ Note: This method is supported by servers with the [code]FEATURE_FONT_SYSTEM[/code] feature.
+ </description>
+ </method>
+ <method name="has">
+ <return type="bool">
+ </return>
+ <argument index="0" name="rid" type="RID">
+ </argument>
+ <description>
+ Returns [code]true[/code] if [code]rid[/code] is valid resource owned by this text server.
+ </description>
+ </method>
+ <method name="has_feature">
+ <return type="bool">
+ </return>
+ <argument index="0" name="feature" type="int" enum="TextServer.Feature">
+ </argument>
+ <description>
+ Returns [code]true[/code] if the server supports a feature.
+ </description>
+ </method>
+ <method name="is_locale_right_to_left">
+ <return type="bool">
+ </return>
+ <argument index="0" name="locale" type="String">
+ </argument>
+ <description>
+ Returns [code]true[/code] if locale is right-to-left.
+ </description>
+ </method>
+ <method name="load_support_data">
+ <return type="bool">
+ </return>
+ <argument index="0" name="filename" type="String">
+ </argument>
+ <description>
+ Loads optional TextServer database (e.g. ICU break iterators and dictionaries).
+ Note: This function should be called before any other TextServer functions used, otherwise it won't have any effect.
+ </description>
+ </method>
+ <method name="name_to_tag">
+ <return type="int">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ Converts readable feature, variation, script or language name to OpenType tag.
+ </description>
+ </method>
+ <method name="parse_number" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="number" type="String">
+ </argument>
+ <argument index="1" name="language" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ Converts a number from the numeral systems used in [code]language[/code] to Western Arabic (0..9).
+ </description>
+ </method>
+ <method name="percent_sign" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="language" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ Returns percent sign used in the [code]language[/code].
+ </description>
+ </method>
+ <method name="shaped_text_add_object">
+ <return type="bool">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="key" type="Variant">
+ </argument>
+ <argument index="2" name="size" type="Vector2">
+ </argument>
+ <argument index="3" name="inline_align" type="int" enum="VAlign" default="1">
+ </argument>
+ <argument index="4" name="length" type="int" default="1">
+ </argument>
+ <description>
+ Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
+ </description>
+ </method>
+ <method name="shaped_text_add_string">
+ <return type="bool">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="text" type="String">
+ </argument>
+ <argument index="2" name="fonts" type="Array">
+ </argument>
+ <argument index="3" name="size" type="int">
+ </argument>
+ <argument index="4" name="opentype_features" type="Dictionary" default="{
+}">
+ </argument>
+ <argument index="5" name="language" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ Adds text span and font to draw it to the text buffer.
+ </description>
+ </method>
+ <method name="shaped_text_clear">
+ <return type="void">
+ </return>
+ <argument index="0" name="arg0" type="RID">
+ </argument>
+ <description>
+ Clears text buffer (removes text and inline objects).
+ </description>
+ </method>
+ <method name="shaped_text_draw" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="canvas" type="RID">
+ </argument>
+ <argument index="2" name="pos" type="Vector2">
+ </argument>
+ <argument index="3" name="clip_l" type="float" default="-1">
+ </argument>
+ <argument index="4" name="clip_r" type="float" default="-1">
+ </argument>
+ <argument index="5" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draw shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout).
+ </description>
+ </method>
+ <method name="shaped_text_draw_outline" qualifiers="const">
+ <return type="void">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="canvas" type="RID">
+ </argument>
+ <argument index="2" name="pos" type="Vector2">
+ </argument>
+ <argument index="3" name="clip_l" type="float" default="-1">
+ </argument>
+ <argument index="4" name="clip_r" type="float" default="-1">
+ </argument>
+ <argument index="5" name="outline_size" type="int" default="1">
+ </argument>
+ <argument index="6" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
+ <description>
+ Draw the outline of the shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout).
+ </description>
+ </method>
+ <method name="shaped_text_fit_to_width">
+ <return type="float">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="width" type="float">
+ </argument>
+ <argument index="2" name="jst_flags" type="int" default="3">
+ </argument>
+ <description>
+ Adjusts text with to fit to specified width, returns new text width.
+ </description>
+ </method>
+ <method name="shaped_text_get_ascent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
+ Note: overall ascent can be higher than font ascent, if some glyphs are displaced from the baseline.
+ </description>
+ </method>
+ <method name="shaped_text_get_carets" qualifiers="const">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="position" type="int">
+ </argument>
+ <description>
+ Returns shapes of the carets corresponding to the character offset [code]position[/code] in the text. Returned caret shape is 1 pixel wide rectangle.
+ </description>
+ </method>
+ <method name="shaped_text_get_descent" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
+ Note: overall descent can be higher than font descent, if some glyphs are displaced from the baseline.
+ </description>
+ </method>
+ <method name="shaped_text_get_direction" qualifiers="const">
+ <return type="int" enum="TextServer.Direction">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns direction of the text.
+ </description>
+ </method>
+ <method name="shaped_text_get_dominant_direciton_in_range" qualifiers="const">
+ <return type="int" enum="TextServer.Direction">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="start" type="int">
+ </argument>
+ <argument index="2" name="end" type="int">
+ </argument>
+ <description>
+ Returns dominant direction of in the range of text.
+ </description>
+ </method>
+ <method name="shaped_text_get_glyphs" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns text glyphs.
+ </description>
+ </method>
+ <method name="shaped_text_get_line_breaks" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="width" type="float">
+ </argument>
+ <argument index="2" name="start" type="int" default="0">
+ </argument>
+ <argument index="3" name="break_flags" type="int" default="48">
+ </argument>
+ <description>
+ Breaks text to the lines and returns character ranges for each line.
+ </description>
+ </method>
+ <method name="shaped_text_get_line_breaks_adv" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="width" type="PackedFloat32Array">
+ </argument>
+ <argument index="2" name="start" type="int" default="0">
+ </argument>
+ <argument index="3" name="once" type="bool" default="true">
+ </argument>
+ <argument index="4" name="break_flags" type="int" default="48">
+ </argument>
+ <description>
+ Breaks text to the lines and columns. Returns character ranges for each segment.
+ </description>
+ </method>
+ <method name="shaped_text_get_object_rect" qualifiers="const">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="key" type="Variant">
+ </argument>
+ <description>
+ Returns bounding rectangle of the inline object.
+ </description>
+ </method>
+ <method name="shaped_text_get_objects" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns array of inline objects.
+ </description>
+ </method>
+ <method name="shaped_text_get_orientation" qualifiers="const">
+ <return type="int" enum="TextServer.Orientation">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns text orientation.
+ </description>
+ </method>
+ <method name="shaped_text_get_parent" qualifiers="const">
+ <return type="RID">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Sets text orientation.
+ </description>
+ </method>
+ <method name="shaped_text_get_preserve_control" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns [code]true[/code] if text buffer is configured to display control characters.
+ </description>
+ </method>
+ <method name="shaped_text_get_preserve_invalid" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns [code]true[/code] if text buffer is configured to display hexadecimal codes in place of invalid characters.
+ Note: If set to [code]false[/code], nothing is displayed in place of invalid characters.
+ </description>
+ </method>
+ <method name="shaped_text_get_range" qualifiers="const">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns substring buffer character range in the parent buffer.
+ </description>
+ </method>
+ <method name="shaped_text_get_selection" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="start" type="int">
+ </argument>
+ <argument index="2" name="end" type="int">
+ </argument>
+ <description>
+ Returns selection rectangles for the specified character range.
+ </description>
+ </method>
+ <method name="shaped_text_get_size" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns size of the text.
+ </description>
+ </method>
+ <method name="shaped_text_get_underline_position" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns pixel offset of the underline below the baseline.
+ </description>
+ </method>
+ <method name="shaped_text_get_underline_thickness" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns thickness of the underline.
+ </description>
+ </method>
+ <method name="shaped_text_get_width" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns width (for horizontal layout) or height (for vertical) of the text.
+ </description>
+ </method>
+ <method name="shaped_text_get_word_breaks" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Breaks text into words and returns array of character ranges.
+ </description>
+ </method>
+ <method name="shaped_text_hit_test_grapheme" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="coords" type="float">
+ </argument>
+ <description>
+ Returns grapheme index at the specified pixel offset at the baseline, or [code]-1[/code] if none is found.
+ </description>
+ </method>
+ <method name="shaped_text_hit_test_position" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="coords" type="float">
+ </argument>
+ <description>
+ Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
+ </description>
+ </method>
+ <method name="shaped_text_is_ready" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Returns [code]true[/code] if buffer is successfully shaped.
+ </description>
+ </method>
+ <method name="shaped_text_next_grapheme_pos">
+ <return type="int">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="pos" type="int">
+ </argument>
+ <description>
+ Returns composite character end position closest to the [code]pos[/code].
+ </description>
+ </method>
+ <method name="shaped_text_prev_grapheme_pos">
+ <return type="int">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="pos" type="int">
+ </argument>
+ <description>
+ Returns composite character start position closest to the [code]pos[/code].
+ </description>
+ </method>
+ <method name="shaped_text_resize_object">
+ <return type="bool">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="key" type="Variant">
+ </argument>
+ <argument index="2" name="size" type="Vector2">
+ </argument>
+ <argument index="3" name="inline_align" type="int" enum="VAlign" default="1">
+ </argument>
+ <description>
+ Sets new size and alignment of embedded object.
+ </description>
+ </method>
+ <method name="shaped_text_set_bidi_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="override" type="Array">
+ </argument>
+ <description>
+ Overrides BiDi for the structured text.
+ Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
+ </description>
+ </method>
+ <method name="shaped_text_set_direction">
+ <return type="void">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="direction" type="int" enum="TextServer.Direction" default="0">
+ </argument>
+ <description>
+ Sets desired text direction. If set to [code]TEXT_DIRECTION_AUTO[/code], direction will be detected based on the buffer contents and current locale.
+ Note: Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature.
+ </description>
+ </method>
+ <method name="shaped_text_set_orientation">
+ <return type="void">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="orientation" type="int" enum="TextServer.Orientation" default="0">
+ </argument>
+ <description>
+ Sets desired text orientation.
+ Note: Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature.
+ </description>
+ </method>
+ <method name="shaped_text_set_preserve_control">
+ <return type="void">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="enabled" type="bool">
+ </argument>
+ <description>
+ If set to [code]true[/code] text buffer will display control characters.
+ </description>
+ </method>
+ <method name="shaped_text_set_preserve_invalid">
+ <return type="void">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="enabled" type="bool">
+ </argument>
+ <description>
+ If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
+ </description>
+ </method>
+ <method name="shaped_text_shape">
+ <return type="bool">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <description>
+ Shapes buffer if it's not shaped. Returns [code]true[/code] if the string is shaped successfully.
+ Note: It is not necessary to call this function manually, buffer will be shaped automatically as soon as any of its output data is requested.
+ </description>
+ </method>
+ <method name="shaped_text_substr" qualifiers="const">
+ <return type="RID">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="start" type="int">
+ </argument>
+ <argument index="2" name="length" type="int">
+ </argument>
+ <description>
+ Returns text buffer for the substring of the text in the [code]shaped[/code] text buffer (including inline objects).
+ </description>
+ </method>
+ <method name="shaped_text_tab_align">
+ <return type="float">
+ </return>
+ <argument index="0" name="shaped" type="RID">
+ </argument>
+ <argument index="1" name="tab_stops" type="PackedFloat32Array">
+ </argument>
+ <description>
+ Aligns shaped text to the given tab-stops.
+ </description>
+ </method>
+ <method name="tag_to_name">
+ <return type="String">
+ </return>
+ <argument index="0" name="tag" type="int">
+ </argument>
+ <description>
+ Converts OpenType tag to readable feature, variation, script or language name.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ <constant name="DIRECTION_AUTO" value="0" enum="Direction">
+ Text direction is determined based on contents and current locale.
+ </constant>
+ <constant name="DIRECTION_LTR" value="1" enum="Direction">
+ Text is written from left to right.
+ </constant>
+ <constant name="DIRECTION_RTL" value="2" enum="Direction">
+ Text is written from right to left.
+ </constant>
+ <constant name="ORIENTATION_HORIZONTAL" value="0" enum="Orientation">
+ Text is written horizontally.
+ </constant>
+ <constant name="ORIENTATION_VERTICAL" value="1" enum="Orientation">
+ Left to right text is written vertically from top to bottom.
+ Right to left text is written vertically from bottom to top.
+ </constant>
+ <constant name="JUSTIFICATION_NONE" value="0" enum="JustificationFlag">
+ Do not justify text.
+ </constant>
+ <constant name="JUSTIFICATION_KASHIDA" value="1" enum="JustificationFlag">
+ Justify text by adding and removing kashidas.
+ </constant>
+ <constant name="JUSTIFICATION_WORD_BOUND" value="2" enum="JustificationFlag">
+ Justify text by changing width of the spaces between the words.
+ </constant>
+ <constant name="JUSTIFICATION_TRIM_EDGE_SPACES" value="4" enum="JustificationFlag">
+ Remove trailing and leading spaces from the justified text.
+ </constant>
+ <constant name="JUSTIFICATION_AFTER_LAST_TAB" value="8" enum="JustificationFlag">
+ Only apply justification to the part of the text after the last tab.
+ </constant>
+ <constant name="BREAK_NONE" value="0" enum="LineBreakFlag">
+ Do not break the line.
+ </constant>
+ <constant name="BREAK_MANDATORY" value="16" enum="LineBreakFlag">
+ Break the line at the line mandatory break characters (e.g. [code]"\n"[/code]).
+ </constant>
+ <constant name="BREAK_WORD_BOUND" value="32" enum="LineBreakFlag">
+ Break the line between the words.
+ </constant>
+ <constant name="BREAK_GRAPHEME_BOUND" value="64" enum="LineBreakFlag">
+ Break the line between any unconnected graphemes.
+ </constant>
+ <constant name="GRAPHEME_IS_RTL" value="2" enum="GraphemeFlag">
+ Grapheme is part of right-to-left or bottom-to-top run.
+ </constant>
+ <constant name="GRAPHEME_IS_VIRTUAL" value="4" enum="GraphemeFlag">
+ Grapheme is not part of source text, it was added by justification process.
+ </constant>
+ <constant name="GRAPHEME_IS_SPACE" value="8" enum="GraphemeFlag">
+ Grapheme is whitespace.
+ </constant>
+ <constant name="GRAPHEME_IS_BREAK_HARD" value="16" enum="GraphemeFlag">
+ Grapheme is mandatory break point (e.g. [code]"\n"[/code]).
+ </constant>
+ <constant name="GRAPHEME_IS_BREAK_SOFT" value="32" enum="GraphemeFlag">
+ Grapheme is optional break point (e.g. space).
+ </constant>
+ <constant name="GRAPHEME_IS_TAB" value="64" enum="GraphemeFlag">
+ Grapheme is the tabulation character.
+ </constant>
+ <constant name="GRAPHEME_IS_ELONGATION" value="128" enum="GraphemeFlag">
+ Grapheme is kashida.
+ </constant>
+ <constant name="GRAPHEME_IS_PUNCTUATION" value="256" enum="GraphemeFlag">
+ Grapheme is punctuation character.
+ </constant>
+ <constant name="HINTING_NONE" value="0" enum="Hinting">
+ Disables font hinting (smoother but less crisp).
+ </constant>
+ <constant name="HINTING_LIGHT" value="1" enum="Hinting">
+ Use the light font hinting mode.
+ </constant>
+ <constant name="HINTING_NORMAL" value="2" enum="Hinting">
+ Use the default font hinting mode (crisper but less smooth).
+ </constant>
+ <constant name="FEATURE_BIDI_LAYOUT" value="1" enum="Feature">
+ TextServer supports bidirectional layouts.
+ </constant>
+ <constant name="FEATURE_VERTICAL_LAYOUT" value="2" enum="Feature">
+ TextServer supports vertical layouts.
+ </constant>
+ <constant name="FEATURE_SHAPING" value="4" enum="Feature">
+ TextServer supports complex text shaping.
+ </constant>
+ <constant name="FEATURE_KASHIDA_JUSTIFICATION" value="8" enum="Feature">
+ TextServer supports justification using kashidas.
+ </constant>
+ <constant name="FEATURE_BREAK_ITERATORS" value="16" enum="Feature">
+ TextServer supports complex line/word breaking rules (e.g. dictionary based).
+ </constant>
+ <constant name="FEATURE_FONT_SYSTEM" value="32" enum="Feature">
+ TextServer supports loading system fonts.
+ </constant>
+ <constant name="FEATURE_FONT_VARIABLE" value="64" enum="Feature">
+ TextServer supports variable fonts.
+ </constant>
+ <constant name="FEATURE_USE_SUPPORT_DATA" value="128" enum="Feature">
+ TextServer require external data file for some features.
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/TextServerManager.xml b/doc/classes/TextServerManager.xml
new file mode 100644
index 0000000000..29586f30b4
--- /dev/null
+++ b/doc/classes/TextServerManager.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="TextServerManager" inherits="Object" version="4.0">
+ <brief_description>
+ Manager for the font and complex text layout servers.
+ </brief_description>
+ <description>
+ [TextServerManager] is the API backend for loading, enumeration and switching [TextServer]s.
+ Note: Switching text server at runtime is possible, but will invalidate all fonts and text buffers. Make sure to unload all controls, fonts, and themes before doing so.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="find_interface" qualifiers="const">
+ <return type="TextServer">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ Finds an interface by its name.
+ </description>
+ </method>
+ <method name="get_interface" qualifiers="const">
+ <return type="TextServer">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ Returns the interface registered at a given index.
+ </description>
+ </method>
+ <method name="get_interface_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the number of interfaces currently registered.
+ </description>
+ </method>
+ <method name="get_interface_features" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ Returns text server supported features (binary OR).
+ </description>
+ </method>
+ <method name="get_interface_name" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ Returns the interface name registered at a given index.
+ </description>
+ </method>
+ <method name="get_interfaces" qualifiers="const">
+ <return type="Array">
+ </return>
+ <description>
+ Returns a list of available interfaces the index and name of each interface.
+ </description>
+ </method>
+ <method name="get_primary_interface" qualifiers="const">
+ <return type="TextServer">
+ </return>
+ <description>
+ Returns the primary [TextServer] interface.
+ </description>
+ </method>
+ <method name="set_primary_interface">
+ <return type="bool">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ Sets (and initializes it if required) interface registered at a given index as the primary. Invalidates all references to the fonts and text buffers.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Texture2D.xml b/doc/classes/Texture2D.xml
index f283efdc3d..2270b95c63 100644
--- a/doc/classes/Texture2D.xml
+++ b/doc/classes/Texture2D.xml
@@ -7,6 +7,7 @@
A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D [Sprite2D] or GUI [Control].
Textures are often created by loading them from a file. See [method @GDScript.load].
[Texture2D] is a base for other resources. It cannot be used directly.
+ [b]Note:[/b] The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. Larger textures may fail to import.
</description>
<tutorials>
</tutorials>
@@ -22,16 +23,6 @@
</argument>
<argument index="3" name="transpose" type="bool" default="false">
</argument>
- <argument index="4" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="5" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_color_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="7" name="texture_filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" default="0">
- </argument>
- <argument index="8" name="texture_repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" default="0">
- </argument>
<description>
Draws the texture using a [CanvasItem] with the [RenderingServer] API at the specified [code]position[/code].
</description>
@@ -49,16 +40,6 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_color_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="texture_filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" default="0">
- </argument>
- <argument index="9" name="texture_repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" default="0">
- </argument>
<description>
Draws the texture using a [CanvasItem] with the [RenderingServer] API.
</description>
@@ -76,17 +57,7 @@
</argument>
<argument index="4" name="transpose" type="bool" default="false">
</argument>
- <argument index="5" name="normal_map" type="Texture2D" default="null">
- </argument>
- <argument index="6" name="specular_map" type="Texture2D" default="null">
- </argument>
- <argument index="7" name="specular_color_shininess" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <argument index="8" name="texture_filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" default="0">
- </argument>
- <argument index="9" name="texture_repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" default="0">
- </argument>
- <argument index="10" name="clip_uv" type="bool" default="true">
+ <argument index="5" name="clip_uv" type="bool" default="true">
</argument>
<description>
Draws a part of the texture using a [CanvasItem] with the [RenderingServer] API.
diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml
index a5172586fe..70bf138f27 100644
--- a/doc/classes/TextureButton.xml
+++ b/doc/classes/TextureButton.xml
@@ -6,8 +6,10 @@
<description>
[TextureButton] has the same functionality as [Button], except it uses sprites instead of Godot's [Theme] resource. It is faster to create, but it doesn't support localization like more complex [Control]s.
The "normal" state must contain a texture ([member texture_normal]); other textures are optional.
+ See also [BaseButton] which contains common properties and methods associated with this node.
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgressBar.xml
index 4937121ebf..56a7365855 100644
--- a/doc/classes/TextureProgress.xml
+++ b/doc/classes/TextureProgressBar.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="TextureProgress" inherits="Range" version="4.0">
+<class name="TextureProgressBar" inherits="Range" version="4.0">
<brief_description>
Texture-based progress bar. Useful for loading screens and life or stamina bars.
</brief_description>
<description>
- TextureProgress works like [ProgressBar], but uses up to 3 textures instead of Godot's [Theme] resource. It can be used to create horizontal, vertical and radial progress bars.
+ TextureProgressBar works like [ProgressBar], but uses up to 3 textures instead of Godot's [Theme] resource. It can be used to create horizontal, vertical and radial progress bars.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml
index 709d87b858..743e7f6d1e 100644
--- a/doc/classes/TextureRect.xml
+++ b/doc/classes/TextureRect.xml
@@ -7,6 +7,7 @@
Used to draw icons and sprites in a user interface. The texture's placement can be controlled with the [member stretch_mode] property. It can scale, tile, or stay centered inside its bounding rectangle.
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml
index 2824159f0e..3f7f22ebcd 100644
--- a/doc/classes/Theme.xml
+++ b/doc/classes/Theme.xml
@@ -23,10 +23,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears the [Color] at [code]name[/code] if the theme has [code]type[/code].
+ Clears the [Color] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="clear_constant">
@@ -34,10 +34,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears the constant at [code]name[/code] if the theme has [code]type[/code].
+ Clears the constant at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="clear_font">
@@ -45,10 +45,21 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears the [Font] at [code]name[/code] if the theme has [code]type[/code].
+ Clears the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
+ </description>
+ </method>
+ <method name="clear_font_size">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="node_type" type="StringName">
+ </argument>
+ <description>
+ Clears the font size [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="clear_icon">
@@ -56,10 +67,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears the icon at [code]name[/code] if the theme has [code]type[/code].
+ Clears the icon at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="clear_stylebox">
@@ -67,10 +78,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Clears [StyleBox] at [code]name[/code] if the theme has [code]type[/code].
+ Clears [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="copy_default_theme">
@@ -94,19 +105,26 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the [Color] at [code]name[/code] if the theme has [code]type[/code].
+ Returns the [Color] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_color_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the [Color]s as a [PackedStringArray] filled with each [Color]'s name, for use in [method get_color], if the theme has [code]type[/code].
+ Returns all the [Color]s as a [PackedStringArray] filled with each [Color]'s name, for use in [method get_color], if the theme has [code]node_type[/code].
+ </description>
+ </method>
+ <method name="get_color_type_list" qualifiers="const">
+ <return type="PackedStringArray">
+ </return>
+ <description>
+ Returns all the [Color] types as a [PackedStringArray] filled with unique type names, for use in [method get_color] and/or [method get_color_list].
</description>
</method>
<method name="get_constant" qualifiers="const">
@@ -114,19 +132,26 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the constant at [code]name[/code] if the theme has [code]type[/code].
+ Returns the constant at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_constant_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the constants as a [PackedStringArray] filled with each constant's name, for use in [method get_constant], if the theme has [code]type[/code].
+ Returns all the constants as a [PackedStringArray] filled with each constant's name, for use in [method get_constant], if the theme has [code]node_type[/code].
+ </description>
+ </method>
+ <method name="get_constant_type_list" qualifiers="const">
+ <return type="PackedStringArray">
+ </return>
+ <description>
+ Returns all the constant types as a [PackedStringArray] filled with unique type names, for use in [method get_constant] and/or [method get_constant_list].
</description>
</method>
<method name="get_font" qualifiers="const">
@@ -134,19 +159,46 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the [Font] at [code]name[/code] if the theme has [code]type[/code].
+ Returns the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_font_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the [Font]s as a [PackedStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]type[/code].
+ Returns all the [Font]s as a [PackedStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]node_type[/code].
+ </description>
+ </method>
+ <method name="get_font_size" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="node_type" type="StringName">
+ </argument>
+ <description>
+ Returns the font size at [code]name[/code] if the theme has [code]node_type[/code].
+ </description>
+ </method>
+ <method name="get_font_size_list" qualifiers="const">
+ <return type="PackedStringArray">
+ </return>
+ <argument index="0" name="node_type" type="String">
+ </argument>
+ <description>
+ Returns all the font sizes as a [PackedStringArray] filled with each font size name, for use in [method get_font_size], if the theme has [code]node_type[/code].
+ </description>
+ </method>
+ <method name="get_font_type_list" qualifiers="const">
+ <return type="PackedStringArray">
+ </return>
+ <description>
+ Returns all the [Font] types as a [PackedStringArray] filled with unique type names, for use in [method get_font] and/or [method get_font_list].
</description>
</method>
<method name="get_icon" qualifiers="const">
@@ -154,19 +206,26 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]type[/code].
+ Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_icon_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the icons as a [PackedStringArray] filled with each [Texture2D]'s name, for use in [method get_icon], if the theme has [code]type[/code].
+ Returns all the icons as a [PackedStringArray] filled with each [Texture2D]'s name, for use in [method get_icon], if the theme has [code]node_type[/code].
+ </description>
+ </method>
+ <method name="get_icon_type_list" qualifiers="const">
+ <return type="PackedStringArray">
+ </return>
+ <description>
+ Returns all the icon types as a [PackedStringArray] filled with unique type names, for use in [method get_icon] and/or [method get_icon_list].
</description>
</method>
<method name="get_stylebox" qualifiers="const">
@@ -174,35 +233,33 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns the icon [StyleBox] at [code]name[/code] if the theme has [code]type[/code].
+ Returns the icon [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
</description>
</method>
<method name="get_stylebox_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="node_type" type="String">
</argument>
<description>
- Returns all the [StyleBox]s as a [PackedStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]type[/code].
+ Returns all the [StyleBox]s as a [PackedStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]node_type[/code].
</description>
</method>
- <method name="get_stylebox_types" qualifiers="const">
+ <method name="get_stylebox_type_list" qualifiers="const">
<return type="PackedStringArray">
</return>
<description>
- Returns all the [StyleBox] types as a [PackedStringArray] filled with each [StyleBox]'s type, for use in [method get_stylebox] and/or [method get_stylebox_list], if the theme has [code]type[/code].
+ Returns all the [StyleBox] types as a [PackedStringArray] filled with unique type names, for use in [method get_stylebox] and/or [method get_stylebox_list].
</description>
</method>
<method name="get_type_list" qualifiers="const">
<return type="PackedStringArray">
</return>
- <argument index="0" name="type" type="String">
- </argument>
<description>
- Returns all the types in [code]type[/code] as a [PackedStringArray] for use in any of the [code]get_*[/code] functions, if the theme has [code]type[/code].
+ Returns all the theme types as a [PackedStringArray] filled with unique type names, for use in other [code]get_*[/code] functions of this theme.
</description>
</method>
<method name="has_color" qualifiers="const">
@@ -210,11 +267,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="has_constant" qualifiers="const">
@@ -222,11 +279,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if constant with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if constant with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="has_font" qualifiers="const">
@@ -234,11 +291,23 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
+ </argument>
+ <description>
+ Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
+ </description>
+ </method>
+ <method name="has_font_size" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if font size with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="has_icon" qualifiers="const">
@@ -246,11 +315,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if icon [Texture2D] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if icon [Texture2D] with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="has_stylebox" qualifiers="const">
@@ -258,11 +327,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<description>
- Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the theme does not have [code]type[/code].
+ Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_color">
@@ -270,13 +339,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="color" type="Color">
</argument>
<description>
- Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_constant">
@@ -284,13 +353,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="constant" type="int">
</argument>
<description>
- Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_font">
@@ -298,13 +367,27 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="font" type="Font">
</argument>
<description>
- Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
+ </description>
+ </method>
+ <method name="set_font_size">
+ <return type="void">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="node_type" type="StringName">
+ </argument>
+ <argument index="2" name="font_size" type="int">
+ </argument>
+ <description>
+ Sets the theme's font size to [code]font_size[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_icon">
@@ -312,13 +395,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="texture" type="Texture2D">
</argument>
<description>
- Sets the theme's icon [Texture2D] to [code]texture[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets the theme's icon [Texture2D] to [code]texture[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
<method name="set_stylebox">
@@ -326,13 +409,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
- <argument index="1" name="type" type="StringName">
+ <argument index="1" name="node_type" type="StringName">
</argument>
<argument index="2" name="texture" type="StyleBox">
</argument>
<description>
- Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the theme does not have [code]type[/code].
+ Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
</description>
</method>
</methods>
@@ -340,6 +423,9 @@
<member name="default_font" type="Font" setter="set_default_font" getter="get_default_font">
The theme's default font.
</member>
+ <member name="default_font_size" type="int" setter="set_default_font_size" getter="get_default_font_size" default="-1">
+ The theme's default font size. Set to [code]-1[/code] to ignore and use global default.
+ </member>
</members>
<constants>
</constants>
diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml
index 46377ecf20..88f46e3937 100644
--- a/doc/classes/Thread.xml
+++ b/doc/classes/Thread.xml
@@ -10,6 +10,7 @@
<tutorials>
<link title="Using multiple threads">https://docs.godotengine.org/en/latest/tutorials/threads/using_multiple_threads.html</link>
<link title="Thread-safe APIs">https://docs.godotengine.org/en/latest/tutorials/threads/thread_safe_apis.html</link>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
<method name="get_id" qualifiers="const">
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index 2780545f55..c500052592 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -8,6 +8,12 @@
</description>
<tutorials>
<link title="Using Tilemaps">https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
+ <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link>
+ <link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/111</link>
+ <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
<method name="clear">
@@ -274,7 +280,7 @@
Position for tile origin. See [enum TileOrigin] for possible values.
</member>
<member name="cell_y_sort" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false">
- If [code]true[/code], the TileMap's children will be drawn in order of their Y coordinate.
+ If [code]true[/code], the TileMap's direct children will be drawn in order of their Y coordinate.
</member>
<member name="centered_textures" type="bool" setter="set_centered_textures" getter="is_centered_textures_enabled" default="false">
If [code]true[/code], the textures will be centered in the middle of each tile. This is useful for certain isometric or top-down modes when textures are made larger or smaller than the tiles (e.g. to avoid flickering on tile edges). The offset is still applied, but from the center of the tile. If used, [member compatibility_mode] is ignored.
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index 4991a1e58b..adc5880c71 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -8,6 +8,13 @@
Tiles are referenced by a unique integer ID.
</description>
<tutorials>
+ <link title="Using Tilemaps">https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link>
+ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
+ <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link>
+ <link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/111</link>
+ <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link>
+ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
+ <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
<method name="_forward_atlas_subtile_selection" qualifiers="virtual">
@@ -382,15 +389,6 @@
Returns the offset of the tile's navigation polygon.
</description>
</method>
- <method name="tile_get_normal_map" qualifiers="const">
- <return type="Texture2D">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's normal map texture.
- </description>
- </method>
<method name="tile_get_occluder_offset" qualifiers="const">
<return type="Vector2">
</return>
@@ -593,18 +591,6 @@
Sets an offset for the tile's navigation polygon.
</description>
</method>
- <method name="tile_set_normal_map">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="normal_map" type="Texture2D">
- </argument>
- <description>
- Sets the tile's normal map texture.
- [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
- </description>
- </method>
<method name="tile_set_occluder_offset">
<return type="void">
</return>
diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml
index 5d684755fa..ab75e21ce8 100644
--- a/doc/classes/Timer.xml
+++ b/doc/classes/Timer.xml
@@ -8,6 +8,7 @@
[b]Note:[/b] To create an one-shot timer without instantiating a node, use [method SceneTree.create_timer].
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="is_stopped" qualifiers="const">
diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml
index 09dfe56f8f..cda69f6a64 100644
--- a/doc/classes/Transform.xml
+++ b/doc/classes/Transform.xml
@@ -11,59 +11,51 @@
<link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
<link title="Matrices and transforms">https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link>
<link title="Using 3D transforms">https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
+ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link>
</tutorials>
<methods>
- <method name="Transform">
+ <method name="Transform" qualifiers="constructor">
<return type="Transform">
</return>
- <argument index="0" name="x_axis" type="Vector3">
- </argument>
- <argument index="1" name="y_axis" type="Vector3">
- </argument>
- <argument index="2" name="z_axis" type="Vector3">
- </argument>
- <argument index="3" name="origin" type="Vector3">
- </argument>
<description>
- Constructs a Transform from four [Vector3] values (matrix columns). Each axis corresponds to local basis vectors (some of which may be scaled).
+ Constructs a default-initialized [Transform] set to [constant IDENTITY].
</description>
</method>
- <method name="Transform">
+ <method name="Transform" qualifiers="constructor">
<return type="Transform">
</return>
- <argument index="0" name="basis" type="Basis">
- </argument>
- <argument index="1" name="origin" type="Vector3">
+ <argument index="0" name="from" type="Transform">
</argument>
<description>
- Constructs a Transform from a [Basis] and [Vector3].
+ Constructs a [Transform] as a copy of the given [Transform].
</description>
</method>
- <method name="Transform">
+ <method name="Transform" qualifiers="constructor">
<return type="Transform">
</return>
- <argument index="0" name="from" type="Transform2D">
+ <argument index="0" name="basis" type="Basis">
</argument>
- <description>
- Constructs a Transform from a [Transform2D].
- </description>
- </method>
- <method name="Transform">
- <return type="Transform">
- </return>
- <argument index="0" name="from" type="Quat">
+ <argument index="1" name="origin" type="Vector3">
</argument>
<description>
- Constructs a Transform from a [Quat]. The origin will be [code]Vector3(0, 0, 0)[/code].
+ Constructs a Transform from a [Basis] and [Vector3].
</description>
</method>
- <method name="Transform">
+ <method name="Transform" qualifiers="constructor">
<return type="Transform">
</return>
- <argument index="0" name="from" type="Basis">
+ <argument index="0" name="x_axis" type="Vector3">
+ </argument>
+ <argument index="1" name="y_axis" type="Vector3">
+ </argument>
+ <argument index="2" name="z_axis" type="Vector3">
+ </argument>
+ <argument index="3" name="origin" type="Vector3">
</argument>
<description>
- Constructs the Transform from a [Basis]. The origin will be Vector3(0, 0, 0).
+ Constructs a Transform from four [Vector3] values (matrix columns). Each axis corresponds to local basis vectors (some of which may be scaled).
</description>
</method>
<method name="affine_inverse">
@@ -76,7 +68,7 @@
<method name="interpolate_with">
<return type="Transform">
</return>
- <argument index="0" name="transform" type="Transform">
+ <argument index="0" name="xform" type="Transform">
</argument>
<argument index="1" name="weight" type="float">
</argument>
@@ -94,7 +86,7 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="transform" type="Transform">
+ <argument index="0" name="xform" type="Transform">
</argument>
<description>
Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
@@ -113,6 +105,54 @@
Operations take place in global space.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="PackedVector3Array">
+ </return>
+ <argument index="0" name="right" type="PackedVector3Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Transform">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="AABB">
+ </return>
+ <argument index="0" name="right" type="AABB">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="orthonormalized">
<return type="Transform">
</return>
@@ -150,24 +190,6 @@
Unlike [method rotated] and [method scaled], this does not use matrix multiplication.
</description>
</method>
- <method name="xform">
- <return type="Variant">
- </return>
- <argument index="0" name="v" type="Variant">
- </argument>
- <description>
- Transforms the given [Vector3], [Plane], [AABB], or [PackedVector3Array] by this transform.
- </description>
- </method>
- <method name="xform_inv">
- <return type="Variant">
- </return>
- <argument index="0" name="v" type="Variant">
- </argument>
- <description>
- Inverse-transforms the given [Vector3], [Plane], [AABB], or [PackedVector3Array] by this transform.
- </description>
- </method>
</methods>
<members>
<member name="basis" type="Basis" setter="" getter="" default="Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )">
diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml
index 5da88892fe..406774cbfe 100644
--- a/doc/classes/Transform2D.xml
+++ b/doc/classes/Transform2D.xml
@@ -8,32 +8,29 @@
For more information, read the "Matrices and transforms" documentation article.
</description>
<tutorials>
+ <link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
<link title="Matrices and transforms">https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="2.5D Demo">https://godotengine.org/asset-library/asset/583</link>
</tutorials>
<methods>
- <method name="Transform2D">
+ <method name="Transform2D" qualifiers="constructor">
<return type="Transform2D">
</return>
- <argument index="0" name="from" type="Transform">
- </argument>
<description>
- Constructs the transform from a 3D [Transform].
+ Constructs a default-initialized [Transform] set to [constant IDENTITY].
</description>
</method>
- <method name="Transform2D">
+ <method name="Transform2D" qualifiers="constructor">
<return type="Transform2D">
</return>
- <argument index="0" name="x_axis" type="Vector2">
- </argument>
- <argument index="1" name="y_axis" type="Vector2">
- </argument>
- <argument index="2" name="origin" type="Vector2">
+ <argument index="0" name="from" type="Transform2D">
</argument>
<description>
- Constructs the transform from 3 [Vector2] values representing [member x], [member y], and the [member origin] (the three column vectors).
+ Constructs a [Transform2D] as a copy of the given [Transform2D].
</description>
</method>
- <method name="Transform2D">
+ <method name="Transform2D" qualifiers="constructor">
<return type="Transform2D">
</return>
<argument index="0" name="rotation" type="float">
@@ -44,6 +41,19 @@
Constructs the transform from a given angle (in radians) and position.
</description>
</method>
+ <method name="Transform2D" qualifiers="constructor">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="x_axis" type="Vector2">
+ </argument>
+ <argument index="1" name="y_axis" type="Vector2">
+ </argument>
+ <argument index="2" name="origin" type="Vector2">
+ </argument>
+ <description>
+ Constructs the transform from 3 [Vector2] values representing [member x], [member y], and the [member origin] (the three column vectors).
+ </description>
+ </method>
<method name="affine_inverse">
<return type="Transform2D">
</return>
@@ -95,12 +105,12 @@
<method name="interpolate_with">
<return type="Transform2D">
</return>
- <argument index="0" name="transform" type="Transform2D">
+ <argument index="0" name="xform" type="Transform2D">
</argument>
<argument index="1" name="weight" type="float">
</argument>
<description>
- Returns a transform interpolated between this transform and another by a given weight (on the range of 0.0 to 1.0).
+ Returns a transform interpolated between this transform and another by a given [code]weight[/code] (on the range of 0.0 to 1.0).
</description>
</method>
<method name="inverse">
@@ -113,12 +123,68 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="transform" type="Transform2D">
+ <argument index="0" name="xform" type="Transform2D">
</argument>
<description>
Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Rect2">
+ </return>
+ <argument index="0" name="right" type="Rect2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Transform2D">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="PackedVector2Array">
+ </return>
+ <argument index="0" name="right" type="PackedVector2Array">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="orthonormalized">
<return type="Transform2D">
</return>
@@ -154,24 +220,6 @@
Unlike [method rotated] and [method scaled], this does not use matrix multiplication.
</description>
</method>
- <method name="xform">
- <return type="Variant">
- </return>
- <argument index="0" name="v" type="Variant">
- </argument>
- <description>
- Transforms the given [Vector2], [Rect2], or [PackedVector2Array] by this transform.
- </description>
- </method>
- <method name="xform_inv">
- <return type="Variant">
- </return>
- <argument index="0" name="v" type="Variant">
- </argument>
- <description>
- Inverse-transforms the given [Vector2], [Rect2], or [PackedVector2Array] by this transform.
- </description>
- </method>
</methods>
<members>
<member name="origin" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index 0b2fb80480..01818e2993 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -35,6 +35,15 @@
Clears the tree. This removes all items.
</description>
</method>
+ <method name="clear_column_title_opentype_features">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ Removes all OpenType features from the item's text.
+ </description>
+ </method>
<method name="create_item">
<return type="TreeItem">
</return>
@@ -75,6 +84,35 @@
Returns the column's title.
</description>
</method>
+ <method name="get_column_title_direction" qualifiers="const">
+ <return type="int" enum="Control.TextDirection">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ Returns column title base writing direction.
+ </description>
+ </method>
+ <method name="get_column_title_language" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ Returns column title language code.
+ </description>
+ </method>
+ <method name="get_column_title_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code] of the column title.
+ </description>
+ </method>
<method name="get_column_width" qualifiers="const">
<return type="int">
</return>
@@ -106,14 +144,21 @@
<return type="TreeItem">
</return>
<description>
- Returns the currently edited item. This is only available for custom cell mode.
+ Returns the currently edited item. Can be used with [signal item_edited] to get the item that was modified.
+ [codeblock]
+ func _ready():
+ $Tree.item_edited.connect(on_Tree_item_edited)
+
+ func on_Tree_item_edited():
+ print($Tree.get_edited()) # This item just got edited (e.g. checked).
+ [/codeblock]
</description>
</method>
<method name="get_edited_column" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the column for the currently edited item. This is only available for custom cell mode.
+ Returns the column for the currently edited item.
</description>
</method>
<method name="get_item_area_rect" qualifiers="const">
@@ -218,6 +263,41 @@
Sets the title of a column.
</description>
</method>
+ <method name="set_column_title_direction">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="direction" type="int" enum="Control.TextDirection">
+ </argument>
+ <description>
+ Sets column title base writing direction.
+ </description>
+ </method>
+ <method name="set_column_title_language">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="language" type="String">
+ </argument>
+ <description>
+ Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+ </description>
+ </method>
+ <method name="set_column_title_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <argument index="2" name="value" type="int">
+ </argument>
+ <description>
+ Sets OpenType feature [code]tag[/code] for the column title.
+ </description>
+ </method>
<method name="set_column_titles_visible">
<return type="void">
</return>
@@ -391,7 +471,10 @@
The arrow icon used when a foldable item is not collapsed.
</theme_item>
<theme_item name="arrow_collapsed" type="Texture2D">
- The arrow icon used when a foldable item is collapsed.
+ The arrow icon used when a foldable item is collapsed (for left-to-right layouts).
+ </theme_item>
+ <theme_item name="arrow_collapsed_mirrored" type="Texture2D">
+ The arrow icon used when a foldable item is collapsed (for right-to-left layouts).
</theme_item>
<theme_item name="bg" type="StyleBox">
Default [StyleBox] for the [Tree], i.e. used when the control is not being focused.
@@ -444,6 +527,9 @@
<theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )">
Text [Color] used when the item is selected.
</theme_item>
+ <theme_item name="font_size" type="int">
+ Font size of the item's text.
+ </theme_item>
<theme_item name="guide_color" type="Color" default="Color( 0, 0, 0, 0.1 )">
[Color] of the guideline.
</theme_item>
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index 22e643a51d..e97c1e580c 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -54,6 +54,15 @@
Resets the color for the given column to default.
</description>
</method>
+ <method name="clear_opentype_features">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ Removes all OpenType features.
+ </description>
+ </method>
<method name="deselect">
<return type="void">
</return>
@@ -184,6 +193,15 @@
Returns the icon [Texture2D] region as [Rect2].
</description>
</method>
+ <method name="get_language" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ Returns item's text language code.
+ </description>
+ </method>
<method name="get_metadata" qualifiers="const">
<return type="Variant">
</return>
@@ -209,6 +227,17 @@
If [code]wrap[/code] is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns [code]null[/code].
</description>
</method>
+ <method name="get_opentype_feature" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <description>
+ Returns OpenType feature [code]tag[/code] of the item's text.
+ </description>
+ </method>
<method name="get_parent">
<return type="TreeItem">
</return>
@@ -249,6 +278,22 @@
<description>
</description>
</method>
+ <method name="get_structured_text_bidi_override" qualifiers="const">
+ <return type="int" enum="Control.StructuredTextParser">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_structured_text_bidi_override_options" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_suffix" qualifiers="const">
<return type="String">
</return>
@@ -275,6 +320,15 @@
Returns the given column's text alignment.
</description>
</method>
+ <method name="get_text_direction" qualifiers="const">
+ <return type="int" enum="Control.TextDirection">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <description>
+ Returns item's text base writing direction.
+ </description>
+ </method>
<method name="get_tooltip" qualifiers="const">
<return type="String">
</return>
@@ -533,6 +587,17 @@
Sets the given column's icon's texture region.
</description>
</method>
+ <method name="set_language">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="language" type="String">
+ </argument>
+ <description>
+ Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+ </description>
+ </method>
<method name="set_metadata">
<return type="void">
</return>
@@ -543,6 +608,19 @@
<description>
</description>
</method>
+ <method name="set_opentype_feature">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="tag" type="String">
+ </argument>
+ <argument index="2" name="value" type="int">
+ </argument>
+ <description>
+ Sets OpenType feature [code]tag[/code] for the item's text.
+ </description>
+ </method>
<method name="set_range">
<return type="void">
</return>
@@ -580,6 +658,26 @@
If [code]true[/code], the given column is selectable.
</description>
</method>
+ <method name="set_structured_text_bidi_override">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="parser" type="int" enum="Control.StructuredTextParser">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_structured_text_bidi_override_options">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="args" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_suffix">
<return type="void">
</return>
@@ -611,6 +709,17 @@
Sets the given column's text alignment. See [enum TextAlign] for possible values.
</description>
</method>
+ <method name="set_text_direction">
+ <return type="void">
+ </return>
+ <argument index="0" name="column" type="int">
+ </argument>
+ <argument index="1" name="direction" type="int" enum="Control.TextDirection">
+ </argument>
+ <description>
+ Sets item's text base writing direction.
+ </description>
+ </method>
<method name="set_tooltip">
<return type="void">
</return>
diff --git a/doc/classes/VBoxContainer.xml b/doc/classes/VBoxContainer.xml
index 6b32a08f93..213f8fd742 100644
--- a/doc/classes/VBoxContainer.xml
+++ b/doc/classes/VBoxContainer.xml
@@ -7,6 +7,7 @@
Vertical box container. See [BoxContainer].
</description>
<tutorials>
+ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 52d719b6f7..05194337db 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -10,9 +10,30 @@
</description>
<tutorials>
<link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link>
+ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="All 2D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/2d</link>
</tutorials>
<methods>
- <method name="Vector2">
+ <method name="Vector2" qualifiers="constructor">
+ <return type="Vector2">
+ </return>
+ <description>
+ Constructs a default-initialized [Vector2] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Vector2" qualifiers="constructor">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="from" type="Vector2">
+ </argument>
+ <description>
+ Constructs a [Vector2] as a copy of the given [Vector2].
+ </description>
+ </method>
+ <method name="Vector2" qualifiers="constructor">
<return type="Vector2">
</return>
<argument index="0" name="from" type="Vector2i">
@@ -21,7 +42,7 @@
Constructs a new [Vector2] from [Vector2i].
</description>
</method>
- <method name="Vector2">
+ <method name="Vector2" qualifiers="constructor">
<return type="Vector2">
</return>
<argument index="0" name="x" type="float">
@@ -116,10 +137,10 @@
</argument>
<argument index="2" name="post_b" type="Vector2">
</argument>
- <argument index="3" name="t" type="float">
+ <argument index="3" name="weight" type="float">
</argument>
<description>
- Cubically interpolates between this vector and [code]b[/code] using [code]pre_a[/code] and [code]post_b[/code] as handles, and returns the result at position [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
+ Cubically interpolates between this vector and [code]b[/code] using [code]pre_a[/code] and [code]post_b[/code] as handles, and returns the result at position [code]weight[/code]. [code]weight[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="direction_to">
@@ -128,7 +149,7 @@
<argument index="0" name="b" type="Vector2">
</argument>
<description>
- Returns the normalized vector pointing from this vector to [code]b[/code].
+ Returns the normalized vector pointing from this vector to [code]b[/code]. This is equivalent to using [code](b - a).normalized()[/code].
</description>
</method>
<method name="distance_squared_to">
@@ -172,7 +193,7 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="v" type="Vector2">
+ <argument index="0" name="to" type="Vector2">
</argument>
<description>
Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
@@ -182,7 +203,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the vector is normalized, and false otherwise.
+ Returns [code]true[/code] if the vector is normalized, [code]false[/code] otherwise.
</description>
</method>
<method name="length">
@@ -203,9 +224,9 @@
<method name="lerp">
<return type="Vector2">
</return>
- <argument index="0" name="b" type="Vector2">
+ <argument index="0" name="to" type="Vector2">
</argument>
- <argument index="1" name="t" type="float">
+ <argument index="1" name="weight" type="float">
</argument>
<description>
Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
@@ -229,6 +250,146 @@
Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Transform2D">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="posmod">
<return type="Vector2">
</return>
@@ -291,9 +452,9 @@
<method name="slerp">
<return type="Vector2">
</return>
- <argument index="0" name="b" type="Vector2">
+ <argument index="0" name="to" type="Vector2">
</argument>
- <argument index="1" name="t" type="float">
+ <argument index="1" name="weight" type="float">
</argument>
<description>
Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml
index 3ad926210b..a4ea5c2742 100644
--- a/doc/classes/Vector2i.xml
+++ b/doc/classes/Vector2i.xml
@@ -10,20 +10,27 @@
</description>
<tutorials>
<link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link>
</tutorials>
<methods>
- <method name="Vector2i">
+ <method name="Vector2i" qualifiers="constructor">
<return type="Vector2i">
</return>
- <argument index="0" name="x" type="int">
- </argument>
- <argument index="1" name="y" type="int">
+ <description>
+ Constructs a default-initialized [Vector2i] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Vector2i" qualifiers="constructor">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="from" type="Vector2i">
</argument>
<description>
- Constructs a new [Vector2i] from the given [code]x[/code] and [code]y[/code].
+ Constructs a [Vector2i] as a copy of the given [Vector2i].
</description>
</method>
- <method name="Vector2i">
+ <method name="Vector2i" qualifiers="constructor">
<return type="Vector2i">
</return>
<argument index="0" name="from" type="Vector2">
@@ -32,6 +39,17 @@
Constructs a new [Vector2i] from [Vector2]. The floating point coordinates will be truncated.
</description>
</method>
+ <method name="Vector2i" qualifiers="constructor">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="x" type="int">
+ </argument>
+ <argument index="1" name="y" type="int">
+ </argument>
+ <description>
+ Constructs a new [Vector2i] from the given [code]x[/code] and [code]y[/code].
+ </description>
+ </method>
<method name="abs">
<return type="Vector2i">
</return>
@@ -46,6 +64,154 @@
Returns the ratio of [member x] to [member y].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="sign">
<return type="Vector2i">
</return>
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index 608b976f6f..14a829d7a5 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -10,9 +10,30 @@
</description>
<tutorials>
<link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link>
+ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link>
+ <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link>
+ <link title="All 3D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/3d</link>
</tutorials>
<methods>
- <method name="Vector3">
+ <method name="Vector3" qualifiers="constructor">
+ <return type="Vector3">
+ </return>
+ <description>
+ Constructs a default-initialized [Vector3] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Vector3" qualifiers="constructor">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <description>
+ Constructs a [Vector3] as a copy of the given [Vector3].
+ </description>
+ </method>
+ <method name="Vector3" qualifiers="constructor">
<return type="Vector3">
</return>
<argument index="0" name="from" type="Vector3i">
@@ -21,7 +42,7 @@
Constructs a new [Vector3] from [Vector3i].
</description>
</method>
- <method name="Vector3">
+ <method name="Vector3" qualifiers="constructor">
<return type="Vector3">
</return>
<argument index="0" name="x" type="float">
@@ -69,7 +90,7 @@
<method name="cross">
<return type="Vector3">
</return>
- <argument index="0" name="b" type="Vector3">
+ <argument index="0" name="with" type="Vector3">
</argument>
<description>
Returns the cross product of this vector and [code]b[/code].
@@ -84,10 +105,10 @@
</argument>
<argument index="2" name="post_b" type="Vector3">
</argument>
- <argument index="3" name="t" type="float">
+ <argument index="3" name="weight" type="float">
</argument>
<description>
- Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
+ Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount [code]weight[/code]. [code]weight[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="direction_to">
@@ -96,7 +117,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the normalized vector pointing from this vector to [code]b[/code].
+ Returns the normalized vector pointing from this vector to [code]b[/code]. This is equivalent to using [code](b - a).normalized()[/code].
</description>
</method>
<method name="distance_squared_to">
@@ -121,7 +142,7 @@
<method name="dot">
<return type="float">
</return>
- <argument index="0" name="b" type="Vector3">
+ <argument index="0" name="with" type="Vector3">
</argument>
<description>
Returns the dot product of this vector and [code]b[/code]. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player.
@@ -147,7 +168,7 @@
<method name="is_equal_approx">
<return type="bool">
</return>
- <argument index="0" name="v" type="Vector3">
+ <argument index="0" name="to" type="Vector3">
</argument>
<description>
Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
@@ -157,7 +178,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the vector is normalized, and false otherwise.
+ Returns [code]true[/code] if the vector is normalized, [code]false[/code] otherwise.
</description>
</method>
<method name="length">
@@ -178,12 +199,12 @@
<method name="lerp">
<return type="Vector3">
</return>
- <argument index="0" name="b" type="Vector3">
+ <argument index="0" name="to" type="Vector3">
</argument>
- <argument index="1" name="t" type="float">
+ <argument index="1" name="weight" type="float">
</argument>
<description>
- Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
+ Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]weight[/code]. [code]weight[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="max_axis">
@@ -218,10 +239,166 @@
Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Basis">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Quat">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Transform">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="outer">
<return type="Basis">
</return>
- <argument index="0" name="b" type="Vector3">
+ <argument index="0" name="with" type="Vector3">
</argument>
<description>
Returns the outer product with [code]b[/code].
@@ -266,7 +443,7 @@
<method name="rotated">
<return type="Vector3">
</return>
- <argument index="0" name="axis" type="Vector3">
+ <argument index="0" name="by_axis" type="Vector3">
</argument>
<argument index="1" name="phi" type="float">
</argument>
@@ -291,9 +468,9 @@
<method name="slerp">
<return type="Vector3">
</return>
- <argument index="0" name="b" type="Vector3">
+ <argument index="0" name="to" type="Vector3">
</argument>
- <argument index="1" name="t" type="float">
+ <argument index="1" name="weight" type="float">
</argument>
<description>
Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml
index bd7c354241..a1ae2aceab 100644
--- a/doc/classes/Vector3i.xml
+++ b/doc/classes/Vector3i.xml
@@ -10,9 +10,36 @@
</description>
<tutorials>
<link title="Math tutorial index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
+ <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link>
</tutorials>
<methods>
- <method name="Vector3i">
+ <method name="Vector3i" qualifiers="constructor">
+ <return type="Vector3i">
+ </return>
+ <description>
+ Constructs a default-initialized [Vector3i] with all components set to [code]0[/code].
+ </description>
+ </method>
+ <method name="Vector3i" qualifiers="constructor">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="from" type="Vector3i">
+ </argument>
+ <description>
+ Constructs a [Vector3i] as a copy of the given [Vector3i].
+ </description>
+ </method>
+ <method name="Vector3i" qualifiers="constructor">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="from" type="Vector3">
+ </argument>
+ <description>
+ Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated.
+ </description>
+ </method>
+ <method name="Vector3i" qualifiers="constructor">
<return type="Vector3i">
</return>
<argument index="0" name="x" type="int">
@@ -25,13 +52,10 @@
Returns a [Vector3i] with the given components.
</description>
</method>
- <method name="Vector3i">
+ <method name="abs">
<return type="Vector3i">
</return>
- <argument index="0" name="from" type="Vector3">
- </argument>
<description>
- Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated.
</description>
</method>
<method name="max_axis">
@@ -48,6 +72,154 @@
Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z].
</description>
</method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator []" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="sign">
<return type="Vector3i">
</return>
diff --git a/doc/classes/VehicleBody3D.xml b/doc/classes/VehicleBody3D.xml
index 5a2cce376e..90d0591949 100644
--- a/doc/classes/VehicleBody3D.xml
+++ b/doc/classes/VehicleBody3D.xml
@@ -9,6 +9,7 @@
[b]Note:[/b] This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another [PhysicsBody3D] class.
</description>
<tutorials>
+ <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link>
</tutorials>
<methods>
</methods>
@@ -25,7 +26,6 @@
<member name="steering" type="float" setter="set_steering" getter="get_steering" default="0.0">
The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have [member VehicleWheel3D.use_as_steering] set to [code]true[/code] will automatically be rotated.
</member>
- <member name="weight" type="float" setter="set_weight" getter="get_weight" override="true" default="392.0" />
</members>
<constants>
</constants>
diff --git a/doc/classes/VehicleWheel3D.xml b/doc/classes/VehicleWheel3D.xml
index 97b2abfa92..fb0cb03d1c 100644
--- a/doc/classes/VehicleWheel3D.xml
+++ b/doc/classes/VehicleWheel3D.xml
@@ -8,6 +8,7 @@
[b]Note:[/b] This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another [PhysicsBody3D] class.
</description>
<tutorials>
+ <link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link>
</tutorials>
<methods>
<method name="get_rpm" qualifiers="const">
diff --git a/doc/classes/VideoPlayer.xml b/doc/classes/VideoPlayer.xml
index 91c8ad0a77..80f97c3419 100644
--- a/doc/classes/VideoPlayer.xml
+++ b/doc/classes/VideoPlayer.xml
@@ -5,7 +5,8 @@
</brief_description>
<description>
Control node for playing video streams using [VideoStream] resources.
- Supported video formats are [url=https://www.webmproject.org/]WebM[/url] ([VideoStreamWebm]), [url=https://www.theora.org/]Ogg Theora[/url] ([VideoStreamTheora]), and any format exposed via a GDNative plugin using [VideoStreamGDNative].
+ Supported video formats are [url=https://www.webmproject.org/]WebM[/url] ([code].webm[/code], [VideoStreamWebm]), [url=https://www.theora.org/]Ogg Theora[/url] ([code].ogv[/code], [VideoStreamTheora]), and any format exposed via a GDNative plugin using [VideoStreamGDNative].
+ [b]Note:[/b] Due to a bug, VideoPlayer does not support localization remapping yet.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index e42c4021ab..e2cf848f45 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -14,6 +14,12 @@
<tutorials>
<link title="Viewport and canvas transforms">https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
<link title="Viewports tutorial index">https://docs.godotengine.org/en/latest/tutorials/viewports/index.html</link>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
+ <link title="3D in 2D Demo">https://godotengine.org/asset-library/asset/128</link>
+ <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link>
+ <link title="Screen Capture Demo">https://godotengine.org/asset-library/asset/130</link>
+ <link title="Dynamic Split Screen Demo">https://godotengine.org/asset-library/asset/541</link>
+ <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link>
</tutorials>
<methods>
<method name="find_world_2d" qualifiers="const">
@@ -228,6 +234,10 @@
<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.
</member>
+ <member name="sdf_oversize" type="int" setter="set_sdf_oversize" getter="get_sdf_oversize" enum="Viewport.SDFOversize" default="1">
+ </member>
+ <member name="sdf_scale" type="int" setter="set_sdf_scale" getter="get_sdf_scale" enum="Viewport.SDFScale" default="1">
+ </member>
<member name="shadow_atlas_quad_0" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" enum="Viewport.ShadowAtlasQuadrantSubdiv" default="2">
The subdivision amount of the first quadrant on the shadow atlas.
</member>
@@ -244,9 +254,15 @@
The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2.
[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-created viewports default to a value of 0, this value must be set above 0 manually.
</member>
+ <member name="snap_2d_transforms_to_pixel" type="bool" setter="set_snap_2d_transforms_to_pixel" getter="is_snap_2d_transforms_to_pixel_enabled" default="false">
+ </member>
+ <member name="snap_2d_vertices_to_pixel" type="bool" setter="set_snap_2d_vertices_to_pixel" getter="is_snap_2d_vertices_to_pixel_enabled" default="false">
+ </member>
<member name="transparent_bg" type="bool" setter="set_transparent_background" getter="has_transparent_background" default="false">
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">
+ </member>
<member name="world_2d" type="World2D" setter="set_world_2d" getter="get_world_2d">
The custom [World2D] which can be used as 2D environment source.
</member>
@@ -416,5 +432,23 @@
<constant name="DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MAX" value="3" enum="DefaultCanvasItemTextureRepeat">
Max value for [enum DefaultCanvasItemTextureRepeat] enum.
</constant>
+ <constant name="SDF_OVERSIZE_100_PERCENT" value="0" enum="SDFOversize">
+ </constant>
+ <constant name="SDF_OVERSIZE_120_PERCENT" value="1" enum="SDFOversize">
+ </constant>
+ <constant name="SDF_OVERSIZE_150_PERCENT" value="2" enum="SDFOversize">
+ </constant>
+ <constant name="SDF_OVERSIZE_200_PERCENT" value="3" enum="SDFOversize">
+ </constant>
+ <constant name="SDF_OVERSIZE_MAX" value="4" enum="SDFOversize">
+ </constant>
+ <constant name="SDF_SCALE_100_PERCENT" value="0" enum="SDFScale">
+ </constant>
+ <constant name="SDF_SCALE_50_PERCENT" value="1" enum="SDFScale">
+ </constant>
+ <constant name="SDF_SCALE_25_PERCENT" value="2" enum="SDFScale">
+ </constant>
+ <constant name="SDF_SCALE_MAX" value="3" enum="SDFScale">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml
index 14b460a43b..393f1bb0b8 100644
--- a/doc/classes/ViewportTexture.xml
+++ b/doc/classes/ViewportTexture.xml
@@ -8,6 +8,10 @@
To create a ViewportTexture in code, use the [method Viewport.get_texture] method on the target viewport.
</description>
<tutorials>
+ <link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
+ <link title="3D in 2D Demo">https://godotengine.org/asset-library/asset/128</link>
+ <link title="2D in 3D Demo">https://godotengine.org/asset-library/asset/129</link>
+ <link title="3D Viewport Scaling Demo">https://godotengine.org/asset-library/asset/586</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/VisibilityNotifier2D.xml b/doc/classes/VisibilityNotifier2D.xml
index 314a100989..761438b77e 100644
--- a/doc/classes/VisibilityNotifier2D.xml
+++ b/doc/classes/VisibilityNotifier2D.xml
@@ -9,6 +9,7 @@
[b]Note:[/b] For performance reasons, VisibilityNotifier2D uses an approximate heuristic with precision determined by [member ProjectSettings.world/2d/cell_size]. If you need precise visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node.
</description>
<tutorials>
+ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
</tutorials>
<methods>
<method name="is_on_screen" qualifiers="const">
diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml
index 3bb527f3d4..6327ab534f 100644
--- a/doc/classes/VisualShaderNode.xml
+++ b/doc/classes/VisualShaderNode.xml
@@ -57,12 +57,6 @@
Emitted when the node requests an editor refresh. Currently called only in setter of [member VisualShaderNodeTexture.source], [VisualShaderNodeTexture], and [VisualShaderNodeCubemap] (and their derivatives).
</description>
</signal>
- <signal name="show_port_preview">
- <argument index="0" name="port_id" type="int">
- </argument>
- <description>
- </description>
- </signal>
</signals>
<constants>
<constant name="PORT_TYPE_SCALAR" value="0" enum="PortType">
diff --git a/doc/classes/VisualShaderNodeCurveTexture.xml b/doc/classes/VisualShaderNodeCurveTexture.xml
new file mode 100644
index 0000000000..26b7b07df2
--- /dev/null
+++ b/doc/classes/VisualShaderNodeCurveTexture.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeCurveTexture" inherits="VisualShaderNodeResizableBase" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="texture" type="CurveTexture" setter="set_texture" getter="get_texture">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeGroupBase.xml b/doc/classes/VisualShaderNodeGroupBase.xml
index 13018d52f3..afa14c776e 100644
--- a/doc/classes/VisualShaderNodeGroupBase.xml
+++ b/doc/classes/VisualShaderNodeGroupBase.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="VisualShaderNodeGroupBase" inherits="VisualShaderNode" version="4.0">
+<class name="VisualShaderNodeGroupBase" inherits="VisualShaderNodeResizableBase" version="4.0">
<brief_description>
Base class for a family of nodes with variable amount of input and output ports within the visual shader graph.
</brief_description>
@@ -199,11 +199,6 @@
</description>
</method>
</methods>
- <members>
- <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 0, 0 )">
- The size of the node in the visual shader graph.
- </member>
- </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeMultiplyAdd.xml b/doc/classes/VisualShaderNodeMultiplyAdd.xml
index ba79b3fe8f..daa9e02753 100644
--- a/doc/classes/VisualShaderNodeMultiplyAdd.xml
+++ b/doc/classes/VisualShaderNodeMultiplyAdd.xml
@@ -11,19 +11,19 @@
<methods>
</methods>
<members>
- <member name="type" type="int" setter="set_type" getter="get_type" enum="VisualShaderNodeMultiplyAdd.Type" default="0">
+ <member name="op_type" type="int" setter="set_op_type" getter="get_op_type" enum="VisualShaderNodeMultiplyAdd.OpType" default="0">
A type of operands and returned value.
</member>
</members>
<constants>
- <constant name="TYPE_SCALAR" value="0" enum="Type">
+ <constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
A scalar type.
</constant>
- <constant name="TYPE_VECTOR" value="1" enum="Type">
+ <constant name="OP_TYPE_VECTOR" value="1" enum="OpType">
A vector type.
</constant>
- <constant name="TYPE_MAX" value="2" enum="Type">
- Represents the size of the [enum Type] enum.
+ <constant name="OP_TYPE_MAX" value="2" enum="OpType">
+ Represents the size of the [enum OpType] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeResizableBase.xml b/doc/classes/VisualShaderNodeResizableBase.xml
new file mode 100644
index 0000000000..9f827a96cc
--- /dev/null
+++ b/doc/classes/VisualShaderNodeResizableBase.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualShaderNodeResizableBase" inherits="VisualShaderNode" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 0, 0 )">
+ The size of the node in the visual shader graph.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index c1a991fca1..0f887c7705 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -27,6 +27,13 @@
<description>
</description>
</method>
+ <method name="get_layout_direction" qualifiers="const">
+ <return type="int" enum="Window.LayoutDirection">
+ </return>
+ <description>
+ Returns layout direction and text writing direction.
+ </description>
+ </method>
<method name="get_real_size" qualifiers="const">
<return type="Vector2i">
</return>
@@ -61,6 +68,18 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
+ Returns the [Font] at [code]name[/code] if the theme has [code]type[/code].
+ </description>
+ </method>
+ <method name="get_theme_font_size" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ </argument>
+ <description>
+ Returns the font size at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="get_theme_icon" qualifiers="const">
@@ -123,6 +142,20 @@
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
</argument>
<description>
+ Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]type[/code].
+ Returns [code]false[/code] if the theme does not have [code]type[/code].
+ </description>
+ </method>
+ <method name="has_theme_font_size" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="StringName">
+ </argument>
+ <argument index="1" name="type" type="StringName" default="&quot;&quot;">
+ </argument>
+ <description>
+ Returns [code]true[/code] if font size with [code]name[/code] is in [code]type[/code].
+ Returns [code]false[/code] if the theme does not have [code]type[/code].
</description>
</method>
<method name="has_theme_icon" qualifiers="const">
@@ -157,6 +190,13 @@
<description>
</description>
</method>
+ <method name="is_layout_rtl" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if layout is right-to-left.
+ </description>
+ </method>
<method name="is_maximize_allowed" qualifiers="const">
<return type="bool">
</return>
@@ -249,6 +289,15 @@
<description>
</description>
</method>
+ <method name="set_layout_direction">
+ <return type="void">
+ </return>
+ <argument index="0" name="direction" type="int" enum="Window.LayoutDirection">
+ </argument>
+ <description>
+ Sets layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
+ </description>
+ </method>
<method name="set_use_font_oversampling">
<return type="void">
</return>
@@ -362,6 +411,8 @@
<constant name="MODE_MAXIMIZED" value="2" enum="Mode">
</constant>
<constant name="MODE_FULLSCREEN" value="3" enum="Mode">
+ Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
+ Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
</constant>
<constant name="FLAG_RESIZE_DISABLED" value="0" enum="Flags">
</constant>
@@ -391,6 +442,18 @@
</constant>
<constant name="CONTENT_SCALE_ASPECT_EXPAND" value="4" enum="ContentScaleAspect">
</constant>
+ <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">
+ Automatic layout direction, determined from the current locale.
+ </constant>
+ <constant name="LAYOUT_DIRECTION_LTR" value="2" enum="LayoutDirection">
+ Left-to-right layout direction.
+ </constant>
+ <constant name="LAYOUT_DIRECTION_RTL" value="3" enum="LayoutDirection">
+ Right-to-left layout direction.
+ </constant>
</constants>
<theme_items>
<theme_item name="close" type="Texture2D">
diff --git a/doc/classes/World2D.xml b/doc/classes/World2D.xml
index b0bfd7f418..25033cdb09 100644
--- a/doc/classes/World2D.xml
+++ b/doc/classes/World2D.xml
@@ -16,7 +16,7 @@
The [RID] of this world's canvas resource. Used by the [RenderingServer] for 2D drawing.
</member>
<member name="direct_space_state" type="PhysicsDirectSpaceState2D" setter="" getter="get_direct_space_state">
- Direct access to the world's physics 2D space state. Used for querying current and potential collisions. Must only be accessed from the main thread within [code]_physics_process(delta)[/code].
+ Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to [code]_physics_process(delta)[/code] in the main thread.
</member>
<member name="space" type="RID" setter="" getter="get_space">
The [RID] of this world's physics space resource. Used by the [PhysicsServer2D] for 2D physics, treating it as both a space and an area.
diff --git a/doc/classes/World3D.xml b/doc/classes/World3D.xml
index d804485d4e..fe92077432 100644
--- a/doc/classes/World3D.xml
+++ b/doc/classes/World3D.xml
@@ -15,7 +15,7 @@
<member name="camera_effects" type="CameraEffects" setter="set_camera_effects" getter="get_camera_effects">
</member>
<member name="direct_space_state" type="PhysicsDirectSpaceState3D" setter="" getter="get_direct_space_state">
- Direct access to the world's physics 3D space state. Used for querying current and potential collisions. Must only be accessed from within [code]_physics_process(delta)[/code].
+ Direct access to the world's physics 3D space state. Used for querying current and potential collisions.
</member>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
The World3D's [Environment].
diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml
index f9f0241365..c1cf639ec0 100644
--- a/doc/classes/WorldEnvironment.xml
+++ b/doc/classes/WorldEnvironment.xml
@@ -10,6 +10,9 @@
</description>
<tutorials>
<link title="Environment and post-processing">https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link>
+ <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
+ <link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link>
+ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
</methods>
diff --git a/doc/classes/XRController3D.xml b/doc/classes/XRController3D.xml
index c0f64d9e27..78684d10ee 100644
--- a/doc/classes/XRController3D.xml
+++ b/doc/classes/XRController3D.xml
@@ -86,7 +86,7 @@
Emitted when a button on this controller is pressed.
</description>
</signal>
- <signal name="button_release">
+ <signal name="button_released">
<argument index="0" name="button" type="int">
</argument>
<description>
diff --git a/doc/classes/XRPositionalTracker.xml b/doc/classes/XRPositionalTracker.xml
index 0b57c9478f..5ed7a26b19 100644
--- a/doc/classes/XRPositionalTracker.xml
+++ b/doc/classes/XRPositionalTracker.xml
@@ -33,13 +33,6 @@
Returns the mesh related to a controller or anchor point if one is available.
</description>
</method>
- <method name="get_name" qualifiers="const">
- <return type="StringName">
- </return>
- <description>
- Returns the controller or anchor point's name if available.
- </description>
- </method>
<method name="get_orientation" qualifiers="const">
<return type="Basis">
</return>
@@ -61,6 +54,20 @@
Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the [XRController3D] and [XRAnchor3D] nodes.
</description>
</method>
+ <method name="get_tracker_name" qualifiers="const">
+ <return type="StringName">
+ </return>
+ <description>
+ Returns the controller or anchor point's name, if applicable.
+ </description>
+ </method>
+ <method name="get_tracker_type" qualifiers="const">
+ <return type="int" enum="XRServer.TrackerType">
+ </return>
+ <description>
+ Returns the tracker's type, which will be one of the values from the [enum XRServer.TrackerType] enum.
+ </description>
+ </method>
<method name="get_tracks_orientation" qualifiers="const">
<return type="bool">
</return>
@@ -84,13 +91,6 @@
Returns the transform combining this device's orientation and position.
</description>
</method>
- <method name="get_type" qualifiers="const">
- <return type="int" enum="XRServer.TrackerType">
- </return>
- <description>
- Returns the tracker's type.
- </description>
- </method>
</methods>
<members>
<member name="rumble" type="float" setter="set_rumble" getter="get_rumble" default="0.0">
diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml
index 869fc14d40..03e8bee7d5 100644
--- a/doc/classes/bool.xml
+++ b/doc/classes/bool.xml
@@ -6,50 +6,108 @@
<description>
Boolean is a built-in type. There are two boolean values: [code]true[/code] and [code]false[/code]. You can think of it as an switch with on or off (1 or 0) setting. Booleans are used in programming for logic in condition statements, like [code]if[/code] statements.
Booleans can be directly used in [code]if[/code] statements. The code below demonstrates this on the [code]if can_shoot:[/code] line. You don't need to use [code]== true[/code], you only need [code]if can_shoot:[/code]. Similarly, use [code]if not can_shoot:[/code] rather than [code]== false[/code].
- [codeblock]
- var can_shoot = true
+ [codeblocks]
+ [gdscript]
+ var _can_shoot = true
func shoot():
- if can_shoot:
+ if _can_shoot:
pass # Perform shooting actions here.
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ private bool _canShoot = true;
+
+ public void Shoot()
+ {
+ if (_canShoot)
+ {
+ // Perform shooting actions here.
+ }
+ }
+ [/csharp]
+ [/codeblocks]
The following code will only create a bullet if both conditions are met: action "shoot" is pressed and if [code]can_shoot[/code] is [code]true[/code].
[b]Note:[/b] [code]Input.is_action_pressed("shoot")[/code] is also a boolean that is [code]true[/code] when "shoot" is pressed and [code]false[/code] when "shoot" isn't pressed.
- [codeblock]
- var can_shoot = true
+ [codeblocks]
+ [gdscript]
+ var _can_shoot = true
func shoot():
- if can_shoot and Input.is_action_pressed("shoot"):
+ if _can_shoot and Input.is_action_pressed("shoot"):
create_bullet()
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ private bool _canShoot = true;
+
+ public void Shoot()
+ {
+ if (_canShoot &amp;&amp; Input.IsActionPressed("shoot"))
+ {
+ CreateBullet();
+ }
+ }
+ [/csharp]
+ [/codeblocks]
The following code will set [code]can_shoot[/code] to [code]false[/code] and start a timer. This will prevent player from shooting until the timer runs out. Next [code]can_shoot[/code] will be set to [code]true[/code] again allowing player to shoot once again.
- [codeblock]
- var can_shoot = true
- onready var cool_down = $CoolDownTimer
+ [gdscript]
+ var _can_shoot = true
+ onready var _cool_down = $CoolDownTimer
func shoot():
- if can_shoot and Input.is_action_pressed("shoot"):
+ if _can_shoot and Input.is_action_pressed("shoot"):
create_bullet()
- can_shoot = false
- cool_down.start()
+ _can_shoot = false
+ _cool_down.start()
func _on_CoolDownTimer_timeout():
- can_shoot = true
- [/codeblock]
+ _can_shoot = true
+ [/gdscript]
+ [csharp]
+ private bool _canShoot = true;
+ private Timer _coolDown;
+
+ public override void _Ready()
+ {
+ _coolDown = GetNode&lt;Timer&gt;("CoolDownTimer");
+ }
+
+ public void Shoot()
+ {
+ if (_canShoot &amp;&amp; Input.IsActionPressed("shoot"))
+ {
+ CreateBullet();
+ _canShoot = false;
+ _coolDown.Start();
+ }
+ }
+
+ public void OnCoolDownTimerTimeout()
+ {
+ _canShoot = true;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
<methods>
- <method name="bool">
+ <method name="bool" qualifiers="constructor">
<return type="bool">
</return>
- <argument index="0" name="from" type="int">
+ <description>
+ Constructs a default-initialized [bool] set to [code]false[/code].
+ </description>
+ </method>
+ <method name="bool" qualifiers="constructor">
+ <return type="bool">
+ </return>
+ <argument index="0" name="from" type="bool">
</argument>
<description>
- Cast an [int] value to a boolean value, this method will return [code]false[/code] if [code]0[/code] is passed in, and [code]true[/code] for all other ints.
+ Constructs a [bool] as a copy of the given [bool].
</description>
</method>
- <method name="bool">
+ <method name="bool" qualifiers="constructor">
<return type="bool">
</return>
<argument index="0" name="from" type="float">
@@ -58,14 +116,45 @@
Cast a [float] value to a boolean value, this method will return [code]false[/code] if [code]0.0[/code] is passed in, and [code]true[/code] for all other floats.
</description>
</method>
- <method name="bool">
+ <method name="bool" qualifiers="constructor">
+ <return type="bool">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <description>
+ Cast an [int] value to a boolean value, this method will return [code]false[/code] if [code]0[/code] is passed in, and [code]true[/code] for all other ints.
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
<return type="bool">
</return>
- <argument index="0" name="from" type="String">
+ <argument index="0" name="right" type="bool">
</argument>
<description>
- Cast a [String] value to a boolean value, this method will return [code]false[/code] if [code]""[/code] is passed in, and [code]true[/code] for all non-empty strings.
- Examples: [code]bool("False")[/code] returns [code]true[/code], [code]bool("")[/code] returns [code]false[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/float.xml b/doc/classes/float.xml
index 16a696f959..85fe31eec8 100644
--- a/doc/classes/float.xml
+++ b/doc/classes/float.xml
@@ -9,7 +9,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="float">
+ <method name="float" qualifiers="constructor">
+ <return type="float">
+ </return>
+ <description>
+ Constructs a default-initialized [float] set to [code]0.0[/code].
+ </description>
+ </method>
+ <method name="float" qualifiers="constructor">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <description>
+ Constructs a [float] as a copy of the given [float].
+ </description>
+ </method>
+ <method name="float" qualifiers="constructor">
<return type="float">
</return>
<argument index="0" name="from" type="bool">
@@ -18,22 +34,233 @@
Cast a [bool] value to a floating-point value, [code]float(true)[/code] will be equal to 1.0 and [code]float(false)[/code] will be equal to 0.0.
</description>
</method>
- <method name="float">
+ <method name="float" qualifiers="constructor">
<return type="float">
</return>
<argument index="0" name="from" type="int">
</argument>
<description>
- Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to 1.0.
+ Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to [code]1.0[/code].
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
</description>
</method>
- <method name="float">
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
<return type="float">
</return>
- <argument index="0" name="from" type="String">
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="Quat">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
</argument>
<description>
- Cast a [String] value to a floating-point value. This method accepts float value strings like [code]"1.23"[/code] and exponential notation strings for its parameter so calling [code]float("1e3")[/code] will return 1000.0 and calling [code]float("1e-3")[/code] will return 0.001. Calling this method with an invalid float string will return 0. This method stops parsing at the first invalid character and will return the parsed result so far, so calling [code]float("1a3")[/code] will return 1 while calling [code]float("1e3a2")[/code] will return 1000.0.
</description>
</method>
</methods>
diff --git a/doc/classes/int.xml b/doc/classes/int.xml
index 2c9f0ad371..a63c509937 100644
--- a/doc/classes/int.xml
+++ b/doc/classes/int.xml
@@ -7,23 +7,55 @@
Signed 64-bit integer type.
It can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around.
[int] is a [Variant] type, and will thus be used when assigning an integer value to a [Variant]. It can also be enforced with the [code]: int[/code] type hint.
- [codeblock]
+ [codeblocks]
+ [gdscript]
var my_variant = 0 # int, value 0.
my_variant += 4.2 # float, value 4.2.
var my_int: int = 1 # int, value 1.
my_int = 4.2 # int, value 4, the right value is implicitly cast to int.
my_int = int("6.7") # int, value 6, the String is explicitly cast with int.
-
var max_int = 9223372036854775807
print(max_int) # 9223372036854775807, OK.
max_int += 1
print(max_int) # -9223372036854775808, we overflowed and wrapped around.
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ int myInt = (int)"6.7".ToFloat(); // int, value 6, the String is explicitly cast with int.
+ // We have to use `long` here, because GDSript's `int`
+ // is 64 bits long while C#'s `int` is only 32 bits.
+ long maxInt = 9223372036854775807;
+ GD.Print(maxInt); // 9223372036854775807, OK.
+ maxInt++;
+ GD.Print(maxInt); // -9223372036854775808, we overflowed and wrapped around.
+
+ // Alternatively, if we used C#'s 32-bit `int` type, the maximum value is much smaller:
+ int halfInt = 2147483647;
+ GD.Print(halfInt); // 2147483647, OK.
+ halfInt++;
+ GD.Print(halfInt); // -2147483648, we overflowed and wrapped around.
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
<methods>
- <method name="int">
+ <method name="int" qualifiers="constructor">
+ <return type="int">
+ </return>
+ <description>
+ Constructs a default-initialized [int] set to [code]0[/code].
+ </description>
+ </method>
+ <method name="int" qualifiers="constructor">
+ <return type="int">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <description>
+ Constructs an [int] as a copy of the given [int].
+ </description>
+ </method>
+ <method name="int" qualifiers="constructor">
<return type="int">
</return>
<argument index="0" name="from" type="bool">
@@ -32,22 +64,287 @@
Cast a [bool] value to an integer value, [code]int(true)[/code] will be equals to 1 and [code]int(false)[/code] will be equals to 0.
</description>
</method>
- <method name="int">
+ <method name="int" qualifiers="constructor">
<return type="int">
</return>
<argument index="0" name="from" type="float">
</argument>
<description>
- Cast a float value to an integer value, this method simply removes the number fractions, so for example [code]int(2.7)[/code] will be equals to 2, [code]int(.1)[/code] will be equals to 0 and [code]int(-2.7)[/code] will be equals to -2.
+ Cast a float value to an integer value, this method simply removes the number fractions (i.e. rounds [code]from[/code] towards zero), so for example [code]int(2.7)[/code] will be equals to 2, [code]int(0.1)[/code] will be equals to 0 and [code]int(-2.7)[/code] will be equals to -2. This operation is also called truncation.
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator !=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator %" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &amp;" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="right" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector2i">
+ </return>
+ <argument index="0" name="right" type="Vector2i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="right" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Vector3i">
+ </return>
+ <argument index="0" name="right" type="Vector3i">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Quat">
+ </return>
+ <argument index="0" name="right" type="Quat">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator *" qualifiers="operator">
+ <return type="Color">
+ </return>
+ <argument index="0" name="right" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator +" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator -" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="float">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator /" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;&lt;" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &lt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ==" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;=" qualifiers="operator">
+ <return type="bool">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator &gt;&gt;" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="operator ^" qualifiers="operator">
+ <return type="int">
+ </return>
+ <argument index="0" name="right" type="int">
+ </argument>
+ <description>
</description>
</method>
- <method name="int">
+ <method name="operator |" qualifiers="operator">
<return type="int">
</return>
- <argument index="0" name="from" type="String">
+ <argument index="0" name="right" type="int">
</argument>
<description>
- Cast a [String] value to an integer value, this method is an integer parser from a string, so calling this method with an invalid integer string will return 0, a valid string will be something like [code]'1.7'[/code]. This method will ignore all non-number characters, so calling [code]int('1e3')[/code] will return 13.
+ </description>
+ </method>
+ <method name="operator ~" qualifiers="operator">
+ <return type="int">
+ </return>
+ <description>
</description>
</method>
</methods>
diff --git a/doc/tools/doc_merge.py b/doc/tools/doc_merge.py
deleted file mode 100755
index f6f52f5d66..0000000000
--- a/doc/tools/doc_merge.py
+++ /dev/null
@@ -1,237 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import sys
-import xml.etree.ElementTree as ET
-
-
-tree = ET.parse(sys.argv[1])
-old_doc = tree.getroot()
-
-tree = ET.parse(sys.argv[2])
-new_doc = tree.getroot()
-
-f = file(sys.argv[3], "wb")
-tab = 0
-
-old_classes = {}
-
-
-def write_string(_f, text, newline=True):
- for t in range(tab):
- _f.write("\t")
- _f.write(text)
- if newline:
- _f.write("\n")
-
-
-def escape(ret):
- ret = ret.replace("&", "&amp;")
- ret = ret.replace("<", "&gt;")
- ret = ret.replace(">", "&lt;")
- ret = ret.replace("'", "&apos;")
- ret = ret.replace('"', "&quot;")
- return ret
-
-
-def inc_tab():
- global tab
- tab += 1
-
-
-def dec_tab():
- global tab
- tab -= 1
-
-
-write_string(f, '<?xml version="1.0" encoding="UTF-8" ?>')
-write_string(f, '<doc version="' + new_doc.attrib["version"] + '">')
-
-
-def get_tag(node, name):
- tag = ""
- if name in node.attrib:
- tag = " " + name + '="' + escape(node.attrib[name]) + '" '
- return tag
-
-
-def find_method_descr(old_class, name):
-
- methods = old_class.find("methods")
- if methods != None and len(list(methods)) > 0:
- for m in list(methods):
- if m.attrib["name"] == name:
- description = m.find("description")
- if description != None and description.text.strip() != "":
- return description.text
-
- return None
-
-
-def find_signal_descr(old_class, name):
-
- signals = old_class.find("signals")
- if signals != None and len(list(signals)) > 0:
- for m in list(signals):
- if m.attrib["name"] == name:
- description = m.find("description")
- if description != None and description.text.strip() != "":
- return description.text
-
- return None
-
-
-def find_constant_descr(old_class, name):
-
- if old_class is None:
- return None
- constants = old_class.find("constants")
- if constants != None and len(list(constants)) > 0:
- for m in list(constants):
- if m.attrib["name"] == name:
- if m.text.strip() != "":
- return m.text
- return None
-
-
-def write_class(c):
- class_name = c.attrib["name"]
- print("Parsing Class: " + class_name)
- if class_name in old_classes:
- old_class = old_classes[class_name]
- else:
- old_class = None
-
- category = get_tag(c, "category")
- inherits = get_tag(c, "inherits")
- write_string(f, '<class name="' + class_name + '" ' + category + inherits + ">")
- inc_tab()
-
- write_string(f, "<brief_description>")
-
- if old_class != None:
- old_brief_descr = old_class.find("brief_description")
- if old_brief_descr != None:
- write_string(f, escape(old_brief_descr.text.strip()))
-
- write_string(f, "</brief_description>")
-
- write_string(f, "<description>")
- if old_class != None:
- old_descr = old_class.find("description")
- if old_descr != None:
- write_string(f, escape(old_descr.text.strip()))
-
- write_string(f, "</description>")
-
- methods = c.find("methods")
- if methods != None and len(list(methods)) > 0:
-
- write_string(f, "<methods>")
- inc_tab()
-
- for m in list(methods):
- qualifiers = get_tag(m, "qualifiers")
-
- write_string(f, '<method name="' + escape(m.attrib["name"]) + '" ' + qualifiers + ">")
- inc_tab()
-
- for a in list(m):
- if a.tag == "return":
- typ = get_tag(a, "type")
- write_string(f, "<return" + typ + ">")
- write_string(f, "</return>")
- elif a.tag == "argument":
-
- default = get_tag(a, "default")
-
- write_string(
- f,
- '<argument index="'
- + a.attrib["index"]
- + '" name="'
- + escape(a.attrib["name"])
- + '" type="'
- + a.attrib["type"]
- + '"'
- + default
- + ">",
- )
- write_string(f, "</argument>")
-
- write_string(f, "<description>")
- if old_class != None:
- old_method_descr = find_method_descr(old_class, m.attrib["name"])
- if old_method_descr:
- write_string(f, escape(escape(old_method_descr.strip())))
-
- write_string(f, "</description>")
- dec_tab()
- write_string(f, "</method>")
- dec_tab()
- write_string(f, "</methods>")
-
- signals = c.find("signals")
- if signals != None and len(list(signals)) > 0:
-
- write_string(f, "<signals>")
- inc_tab()
-
- for m in list(signals):
-
- write_string(f, '<signal name="' + escape(m.attrib["name"]) + '">')
- inc_tab()
-
- for a in list(m):
- if a.tag == "argument":
-
- write_string(
- f,
- '<argument index="'
- + a.attrib["index"]
- + '" name="'
- + escape(a.attrib["name"])
- + '" type="'
- + a.attrib["type"]
- + '">',
- )
- write_string(f, "</argument>")
-
- write_string(f, "<description>")
- if old_class != None:
- old_signal_descr = find_signal_descr(old_class, m.attrib["name"])
- if old_signal_descr:
- write_string(f, escape(old_signal_descr.strip()))
- write_string(f, "</description>")
- dec_tab()
- write_string(f, "</signal>")
- dec_tab()
- write_string(f, "</signals>")
-
- constants = c.find("constants")
- if constants != None and len(list(constants)) > 0:
-
- write_string(f, "<constants>")
- inc_tab()
-
- for m in list(constants):
-
- write_string(f, '<constant name="' + escape(m.attrib["name"]) + '" value="' + m.attrib["value"] + '">')
- old_constant_descr = find_constant_descr(old_class, m.attrib["name"])
- if old_constant_descr:
- write_string(f, escape(old_constant_descr.strip()))
- write_string(f, "</constant>")
-
- dec_tab()
- write_string(f, "</constants>")
-
- dec_tab()
- write_string(f, "</class>")
-
-
-for c in list(old_doc):
- old_classes[c.attrib["name"]] = c
-
-for c in list(new_doc):
- write_class(c)
-write_string(f, "</doc>\n")
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py
index ed147f31cd..5335116c8a 100755
--- a/doc/tools/makerst.py
+++ b/doc/tools/makerst.py
@@ -1042,6 +1042,8 @@ def make_footer(): # type: () -> str
".. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`\n"
".. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`\n"
".. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`\n"
+ ".. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`\n"
+ ".. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`\n"
)
# fmt: on
diff --git a/doc/translations/ar.po b/doc/translations/ar.po
index eae5d09b38..1857e45627 100644
--- a/doc/translations/ar.po
+++ b/doc/translations/ar.po
@@ -11069,7 +11069,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14163,7 +14163,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32615,7 +32615,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/ca.po b/doc/translations/ca.po
index caa43cfa3a..2e5c7e2c84 100644
--- a/doc/translations/ca.po
+++ b/doc/translations/ca.po
@@ -11100,7 +11100,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14194,7 +14194,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32646,7 +32646,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/classes.pot b/doc/translations/classes.pot
index 0e89e02762..41c20b05ea 100644
--- a/doc/translations/classes.pot
+++ b/doc/translations/classes.pot
@@ -11070,7 +11070,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14164,7 +14164,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32616,7 +32616,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
@@ -41208,7 +41208,7 @@ msgid ""
"result, it should not be depended upon for reproducible random streams "
"across Godot versions.\n"
"To generate a random float number (within a given range) based on a time-"
-"dependant seed:\n"
+"dependent seed:\n"
"[codeblock]\n"
"var rng = RandomNumberGenerator.new()\n"
"func _ready():\n"
diff --git a/doc/translations/cs.po b/doc/translations/cs.po
index 8f8cb7da91..8d94351710 100644
--- a/doc/translations/cs.po
+++ b/doc/translations/cs.po
@@ -11562,7 +11562,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14656,7 +14656,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -33115,7 +33115,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/de.po b/doc/translations/de.po
index 740d4eed12..95b73f8257 100644
--- a/doc/translations/de.po
+++ b/doc/translations/de.po
@@ -11385,7 +11385,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14492,7 +14492,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -33032,7 +33032,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/es.po b/doc/translations/es.po
index 4d71c12010..ef6012b240 100644
--- a/doc/translations/es.po
+++ b/doc/translations/es.po
@@ -14573,10 +14573,10 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
"Devuelve [code]true[/code] si el nodo está configurado como de nivel "
-"superior. Ver [method set_as_toplevel]."
+"superior. Ver [method set_as_top_level]."
#: doc/classes/CanvasItem.xml:530
msgid ""
@@ -18642,7 +18642,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -44207,10 +44207,10 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
-"Devuelve si este nodo se establece como Toplevel, es decir, si ignora las "
+"Devuelve si este nodo se establece como top_level, es decir, si ignora las "
"transformaciones de sus nodos padres."
#: doc/classes/Node3D.xml:97
diff --git a/doc/translations/fa.po b/doc/translations/fa.po
index 874d3273c3..06d6ee47d7 100644
--- a/doc/translations/fa.po
+++ b/doc/translations/fa.po
@@ -11075,7 +11075,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14169,7 +14169,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32621,7 +32621,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/fi.po b/doc/translations/fi.po
index 3163a6131f..02ac9fdd76 100644
--- a/doc/translations/fi.po
+++ b/doc/translations/fi.po
@@ -11088,7 +11088,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14182,7 +14182,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32634,7 +32634,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/fr.po b/doc/translations/fr.po
index 55434729e5..a8075d919d 100644
--- a/doc/translations/fr.po
+++ b/doc/translations/fr.po
@@ -11406,7 +11406,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14500,7 +14500,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32982,7 +32982,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/id.po b/doc/translations/id.po
index 246cf15495..b686ef8de6 100644
--- a/doc/translations/id.po
+++ b/doc/translations/id.po
@@ -11101,7 +11101,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14195,7 +14195,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32647,7 +32647,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/it.po b/doc/translations/it.po
index 8a8ec5d107..f664268ebe 100644
--- a/doc/translations/it.po
+++ b/doc/translations/it.po
@@ -11359,7 +11359,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14453,7 +14453,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32913,7 +32913,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/ja.po b/doc/translations/ja.po
index 02072678ef..9727ca0cd3 100644
--- a/doc/translations/ja.po
+++ b/doc/translations/ja.po
@@ -12289,7 +12289,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -15383,7 +15383,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -33885,7 +33885,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/ko.po b/doc/translations/ko.po
index ddc892b659..f69b5f00c0 100644
--- a/doc/translations/ko.po
+++ b/doc/translations/ko.po
@@ -11077,7 +11077,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14171,7 +14171,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32623,7 +32623,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/nl.po b/doc/translations/nl.po
index 4f840c229c..17bd3db383 100644
--- a/doc/translations/nl.po
+++ b/doc/translations/nl.po
@@ -11103,7 +11103,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14197,7 +14197,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32649,7 +32649,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/pl.po b/doc/translations/pl.po
index b3817aa5f6..fd494dc656 100644
--- a/doc/translations/pl.po
+++ b/doc/translations/pl.po
@@ -11121,7 +11121,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14215,7 +14215,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32668,7 +32668,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/pt_BR.po b/doc/translations/pt_BR.po
index 89460c5caf..2e8337989f 100644
--- a/doc/translations/pt_BR.po
+++ b/doc/translations/pt_BR.po
@@ -11116,7 +11116,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14210,7 +14210,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32662,7 +32662,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/ro.po b/doc/translations/ro.po
index fb47ddb0dc..f7e5e0f86f 100644
--- a/doc/translations/ro.po
+++ b/doc/translations/ro.po
@@ -11077,7 +11077,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14171,7 +14171,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32623,7 +32623,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/ru.po b/doc/translations/ru.po
index 83c3440a64..6a397ec35d 100644
--- a/doc/translations/ru.po
+++ b/doc/translations/ru.po
@@ -11582,7 +11582,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14676,7 +14676,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -33160,7 +33160,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/sr_Cyrl.po b/doc/translations/sr_Cyrl.po
index 6d0bd44ba7..156fbabfc0 100644
--- a/doc/translations/sr_Cyrl.po
+++ b/doc/translations/sr_Cyrl.po
@@ -11087,7 +11087,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14181,7 +14181,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32633,7 +32633,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/th.po b/doc/translations/th.po
index 5753295ef4..cbcbc51f63 100644
--- a/doc/translations/th.po
+++ b/doc/translations/th.po
@@ -11093,7 +11093,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14187,7 +14187,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32639,7 +32639,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/tr.po b/doc/translations/tr.po
index 0e5992ad0e..33208243f8 100644
--- a/doc/translations/tr.po
+++ b/doc/translations/tr.po
@@ -11069,7 +11069,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14163,7 +14163,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32615,7 +32615,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/uk.po b/doc/translations/uk.po
index e94a78591f..45da6d19aa 100644
--- a/doc/translations/uk.po
+++ b/doc/translations/uk.po
@@ -11155,7 +11155,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14249,7 +14249,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32701,7 +32701,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/zh_Hans.po b/doc/translations/zh_Hans.po
index 08e9667c29..2e9d14c0d8 100644
--- a/doc/translations/zh_Hans.po
+++ b/doc/translations/zh_Hans.po
@@ -11302,7 +11302,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14396,7 +14396,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32851,7 +32851,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""
diff --git a/doc/translations/zh_Hant.po b/doc/translations/zh_Hant.po
index e09b693f6e..9483576d0e 100644
--- a/doc/translations/zh_Hant.po
+++ b/doc/translations/zh_Hant.po
@@ -11106,7 +11106,7 @@ msgstr ""
#: doc/classes/CanvasItem.xml:523
msgid ""
"Returns [code]true[/code] if the node is set as top-level. See [method "
-"set_as_toplevel]."
+"set_as_top_level]."
msgstr ""
#: doc/classes/CanvasItem.xml:530
@@ -14200,7 +14200,7 @@ msgstr ""
#: doc/classes/Control.xml:545
msgid ""
-"Invalidates the size cache in this node and in parent nodes up to toplevel. "
+"Invalidates the size cache in this node and in parent nodes up to top_level. "
"Intended to be used with [method get_minimum_size] when the return value is "
"changed. Setting [member rect_min_size] directly calls this method "
"automatically."
@@ -32652,7 +32652,7 @@ msgstr ""
#: doc/classes/Node3D.xml:90
msgid ""
-"Returns whether this node is set as Toplevel, that is whether it ignores its "
+"Returns whether this node is set as top_level, that is whether it ignores its "
"parent nodes transformations."
msgstr ""