summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/@GlobalScope.xml36
-rw-r--r--doc/classes/Animation.xml34
-rw-r--r--doc/classes/AnimationLibrary.xml7
-rw-r--r--doc/classes/AnimationNode.xml11
-rw-r--r--doc/classes/AnimationTree.xml64
-rw-r--r--doc/classes/BaseMaterial3D.xml4
-rw-r--r--doc/classes/CanvasItem.xml13
-rw-r--r--doc/classes/CharFXTransform.xml3
-rw-r--r--doc/classes/Color.xml170
-rw-r--r--doc/classes/Curve2D.xml16
-rw-r--r--doc/classes/Curve3D.xml6
-rw-r--r--doc/classes/Dictionary.xml167
-rw-r--r--doc/classes/DirectionalLight2D.xml5
-rw-r--r--doc/classes/DisplayServer.xml1
-rw-r--r--doc/classes/EditorSceneFormatImporter.xml1
-rw-r--r--doc/classes/EditorSettings.xml3
-rw-r--r--doc/classes/FileAccess.xml14
-rw-r--r--doc/classes/Font.xml12
-rw-r--r--doc/classes/FontFile.xml9
-rw-r--r--doc/classes/GraphEdit.xml2
-rw-r--r--doc/classes/Light2D.xml13
-rw-r--r--doc/classes/Mesh.xml4
-rw-r--r--doc/classes/Node.xml3
-rw-r--r--doc/classes/Node2D.xml10
-rw-r--r--doc/classes/OS.xml34
-rw-r--r--doc/classes/Object.xml16
-rw-r--r--doc/classes/PointLight2D.xml3
-rw-r--r--doc/classes/ProjectSettings.xml15
-rw-r--r--doc/classes/RID.xml13
-rw-r--r--doc/classes/RichTextLabel.xml6
-rw-r--r--doc/classes/SystemFont.xml15
-rw-r--r--doc/classes/TextServer.xml48
-rw-r--r--doc/classes/TextServerExtension.xml44
-rw-r--r--doc/classes/Vector2.xml4
-rw-r--r--doc/classes/Vector3.xml4
-rw-r--r--doc/classes/Viewport.xml13
36 files changed, 549 insertions, 274 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 33afe38446..4a6b85f229 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -115,7 +115,7 @@
<param index="3" name="end" type="float" />
<param index="4" name="t" type="float" />
<description>
- Returns the derivative at the given [param t] on a one-dimensional [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by the given [param control_1], [param control_2], and [param end] points.
+ Returns the derivative at the given [param t] on a one-dimensional [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bézier curve[/url] defined by the given [param control_1], [param control_2], and [param end] points.
</description>
</method>
<method name="bezier_interpolate">
@@ -126,7 +126,7 @@
<param index="3" name="end" type="float" />
<param index="4" name="t" type="float" />
<description>
- Returns the point at the given [param t] on a one-dimensional [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by the given [param control_1], [param control_2], and [param end] points.
+ Returns the point at the given [param t] on a one-dimensional [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bézier curve[/url] defined by the given [param control_1], [param control_2], and [param end] points.
</description>
</method>
<method name="bytes_to_var">
@@ -2877,40 +2877,38 @@
</constant>
<constant name="PROPERTY_USAGE_STORE_IF_NULL" value="8192" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_ANIMATE_AS_TRIGGER" value="16384" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" value="16384" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" value="32768" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="32768" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="65536" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_CLASS_IS_ENUM" value="65536" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_CLASS_IS_ENUM" value="131072" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_NIL_IS_VARIANT" value="131072" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_NIL_IS_VARIANT" value="262144" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_INTERNAL" value="262144" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_INTERNAL" value="524288" enum="PropertyUsageFlags">
- </constant>
- <constant name="PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE" value="1048576" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE" value="524288" enum="PropertyUsageFlags">
If the property is a [Resource], a new copy of it is always created when calling [method Node.duplicate] or [method Resource.duplicate].
</constant>
- <constant name="PROPERTY_USAGE_HIGH_END_GFX" value="2097152" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_HIGH_END_GFX" value="1048576" enum="PropertyUsageFlags">
The property is only shown in the editor if modern renderers are supported (GLES3 is excluded).
</constant>
- <constant name="PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" value="4194304" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" value="2097152" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" value="8388608" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" value="4194304" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_KEYING_INCREMENTS" value="16777216" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_KEYING_INCREMENTS" value="8388608" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="33554432" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="16777216" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" value="67108864" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" value="33554432" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="134217728" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="67108864" enum="PropertyUsageFlags">
</constant>
- <constant name="PROPERTY_USAGE_READ_ONLY" value="268435456" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_READ_ONLY" value="134217728" enum="PropertyUsageFlags">
The property is read-only in the [EditorInspector].
</constant>
- <constant name="PROPERTY_USAGE_ARRAY" value="536870912" enum="PropertyUsageFlags">
+ <constant name="PROPERTY_USAGE_ARRAY" value="268435456" enum="PropertyUsageFlags">
The property is an array.
</constant>
<constant name="PROPERTY_USAGE_DEFAULT" value="6" enum="PropertyUsageFlags">
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml
index af8d9c416f..d9a1f896f1 100644
--- a/doc/classes/Animation.xml
+++ b/doc/classes/Animation.xml
@@ -251,15 +251,6 @@
Returns the amount of tracks in the animation.
</description>
</method>
- <method name="method_track_get_key_indices" qualifiers="const">
- <return type="PackedInt32Array" />
- <param index="0" name="track_idx" type="int" />
- <param index="1" name="time_sec" type="float" />
- <param index="2" name="delta" type="float" />
- <description>
- Returns all the key indices of a method track, given a position and delta time.
- </description>
- </method>
<method name="method_track_get_name" qualifiers="const">
<return type="StringName" />
<param index="0" name="track_idx" type="int" />
@@ -523,15 +514,6 @@
Swaps the track [param track_idx]'s index position with the track [param with_idx].
</description>
</method>
- <method name="value_track_get_key_indices" qualifiers="const">
- <return type="PackedInt32Array" />
- <param index="0" name="track_idx" type="int" />
- <param index="1" name="time_sec" type="float" />
- <param index="2" name="delta" type="float" />
- <description>
- Returns all the key indices of a value track, given a position and delta time.
- </description>
- </method>
<method name="value_track_get_update_mode" qualifiers="const">
<return type="int" enum="Animation.UpdateMode" />
<param index="0" name="track_idx" type="int" />
@@ -614,15 +596,12 @@
[b]Note:[/b] The result value is always normalized and may not match the key value.
</constant>
<constant name="UPDATE_CONTINUOUS" value="0" enum="UpdateMode">
- Update between keyframes.
+ Update between keyframes and hold the value.
</constant>
<constant name="UPDATE_DISCRETE" value="1" enum="UpdateMode">
- Update at the keyframes and hold the value.
- </constant>
- <constant name="UPDATE_TRIGGER" value="2" enum="UpdateMode">
Update at the keyframes.
</constant>
- <constant name="UPDATE_CAPTURE" value="3" enum="UpdateMode">
+ <constant name="UPDATE_CAPTURE" value="2" enum="UpdateMode">
Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds.
</constant>
<constant name="LOOP_NONE" value="0" enum="LoopMode">
@@ -634,5 +613,14 @@
<constant name="LOOP_PINGPONG" value="2" enum="LoopMode">
Repeats playback and reverse playback at both ends of the animation.
</constant>
+ <constant name="LOOPED_FLAG_NONE" value="0" enum="LoopedFlag">
+ This flag indicates that the animation proceeds without any looping.
+ </constant>
+ <constant name="LOOPED_FLAG_END" value="1" enum="LoopedFlag">
+ This flag indicates that the animation has reached the end of the animation and just after loop processed.
+ </constant>
+ <constant name="LOOPED_FLAG_START" value="2" enum="LoopedFlag">
+ This flag indicates that the animation has reached the start of the animation and just after loop processed.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/AnimationLibrary.xml b/doc/classes/AnimationLibrary.xml
index 769b338063..9be4cda5d6 100644
--- a/doc/classes/AnimationLibrary.xml
+++ b/doc/classes/AnimationLibrary.xml
@@ -65,6 +65,13 @@
Emitted when an [Animation] is added, under the key [param name].
</description>
</signal>
+ <signal name="animation_changed">
+ <param index="0" name="name" type="StringName" />
+ <description>
+ Emitted when there's a change in one of the animations, e.g. tracks are added, moved or have changed paths. [param name] is the key of the animation that was changed.
+ See also [signal Resource.changed], which this acts as a relay for.
+ </description>
+ </signal>
<signal name="animation_removed">
<param index="0" name="name" type="StringName" />
<description>
diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml
index b856b5f208..79deb008d2 100644
--- a/doc/classes/AnimationNode.xml
+++ b/doc/classes/AnimationNode.xml
@@ -53,7 +53,7 @@
<return type="float" />
<param index="0" name="time" type="float" />
<param index="1" name="seek" type="bool" />
- <param index="2" name="seek_root" type="bool" />
+ <param index="2" name="is_external_seeking" type="bool" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to run some code when this node is processed. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute.
Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory.
@@ -73,11 +73,12 @@
<param index="1" name="time" type="float" />
<param index="2" name="delta" type="float" />
<param index="3" name="seeked" type="bool" />
- <param index="4" name="seek_root" type="bool" />
+ <param index="4" name="is_external_seeking" type="bool" />
<param index="5" name="blend" type="float" />
- <param index="6" name="pingponged" type="int" default="0" />
+ <param index="6" name="looped_flag" type="int" enum="Animation.LoopedFlag" default="0" />
<description>
Blend an animation by [param blend] amount (name must be valid in the linked [AnimationPlayer]). A [param time] and [param delta] may be passed, as well as whether [param seeked] happened.
+ A [param looped_flag] is used by internal processing immediately after the loop. See also [enum Animation.LoopedFlag].
</description>
</method>
<method name="blend_input">
@@ -85,7 +86,7 @@
<param index="0" name="input_index" type="int" />
<param index="1" name="time" type="float" />
<param index="2" name="seek" type="bool" />
- <param index="3" name="seek_root" type="bool" />
+ <param index="3" name="is_external_seeking" type="bool" />
<param index="4" name="blend" type="float" />
<param index="5" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" />
<param index="6" name="sync" type="bool" default="true" />
@@ -99,7 +100,7 @@
<param index="1" name="node" type="AnimationNode" />
<param index="2" name="time" type="float" />
<param index="3" name="seek" type="bool" />
- <param index="4" name="seek_root" type="bool" />
+ <param index="4" name="is_external_seeking" type="bool" />
<param index="5" name="blend" type="float" />
<param index="6" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" />
<param index="7" name="sync" type="bool" default="true" />
diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml
index 27797b00b5..21f4b37741 100644
--- a/doc/classes/AnimationTree.xml
+++ b/doc/classes/AnimationTree.xml
@@ -19,10 +19,66 @@
Manually advance the animations by the specified time (in seconds).
</description>
</method>
- <method name="get_root_motion_transform" qualifiers="const">
- <return type="Transform3D" />
+ <method name="get_root_motion_position" qualifiers="const">
+ <return type="Vector3" />
<description>
- Retrieve the motion of the [member root_motion_track] as a [Transform3D] that can be used elsewhere. If [member root_motion_track] is not a path to a track of type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_SCALE_3D] or [constant Animation.TYPE_ROTATION_3D], returns an identity transformation. See also [member root_motion_track] and [RootMotionView].
+ Retrieve the motion of position with the [member root_motion_track] as a [Vector3] that can be used elsewhere.
+ If [member root_motion_track] is not a path to a track of type [constant Animation.TYPE_POSITION_3D], returns [code]Vector3(0, 0, 0)[/code].
+ See also [member root_motion_track] and [RootMotionView].
+ The most basic example is applying position to [CharacterBody3D]:
+ [codeblocks]
+ [gdscript]
+ var current_rotation: Quaternion
+
+ func _process(delta):
+ if Input.is_action_just_pressed("animate"):
+ current_rotation = get_quaternion()
+ state_machine.travel("Animate")
+ var velocity: Vector3 = current_rotation * animation_tree.get_root_motion_position() / delta
+ set_velocity(velocity)
+ move_and_slide()
+ [/gdscript]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="get_root_motion_rotation" qualifiers="const">
+ <return type="Quaternion" />
+ <description>
+ Retrieve the motion of rotation with the [member root_motion_track] as a [Quaternion] that can be used elsewhere.
+ If [member root_motion_track] is not a path to a track of type [constant Animation.TYPE_ROTATION_3D], returns [code]Quaternion(0, 0, 0, 1)[/code].
+ See also [member root_motion_track] and [RootMotionView].
+ The most basic example is applying rotation to [CharacterBody3D]:
+ [codeblocks]
+ [gdscript]
+ func _process(delta):
+ if Input.is_action_just_pressed("animate"):
+ state_machine.travel("Animate")
+ set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation())
+ [/gdscript]
+ [/codeblocks]
+ </description>
+ </method>
+ <method name="get_root_motion_scale" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Retrieve the motion of scale with the [member root_motion_track] as a [Vector3] that can be used elsewhere.
+ If [member root_motion_track] is not a path to a track of type [constant Animation.TYPE_SCALE_3D], returns [code]Vector3(0, 0, 0)[/code].
+ See also [member root_motion_track] and [RootMotionView].
+ The most basic example is applying scale to [CharacterBody3D]:
+ [codeblocks]
+ [gdscript]
+ var current_scale: Vector3 = Vector3(1, 1, 1)
+ var scale_accum: Vector3 = Vector3(1, 1, 1)
+
+ func _process(delta):
+ if Input.is_action_just_pressed("animate"):
+ current_scale = get_scale()
+ scale_accum = Vector3(1, 1, 1)
+ state_machine.travel("Animate")
+ scale_accum += animation_tree.get_root_motion_scale()
+ set_scale(current_scale * scale_accum)
+ [/gdscript]
+ [/codeblocks]
</description>
</method>
<method name="rename_parameter">
@@ -48,7 +104,7 @@
</member>
<member name="root_motion_track" type="NodePath" setter="set_root_motion_track" getter="get_root_motion_track" default="NodePath(&quot;&quot;)">
The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by [code]":"[/code]. For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code].
- If the track has type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_ROTATION_3D] or [constant Animation.TYPE_SCALE_3D] the transformation will be cancelled visually, and the animation will appear to stay in place. See also [method get_root_motion_transform] and [RootMotionView].
+ If the track has type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_ROTATION_3D] or [constant Animation.TYPE_SCALE_3D] the transformation will be cancelled visually, and the animation will appear to stay in place. See also [method get_root_motion_position], [method get_root_motion_rotation], [method get_root_motion_scale] and [RootMotionView].
</member>
<member name="tree_root" type="AnimationNode" setter="set_tree_root" getter="get_tree_root">
The root animation node of this [AnimationTree]. See [AnimationNode].
diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml
index fbb31cadcd..8a5048de6b 100644
--- a/doc/classes/BaseMaterial3D.xml
+++ b/doc/classes/BaseMaterial3D.xml
@@ -319,7 +319,7 @@
Texture that controls the strength of the refraction per-pixel. Multiplied by [member refraction_scale].
</member>
<member name="refraction_texture_channel" type="int" setter="set_refraction_texture_channel" getter="get_refraction_texture_channel" enum="BaseMaterial3D.TextureChannel" default="0">
- Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
+ Specifies the channel of the [member refraction_texture] in which the refraction information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored refraction in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
</member>
<member name="rim" type="float" setter="set_rim" getter="get_rim" default="1.0">
Sets the strength of the rim lighting effect.
@@ -341,7 +341,7 @@
Texture used to control the roughness per-pixel. Multiplied by [member roughness].
</member>
<member name="roughness_texture_channel" type="int" setter="set_roughness_texture_channel" getter="get_roughness_texture_channel" enum="BaseMaterial3D.TextureChannel" default="0">
- Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
+ Specifies the channel of the [member roughness_texture] in which the roughness information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
</member>
<member name="shading_mode" type="int" setter="set_shading_mode" getter="get_shading_mode" enum="BaseMaterial3D.ShadingMode" default="1">
Sets whether the shading takes place per-pixel or per-vertex. Per-vertex lighting is faster, making it the best choice for mobile applications, however it looks considerably worse than per-pixel.
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 50bbbc71a0..499d53e63c 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -510,7 +510,7 @@
<method name="move_to_front">
<return type="void" />
<description>
- Moves this node to display on top of its siblings. This has more use in [Control], as [Node2D] can be ordered with [member Node2D.z_index].
+ Moves this node to display on top of its siblings.
Internally, the node is moved to the bottom of parent's children list. The method has no effect on nodes without a parent.
</description>
</method>
@@ -587,6 +587,17 @@
If [code]true[/code], this [CanvasItem] is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]).
[b]Note:[/b] For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead.
</member>
+ <member name="y_sort_enabled" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false">
+ If [code]true[/code], child nodes with the lowest Y position are drawn before those with a higher Y position. If [code]false[/code], Y-sorting is disabled. Y-sorting only affects children that inherit from [CanvasItem].
+ You can nest nodes with Y-sorting. Child Y-sorted nodes are sorted in the same space as the parent Y-sort. This feature allows you to organize a scene better or divide it into multiple ones without changing your scene tree.
+ </member>
+ <member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative" default="true">
+ If [code]true[/code], the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5.
+ </member>
+ <member name="z_index" type="int" setter="set_z_index" getter="get_z_index" default="0">
+ Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive).
+ [b]Note:[/b] Changing the Z index of a [Control] only affects the drawing order, not the order in which input events are handled. This can be useful to implement certain UI animations, e.g. a menu where hovered items are scaled and should overlap others.
+ </member>
</members>
<signals>
<signal name="draw">
diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml
index c98b194a4d..a6f707383f 100644
--- a/doc/classes/CharFXTransform.xml
+++ b/doc/classes/CharFXTransform.xml
@@ -46,6 +46,9 @@
<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="relative_index" type="int" setter="set_relative_index" getter="get_relative_index" default="0">
+ The character offset of the glyph, relative to the current [RichTextEffect] custom block. 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.
</member>
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index 90fbdcc622..4d78433915 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Color" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Color in RGBA format using floats on the range of 0 to 1.
+ Color built-in type, in RGBA format.
</brief_description>
<description>
- A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for opacity. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors).
- You can also create a color from standardized color names by using the string constructor 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].
+ A color represented in RGBA format by red ([member r]), green ([member g]), blue ([member b]), and alpha ([member a]) components. Each component is a 16-bit floating-point value, usually ranging from 0 to 1. Some properties (such as [member CanvasItem.modulate]) may support values greater than 1, for overbright or High Dynamic Range colors. If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8].
+ Colors can also be created by name from a set of standardized colors, through the [String] constructor, [method from_string], or by directly fetching the color constants documented here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url], with the addition of [constant TRANSPARENT].
[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>
@@ -19,7 +18,8 @@
<constructor name="Color">
<return type="Color" />
<description>
- Constructs a default-initialized [Color] with all components set to [code]0[/code].
+ Constructs a default [Color] from opaque black. This is the same as [constant BLACK].
+ [b]Note:[/b] in C#, constructs an empty color with all of its components set to [code]0.0[/code] (transparent black).
</description>
</constructor>
<constructor name="Color">
@@ -27,10 +27,10 @@
<param index="0" name="from" type="Color" />
<param index="1" name="alpha" type="float" />
<description>
- Constructs a [Color] from an existing color, but with a custom alpha value.
+ Constructs a [Color] from the existing color, with [member a] set to the given [param alpha] value.
[codeblocks]
[gdscript]
- var red = Color(Color.red, 0.2) # 20% opaque red.
+ var red = Color(Color.RED, 0.2) # 20% opaque red.
[/gdscript]
[csharp]
var red = new Color(Colors.Red, 0.2f); // 20% opaque red.
@@ -49,7 +49,7 @@
<return type="Color" />
<param index="0" name="code" type="String" />
<description>
- Constructs a [Color] either from an HTML color code or from a standardized color name. Supported color names are the same as the constants.
+ Constructs a [Color] either from an HTML color code or from a standardized color name. The supported color names are the same as the constants.
</description>
</constructor>
<constructor name="Color">
@@ -57,7 +57,7 @@
<param index="0" name="code" type="String" />
<param index="1" name="alpha" type="float" />
<description>
- Constructs a [Color] either from an HTML color code or from a standardized color name, with [param alpha] on the range of 0 to 1. Supported color names are the same as the constants.
+ Constructs a [Color] either from an HTML color code or from a standardized color name, with [param alpha] on the range of 0.0 to 1.0. The supported color names are the same as the constants.
</description>
</constructor>
<constructor name="Color">
@@ -66,7 +66,7 @@
<param index="1" name="g" type="float" />
<param index="2" name="b" type="float" />
<description>
- Constructs a [Color] from RGB values, typically between 0 and 1. Alpha will be 1.
+ Constructs a [Color] from RGB values, typically between 0.0 and 1.0. [member a] is set to 1.0.
[codeblocks]
[gdscript]
var color = Color(0.2, 1.0, 0.7) # Similar to `Color8(51, 255, 178, 255)`
@@ -84,7 +84,7 @@
<param index="2" name="b" type="float" />
<param index="3" name="a" type="float" />
<description>
- Constructs a [Color] from RGBA values, typically between 0 and 1.
+ Constructs a [Color] from RGBA values, typically between 0.0 and 1.0.
[codeblocks]
[gdscript]
var color = Color(0.2, 1.0, 0.7, 0.8) # Similar to `Color8(51, 255, 178, 204)`
@@ -101,7 +101,7 @@
<return type="Color" />
<param index="0" name="over" type="Color" />
<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.
+ Returns a new color resulting from overlaying this color over the given color. In a painting program, you can imagine it as the [param over] color painted over this colour (including alpha).
[codeblocks]
[gdscript]
var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50%
@@ -128,7 +128,7 @@
<return type="Color" />
<param index="0" name="amount" type="float" />
<description>
- Returns a new color resulting from making this color darker by the specified percentage (ratio from 0 to 1).
+ Returns a new color resulting from making this color darker by the specified [param amount] (ratio from 0.0 to 1.0). See also [method lightened].
[codeblocks]
[gdscript]
var green = Color(0.0, 1.0, 0.0)
@@ -148,7 +148,7 @@
<param index="2" name="v" type="float" />
<param index="3" name="alpha" type="float" default="1.0" />
<description>
- Constructs a color from an [url=https://en.wikipedia.org/wiki/HSL_and_HSV]HSV profile[/url]. [param h] (hue), [param s] (saturation), and [param v] (value) are typically between 0 and 1.
+ Constructs a color from an [url=https://en.wikipedia.org/wiki/HSL_and_HSV]HSV profile[/url]. The hue ([param h]), saturation ([param s]), and value ([param v]) are typically between 0.0 and 1.0.
[codeblocks]
[gdscript]
var color = Color.from_hsv(0.58, 0.5, 0.79, 0.8)
@@ -166,7 +166,7 @@
<param index="2" name="l" type="float" />
<param index="3" name="alpha" type="float" default="1.0" />
<description>
- Constructs a color from an [url=https://bottosson.github.io/posts/colorpicker/]OK HSL profile[/url]. [param h] (hue), [param s] (saturation), and [param l] (lightness) are typically between 0 and 1.
+ Constructs a color from an [url=https://bottosson.github.io/posts/colorpicker/]OK HSL profile[/url]. The hue ([param h]), saturation ([param s]), and lightness ([param l]) are typically between 0.0 and 1.0.
[codeblocks]
[gdscript]
var color = Color.from_ok_hsl(0.58, 0.5, 0.79, 0.8)
@@ -189,14 +189,13 @@
<param index="0" name="str" type="String" />
<param index="1" name="default" type="Color" />
<description>
- Creates a [Color] from string, which can be either a HTML color code or a named color. Fallbacks to [param default] if the string does not denote any valid color.
+ Creates a [Color] from the given string, which can be either an HTML color code or a named color (case-insensitive). Returns [param default] if the color cannot be inferred from the string.
</description>
</method>
<method name="get_luminance" qualifiers="const">
<return type="float" />
<description>
- Returns the luminance of the color in the [code][0.0, 1.0][/code] range.
- This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark.
+ Returns the light intensity of the color, as a value between 0.0 and 1.0 (inclusive). This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark.
[b]Note:[/b] [method get_luminance] relies on the color being in the linear color space to return an accurate relative luminance value. If the color is in the sRGB color space, use [method srgb_to_linear] to convert it to the linear color space first.
</description>
</method>
@@ -204,9 +203,12 @@
<return type="Color" />
<param index="0" name="hex" type="int" />
<description>
- Returns the [Color] associated with the provided integer number, with 8 bits per channel in ARGB order. The integer should be 32-bit. Best used with hexadecimal notation.
+ Returns the [Color] associated with the provided [param hex] integer in 32-bit ARGB format (8 bits per channel, alpha channel first).
+ In GDScript and C#, the [int] is best visualized with hexadecimal notation ([code]"0x"[/code] prefix).
[codeblock]
- modulate = Color.hex(0xffff0000) # red
+ var red = Color.hex(0xffff0000)
+ var dark_cyan = Color.hex(0xff008b8b)
+ var my_color = Color.hex(0xa4bbefd2)
[/codeblock]
</description>
</method>
@@ -214,25 +216,27 @@
<return type="Color" />
<param index="0" name="hex" type="int" />
<description>
- Same as [method hex], but takes 64-bit integer and the color uses 16 bits per channel.
+ Returns the [Color] associated with the provided [param hex] integer in 64-bit ARGB format (16 bits per channel, alpha channel first).
+ In GDScript and C#, the [int] is best visualized with hexadecimal notation ([code]"0x"[/code] prefix).
</description>
</method>
<method name="html" qualifiers="static">
<return type="Color" />
<param index="0" name="rgba" type="String" />
<description>
- Returns a new color from [param rgba], an HTML hexadecimal color string. [param rgba] is not case sensitive, and may be prefixed with a '#' character.
- [param rgba] must be a valid three-digit or six-digit hexadecimal color string, and may contain an alpha channel value. If [param rgba] does not contain an alpha channel value, an alpha channel value of 1.0 is applied.
- If [param rgba] is invalid a Color(0.0, 0.0, 0.0, 1.0) is returned.
- [b]Note:[/b] This method is not implemented in C#, but the same functionality is provided in the class constructor.
+ Returns a new color from [param rgba], an HTML hexadecimal color string. [param rgba] is not case-sensitive, and may be prefixed by a hash sign ([code]#[/code]).
+ [param rgba] must be a valid three-digit or six-digit hexadecimal color string, and may contain an alpha channel value. If [param rgba] does not contain an alpha channel value, an alpha channel value of 1.0 is applied. If [param rgba] is invalid, returns an empty color.
+ [b]Note:[/b] In C#, this method is not implemented. The same functionality is provided by the Color constructor.
[codeblocks]
[gdscript]
- var green = Color.html("#00FF00FF") # set green to Color(0.0, 1.0, 0.0, 1.0)
- var blue = Color.html("#0000FF") # set blue to Color(0.0, 0.0, 1.0, 1.0)
+ var blue = Color.html("#0000ff") # blue is Color(0.0, 0.0, 1.0, 1.0)
+ var green = Color.html("#0F0") # green is Color(0.0, 1.0, 0.0, 1.0)
+ var col = Color.html("663399cc") # col is Color(0.4, 0.2, 0.6, 0.8)
[/gdscript]
[csharp]
- var green = new Color("#00FF00FF"); // set green to Color(0.0, 1.0, 0.0, 1.0)
- var blue = new Color("#0000FF"); // set blue to Color(0.0, 0.0, 1.0, 1.0)
+ var blue = new Color("#0000ff"); // blue is Color(0.0, 0.0, 1.0, 1.0)
+ var green = new Color("#0F0"); // green is Color(0.0, 1.0, 0.0, 1.0)
+ var col = new Color("663399cc"); // col is Color(0.4, 0.2, 0.6, 0.8)
[/csharp]
[/codeblocks]
</description>
@@ -241,24 +245,26 @@
<return type="bool" />
<param index="0" name="color" type="String" />
<description>
- Returns [code]true[/code] if [param color] is a valid HTML hexadecimal color string. [param color] is not case sensitive, and may be prefixed with a '#' character.
- For a string to be valid it must be three-digit or six-digit hexadecimal, and may contain an alpha channel value.
+ Returns [code]true[/code] if [param color] is a valid HTML hexadecimal color string. The string must be a hexadecimal value (case-insensitive) of either 3, 4, 6 or 8 digits, and may be prefixed by a hash sign ([code]#[/code]). This method is identical to [method String.is_valid_html_color].
[codeblocks]
[gdscript]
- var result = Color.html_is_valid("#55aaFF") # result is true
- result = Color.html_is_valid("#55AAFF20") # result is true
- result = Color.html_is_valid("55AAFF") # result is true
- result = Color.html_is_valid("#F2C") # result is true
- result = Color.html_is_valid("#AABBC) # result is false
- result = Color.html_is_valid("#55aaFF5") # result is false
+ Color.html_is_valid("#55aaFF") # Returns true
+ Color.html_is_valid("#55AAFF20") # Returns true
+ Color.html_is_valid("55AAFF") # Returns true
+ Color.html_is_valid("#F2C") # Returns true
+
+ Color.html_is_valid("#AABBC) # Returns false
+ Color.html_is_valid("#55aaFF5") # Returns false
[/gdscript]
[csharp]
- var result = Color.HtmlIsValid("#55AAFF"); // result is true
- result = Color.HtmlIsValid("#55AAFF20"); // result is true
- result = Color.HtmlIsValid("55AAFF); // result is true
- result = Color.HtmlIsValid("#F2C"); // result is true
- result = Color.HtmlIsValid("#AABBC"); // result is false
- result = Color.HtmlIsValid("#55aaFF5"); // result is false
+ // This method is not available in C#. Use `StringExtensions.IsValidHtmlColor()`, instead.
+ "#55AAFF".IsValidHtmlColor(); // Returns true
+ "#55AAFF20".IsValidHtmlColor(); // Returns true
+ "55AAFF".IsValidHtmlColor(); // Returns true
+ "#F2C".IsValidHtmlColor(); // Returns true
+
+ "#AABBC".IsValidHtmlColor(); // Returns false
+ "#55aaFF5".IsValidHtmlColor(); // Returns false
[/csharp]
[/codeblocks]
</description>
@@ -266,13 +272,15 @@
<method name="inverted" qualifiers="const">
<return type="Color" />
<description>
- Returns the inverted color [code](1 - r, 1 - g, 1 - b, a)[/code].
+ Returns the color with its [member r], [member g], and [member b] components inverted ([code](1 - r, 1 - g, 1 - b, a)[/code]).
[codeblocks]
[gdscript]
+ var black = Color.WHITE.inverted()
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 black = Colors.White.Inverted();
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]
@@ -291,17 +299,23 @@
<param index="0" name="to" type="Color" />
<param index="1" name="weight" type="float" />
<description>
- Returns the linear interpolation with another color. The interpolation factor [param weight] is between 0 and 1.
+ Returns the linear interpolation between this color's components and [param to]'s components. The interpolation factor [param weight] should be between 0.0 and 1.0 (inclusive). See also [method @GlobalScope.lerp].
[codeblocks]
[gdscript]
- var c1 = Color(1.0, 0.0, 0.0)
- var c2 = Color(0.0, 1.0, 0.0)
- var lerp_color = c1.lerp(c2, 0.5) # Equivalent to `Color(0.5, 0.5, 0.0)`
+ var red = Color(1.0, 0.0, 0.0)
+ var aqua = Color(0.0, 1.0, 0.8)
+
+ red.lerp(aqua, 0.2) # Returns Color(0.8, 0.2, 0.16)
+ red.lerp(aqua, 0.5) # Returns Color(0.5, 0.5, 0.4)
+ red.lerp(aqua, 1.0) # Returns Color(0.0, 1.0, 0.8)
[/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)`
+ var red = new Color(1.0f, 0.0f, 0.0f);
+ var aqua = new Color(0.0f, 1.0f, 0.8f);
+
+ red.Lerp(aqua, 0.2f); // Returns Color(0.8f, 0.2f, 0.16f)
+ red.Lerp(aqua, 0.5f); // Returns Color(0.5f, 0.5f, 0.4f)
+ red.Lerp(aqua, 1.0f); // Returns Color(0.0f, 1.0f, 0.8f)
[/csharp]
[/codeblocks]
</description>
@@ -310,15 +324,15 @@
<return type="Color" />
<param index="0" name="amount" type="float" />
<description>
- Returns a new color resulting from making this color lighter by the specified percentage (ratio from 0 to 1).
+ Returns a new color resulting from making this color lighter by the specified [param amount], which should be a ratio from 0.0 to 1.0. See also [method darkened].
[codeblocks]
[gdscript]
var green = Color(0.0, 1.0, 0.0)
- var lightgreen = green.lightened(0.2) # 20% lighter than regular green
+ var light_green = green.lightened(0.2) # 20% lighter than regular green
[/gdscript]
[csharp]
var green = new Color(0.0f, 1.0f, 0.0f);
- Color lightgreen = green.Lightened(0.2f); // 20% lighter than regular green
+ Color lightGreen = green.Lightened(0.2f); // 20% lighter than regular green
[/csharp]
[/codeblocks]
</description>
@@ -326,19 +340,19 @@
<method name="linear_to_srgb" qualifiers="const">
<return type="Color" />
<description>
- Returns the color converted to the [url=https://en.wikipedia.org/wiki/SRGB]sRGB[/url] color space. This assumes the original color is in the linear color space. See also [method srgb_to_linear] which performs the opposite operation.
+ Returns the color converted to the [url=https://en.wikipedia.org/wiki/SRGB]sRGB[/url] color space. This method assumes the original color is in the linear color space. See also [method srgb_to_linear] which performs the opposite operation.
</description>
</method>
<method name="srgb_to_linear" qualifiers="const">
<return type="Color" />
<description>
- Returns the color converted to the linear color space. This assumes the original color is in the sRGB color space. See also [method linear_to_srgb] which performs the opposite operation.
+ Returns the color converted to the linear color space. This method assumes the original color already is in the sRGB color space. See also [method linear_to_srgb] which performs the opposite operation.
</description>
</method>
<method name="to_abgr32" qualifiers="const">
<return type="int" />
<description>
- 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.
+ Returns the color converted to a 32-bit integer in ABGR format (each component is 8 bits). ABGR is the reversed version of the default RGBA format.
[codeblocks]
[gdscript]
var color = Color(1, 0.5, 0.2)
@@ -354,7 +368,7 @@
<method name="to_abgr64" qualifiers="const">
<return type="int" />
<description>
- 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.
+ Returns the color converted to a 64-bit integer in ABGR format (each component is 16 bits). ABGR is the reversed version of the default RGBA format.
[codeblocks]
[gdscript]
var color = Color(1, 0.5, 0.2)
@@ -370,7 +384,7 @@
<method name="to_argb32" qualifiers="const">
<return type="int" />
<description>
- Returns the color converted to a 32-bit integer in ARGB format (each byte represents a color channel). ARGB is more compatible with DirectX.
+ Returns the color converted to a 32-bit integer in ARGB format (each component is 8 bits). ARGB is more compatible with DirectX.
[codeblocks]
[gdscript]
var color = Color(1, 0.5, 0.2)
@@ -386,7 +400,7 @@
<method name="to_argb64" qualifiers="const">
<return type="int" />
<description>
- Returns the color converted to a 64-bit integer in ARGB format (each word represents a color channel). ARGB is more compatible with DirectX.
+ Returns the color converted to a 64-bit integer in ARGB format (each component is 16 bits). ARGB is more compatible with DirectX.
[codeblocks]
[gdscript]
var color = Color(1, 0.5, 0.2)
@@ -403,18 +417,18 @@
<return type="String" />
<param index="0" name="with_alpha" type="bool" default="true" />
<description>
- Returns the color converted to an HTML hexadecimal color string in RGBA format (ex: [code]ff34f822[/code]).
- Setting [param with_alpha] to [code]false[/code] excludes alpha from the hexadecimal string (and uses RGB instead of RGBA format).
+ Returns the color converted to an HTML hexadecimal color [String] in RGBA format, without the hash ([code]#[/code]) prefix.
+ Setting [param with_alpha] to [code]false[/code], excludes alpha from the hexadecimal string, using RGB format instead of RGBA format.
[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"
+ var white = Color(1, 1, 1, 0.5)
+ var with_alpha = white.to_html() # Returns "ffffff7f"
+ var without_alpha = white.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"
+ var white = new Color(1, 1, 1, 0.5f);
+ string withAlpha = white.ToHtml(); // Returns "ffffff7f"
+ string withoutAlpha = white.ToHtml(false); // Returns "ffffff"
[/csharp]
[/codeblocks]
</description>
@@ -422,7 +436,7 @@
<method name="to_rgba32" qualifiers="const">
<return type="int" />
<description>
- Returns the color converted to a 32-bit integer in RGBA format (each byte represents a color channel). RGBA is Godot's default format.
+ Returns the color converted to a 32-bit integer in RGBA format (each component is 8 bits). RGBA is Godot's default format.
[codeblocks]
[gdscript]
var color = Color(1, 0.5, 0.2)
@@ -438,7 +452,7 @@
<method name="to_rgba64" qualifiers="const">
<return type="int" />
<description>
- Returns the color converted to a 64-bit integer in RGBA format (each word represents a color channel). RGBA is Godot's default format.
+ Returns the color converted to a 64-bit integer in RGBA format (each component is 16 bits). RGBA is Godot's default format.
[codeblocks]
[gdscript]
var color = Color(1, 0.5, 0.2)
@@ -457,19 +471,19 @@
The color's alpha component, typically on the range of 0 to 1. A value of 0 means that the color is fully transparent. A value of 1 means that the color is fully opaque.
</member>
<member name="a8" type="int" setter="" getter="" default="255">
- Wrapper for [member a] that uses the range 0 to 255 instead of 0 to 1.
+ Wrapper for [member a] that uses the range 0 to 255, instead of 0 to 1.
</member>
<member name="b" type="float" setter="" getter="" default="0.0">
The color's blue component, typically on the range of 0 to 1.
</member>
<member name="b8" type="int" setter="" getter="" default="0">
- Wrapper for [member b] that uses the range 0 to 255 instead of 0 to 1.
+ Wrapper for [member b] that uses the range 0 to 255, instead of 0 to 1.
</member>
<member name="g" type="float" setter="" getter="" default="0.0">
The color's green component, typically on the range of 0 to 1.
</member>
<member name="g8" type="int" setter="" getter="" default="0">
- Wrapper for [member g] that uses the range 0 to 255 instead of 0 to 1.
+ Wrapper for [member g] that uses the range 0 to 255, instead of 0 to 1.
</member>
<member name="h" type="float" setter="" getter="" default="0.0">
The HSV hue of this color, on the range 0 to 1.
@@ -478,7 +492,7 @@
The color's red component, typically on the range of 0 to 1.
</member>
<member name="r8" type="int" setter="" getter="" default="0">
- Wrapper for [member r] that uses the range 0 to 255 instead of 0 to 1.
+ Wrapper for [member r] that uses the range 0 to 255, instead of 0 to 1.
</member>
<member name="s" type="float" setter="" getter="" default="0.0">
The HSV saturation of this color, on the range 0 to 1.
@@ -510,7 +524,7 @@
Bisque color.
</constant>
<constant name="BLACK" value="Color(0, 0, 0, 1)">
- Black color.
+ Black color. In GDScript, this is the default value of any color.
</constant>
<constant name="BLANCHED_ALMOND" value="Color(1, 0.921569, 0.803922, 1)">
Blanched almond color.
@@ -932,7 +946,7 @@
<return type="bool" />
<param index="0" name="right" type="Color" />
<description>
- Returns [code]true[/code] if the colors are not equal.
+ Returns [code]true[/code] if the colors are not exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
</description>
</operator>
@@ -1004,7 +1018,7 @@
<return type="float" />
<param index="0" name="index" type="int" />
<description>
- Access color components using their index. [code]c[0][/code] is equivalent to [code]c.r[/code], [code]c[1][/code] is equivalent to [code]c.g[/code], [code]c[2][/code] is equivalent to [code]c.b[/code], and [code]c[3][/code] is equivalent to [code]c.a[/code].
+ Access color components using their index. [code][0][/code] is equivalent to [member r], [code][1][/code] is equivalent to [member g], [code][2][/code] is equivalent to [member b], and [code][3][/code] is equivalent to [member a].
</description>
</operator>
<operator name="operator unary+">
@@ -1016,7 +1030,7 @@
<operator name="operator unary-">
<return type="Color" />
<description>
- Inverts the given color. This is equivalent to [code]Color.WHITE - c[/code] or [code]Color(1 - c.r, 1 - c.g, 1 - c.b, 1 - c.a)[/code].
+ Inverts the given color. This is equivalent to [code]Color.WHITE - c[/code] or [code]Color(1 - c.r, 1 - c.g, 1 - c.b, 1 - c.a)[/code]. Unlike with [method inverted], the [member a] component is inverted, too.
</description>
</operator>
</operators>
diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml
index ccdf085319..b5e75dff68 100644
--- a/doc/classes/Curve2D.xml
+++ b/doc/classes/Curve2D.xml
@@ -51,7 +51,7 @@
<return type="Vector2" />
<param index="0" name="to_point" type="Vector2" />
<description>
- Returns the closest baked point (in curve's local space) to [param to_point].
+ Returns the closest point on baked segments (in curve's local space) to [param to_point].
[param to_point] must be in this curve's local space.
</description>
</method>
@@ -94,7 +94,7 @@
</method>
<method name="sample_baked" qualifiers="const">
<return type="Vector2" />
- <param index="0" name="offset" type="float" />
+ <param index="0" name="offset" type="float" default="0.0" />
<param index="1" name="cubic" type="bool" default="false" />
<description>
Returns a point within the curve at position [param offset], where [param offset] is measured as a pixel distance along the curve.
@@ -104,13 +104,10 @@
</method>
<method name="sample_baked_with_rotation" qualifiers="const">
<return type="Transform2D" />
- <param index="0" name="offset" type="float" />
+ <param index="0" name="offset" type="float" default="0.0" />
<param index="1" name="cubic" type="bool" default="false" />
- <param index="2" name="loop" type="bool" default="true" />
- <param index="3" name="lookahead" type="float" default="4.0" />
<description>
Similar to [method sample_baked], but returns [Transform2D] that includes a rotation along the curve. Returns empty transform if length of the curve is [code]0[/code].
- Use [param loop] to smooth the tangent at the end of the curve. [param lookahead] defines the distance to a nearby point for calculating the tangent vector.
[codeblock]
var transform = curve.sample_baked_with_rotation(offset)
position = transform.get_origin()
@@ -160,6 +157,13 @@
[param tolerance_degrees] controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided.
</description>
</method>
+ <method name="tessellate_even_length" qualifiers="const">
+ <return type="PackedVector2Array" />
+ <param index="0" name="max_stages" type="int" default="5" />
+ <param index="1" name="tolerance_length" type="float" default="20.0" />
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval" default="5.0">
diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml
index 67e4e45e52..cfe2036499 100644
--- a/doc/classes/Curve3D.xml
+++ b/doc/classes/Curve3D.xml
@@ -64,7 +64,7 @@
<return type="Vector3" />
<param index="0" name="to_point" type="Vector3" />
<description>
- Returns the closest baked point (in curve's local space) to [param to_point].
+ Returns the closest point on baked segments (in curve's local space) to [param to_point].
[param to_point] must be in this curve's local space.
</description>
</method>
@@ -114,7 +114,7 @@
</method>
<method name="sample_baked" qualifiers="const">
<return type="Vector3" />
- <param index="0" name="offset" type="float" />
+ <param index="0" name="offset" type="float" default="0.0" />
<param index="1" name="cubic" type="bool" default="false" />
<description>
Returns a point within the curve at position [param offset], where [param offset] is measured as a distance in 3D units along the curve.
@@ -134,7 +134,7 @@
</method>
<method name="sample_baked_with_rotation" qualifiers="const">
<return type="Transform3D" />
- <param index="0" name="offset" type="float" />
+ <param index="0" name="offset" type="float" default="0.0" />
<param index="1" name="cubic" type="bool" default="false" />
<param index="2" name="apply_tilt" type="bool" default="false" />
<description>
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index 9842288d35..92225b816f 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -4,9 +4,8 @@
Dictionary type.
</brief_description>
<description>
- Dictionary type. Associative container, which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements. In other programming languages, this data structure is sometimes referred to as a hash map or associative array.
+ Dictionary type. Associative container, which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding new entries. In other programming languages, this data structure is sometimes referred to as a hash map or associative array.
You can define a dictionary by placing a comma-separated list of [code]key: value[/code] pairs in curly braces [code]{}[/code].
- 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:
[codeblocks]
@@ -40,10 +39,10 @@
};
[/csharp]
[/codeblocks]
- You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dict["White"][/code] will return [code]50[/code]. You can also write [code]points_dict.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).
+ You can access a dictionary's value by referencing its corresponding key. In the above example, [code]points_dict["White"][/code] will return [code]50[/code]. You can also write [code]points_dict.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
+ @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.
@@ -69,7 +68,9 @@
Dictionaries can contain more complex data:
[codeblocks]
[gdscript]
- my_dict = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key.
+ var my_dict = {
+ "First Array": [1, 2, 3, 4] # Assigns an Array to a String key.
+ }
[/gdscript]
[csharp]
var myDict = new Godot.Collections.Dictionary
@@ -91,7 +92,7 @@
{"Yellow", 75},
{"Orange", 100}
};
- pointsDict["blue"] = 150; // Add "Blue" as a key and assign 150 as its value.
+ 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:
@@ -118,63 +119,23 @@
};
[/csharp]
[/codeblocks]
- [b]Note:[/b] Unlike [Array]s, you can't compare dictionaries directly:
+ The keys of a dictionary can be iterated with the [code]for[/code] keyword:
[codeblocks]
[gdscript]
- var array1 = [1, 2, 3]
- var array2 = [1, 2, 3]
-
- func compare_arrays():
- print(array1 == array2) # Will print true.
-
- var dict1 = {"a": 1, "b": 2, "c": 3}
- var dict2 = {"a": 1, "b": 2, "c": 3}
-
- func compare_dictionaries():
- print(dict1 == dict2) # Will NOT print true.
+ var groceries = {"Orange": 20, "Apple": 2, "Banana": 4}
+ for fruit in groceries:
+ var amount = groceries[fruit]
[/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()
+ var groceries = new Godot.Collections.Dictionary{{"Orange", 20}, {"Apple", 2}, {"Banana", 4}};
+ foreach (var (fruit, amount) in groceries)
{
- 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.
+ // `fruit` is the key, `amount` is the value.
}
[/csharp]
[/codeblocks]
- You need to first calculate the dictionary's hash with [method hash] before you can compare them:
- [codeblocks]
- [gdscript]
- var dict1 = {"a": 1, "b": 2, "c": 3}
- var dict2 = {"a": 1, "b": 2, "c": 3}
-
- func compare_dictionaries():
- 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.
+ [b]Note:[/b] Erasing elements while iterating over dictionaries is [b]not[/b] supported and will result in unpredictable behavior.
+ [b]Note:[/b] When declaring a dictionary with [code]const[/code], the dictionary becomes read-only. A read-only Dictionary's entries cannot be overriden at run-time. This does [i]not[/i] affect nested [Array] and [Dictionary] values.
</description>
<tutorials>
<link title="GDScript basics: Dictionary">$DOCS_URL/tutorials/scripting/gdscript/gdscript_basics.html#dictionary</link>
@@ -192,7 +153,7 @@
<return type="Dictionary" />
<param index="0" name="from" type="Dictionary" />
<description>
- Constructs a [Dictionary] as a copy of the given [Dictionary].
+ Returns the same array as [param from]. If you need a copy of the array, use [method duplicate].
</description>
</constructor>
</constructors>
@@ -200,30 +161,30 @@
<method name="clear">
<return type="void" />
<description>
- Clear the dictionary, removing all key/value pairs.
+ Clears the dictionary, removing all entries from it.
</description>
</method>
<method name="duplicate" qualifiers="const">
<return type="Dictionary" />
<param index="0" name="deep" type="bool" default="false" />
<description>
- Creates a copy of the dictionary, and returns it. The [param deep] parameter causes inner dictionaries and arrays to be copied recursively, but does not apply to objects.
+ Creates and returns a new copy of the dictionary. If [param deep] is [code]true[/code], inner [Dictionary] and [Array] keys and values are also copied, recursively.
</description>
</method>
<method name="erase">
<return type="bool" />
<param index="0" name="key" type="Variant" />
<description>
- Erase a dictionary key/value pair by key. Returns [code]true[/code] if the given key was present in the dictionary, [code]false[/code] otherwise.
- [b]Note:[/b] Don't erase elements while iterating over the dictionary. You can iterate over the [method keys] array instead.
+ Removes the dictionary entry by key, if it exists. Returns [code]true[/code] if the given [param key] existed in the dictionary, otherwise [code]false[/code].
+ [b]Note:[/b] Do not erase entries while iterating over the dictionary. You can iterate over the [method keys] array instead.
</description>
</method>
<method name="find_key" qualifiers="const">
<return type="Variant" />
<param index="0" name="value" type="Variant" />
<description>
- Returns the first key whose associated value is equal to [param value], or [code]null[/code] if no such value is found.
- [b]Note:[/b] [code]null[/code] is also a valid key. If you have it in your [Dictionary], the [method find_key] method can give misleading results.
+ Finds and returns the first key whose associated value is equal to [param value], or [code]null[/code] if it is not found.
+ [b]Note:[/b] [code]null[/code] is also a valid key. If inside the dictionary, [method find_key] may give misleading results.
</description>
</method>
<method name="get" qualifiers="const">
@@ -231,72 +192,89 @@
<param index="0" name="key" type="Variant" />
<param index="1" name="default" type="Variant" default="null" />
<description>
- Returns the current value for the specified key in the [Dictionary]. If the key does not exist, the method returns the value of the optional default argument, or [code]null[/code] if it is omitted.
+ Returns the corresponding value for the given [param key] in the dictionary. If the [param key] does not exist, returns [param default], or [code]null[/code] if the parameter is omitted.
</description>
</method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="key" type="Variant" />
<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:
+ Returns [code]true[/code] if the dictionary contains an entry with the given [param key].
[codeblocks]
[gdscript]
- # Will evaluate to `true`.
- if "godot" in {"godot": "engine"}:
- pass
+ var my_dict = {
+ "Godot" : 4,
+ 210 : null,
+ }
+
+ print(my_dict.has("Godot")) # Prints true
+ print(my_dict.has(210)) # Prints true
+ print(my_dict.has(4)) # Prints false
[/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"))
+ var myDict = new Godot.Collections.Dictionary
{
- // I am executed.
- }
+ { "Godot", 4 },
+ { 210, default },
+ };
+
+ GD.Print(myDict.Contains("Godot")); // Prints true
+ GD.Print(myDict.Contains(210)); // Prints true
+ GD.Print(myDict.Contains(4)); // Prints false
[/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].
+ In GDScript, this is equivalent to the [code]in[/code] operator:
+ [codeblock]
+ if "Godot" in {"Godot": 4}:
+ print("The key is here!") # Will be printed.
+ [/codeblock]
+ [b]Note:[/b] This method returns [code]true[/code] as long as the [param key] exists, even if its corresponding value is [code]null[/code].
</description>
</method>
<method name="has_all" qualifiers="const">
<return type="bool" />
<param index="0" name="keys" type="Array" />
<description>
- Returns [code]true[/code] if the dictionary has all the keys in the given array.
+ Returns [code]true[/code] if the dictionary contains all keys in the given [param keys] array.
+ [codeblock]
+ var data = {"width" : 10, "height" : 20}
+ data.has_all(["height", "width"]) # Returns true
+ [/codeblock]
</description>
</method>
<method name="hash" qualifiers="const">
<return type="int" />
<description>
- Returns a hashed 32-bit integer value representing the dictionary contents. This can be used to compare dictionaries by value:
+ Returns a hashed 32-bit integer value representing the dictionary contents.
[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())
+ var dict1 = {"A": 10, "B": 2}
+ var dict2 = {"A": 10, "B": 2}
+
+ print(dict1.hash() == dict2.hash()) # Prints true
[/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));
+ var dict1 = new Godot.Collections.Dictionary{{"A", 10}, {"B", 2}};
+ var dict2 = new Godot.Collections.Dictionary{{"A", 10}, {"B", 2}};
+
+ // Godot.Collections.Dictionary has no Hash() method. Use GD.Hash() instead.
+ GD.Print(GD.Hash(dict1) == GD.Hash(dict2)); // Prints true
[/csharp]
[/codeblocks]
- [b]Note:[/b] Dictionaries with the same keys/values but in a different order will have a different hash.
- [b]Note:[/b] Dictionaries with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does [i]not[/i] imply the dictionaries are equal, because different dictionaries can have identical hash values due to hash collisions.
+ [b]Note:[/b] Dictionaries with the same entries but in a different order will not have the same hash.
+ [b]Note:[/b] Dictionaries with equal hash values are [i]not[/i] guaranteed to be the same, because of hash collisions. On the countrary, dictionaries with different hash values are guaranteed to be different.
</description>
</method>
<method name="is_empty" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the dictionary is empty.
+ Returns [code]true[/code] if the dictionary is empty (its size is [code]0[/code]). See also [method size].
</description>
</method>
<method name="keys" qualifiers="const">
<return type="Array" />
<description>
- Returns the list of keys in the [Dictionary].
+ Returns the list of keys in the dictionary.
</description>
</method>
<method name="merge">
@@ -304,19 +282,19 @@
<param index="0" name="dictionary" type="Dictionary" />
<param index="1" name="overwrite" type="bool" default="false" />
<description>
- Adds elements from [param dictionary] to this [Dictionary]. By default, duplicate keys will not be copied over, unless [param overwrite] is [code]true[/code].
+ Adds entries from [param dictionary] to this dictionary. By default, duplicate keys are not copied over, unless [param overwrite] is [code]true[/code].
</description>
</method>
<method name="size" qualifiers="const">
<return type="int" />
<description>
- Returns the number of keys in the dictionary.
+ Returns the number of entries in the dictionary. Empty dictionaries ([code]{ }[/code]) always return [code]0[/code]. See also [method is_empty].
</description>
</method>
<method name="values" qualifiers="const">
<return type="Array" />
<description>
- Returns the list of values in the [Dictionary].
+ Returns the list of values in this dictionary.
</description>
</method>
</methods>
@@ -325,21 +303,22 @@
<return type="bool" />
<param index="0" name="right" type="Dictionary" />
<description>
- Returns [code]true[/code] if the dictionaries differ, i.e. their key or value lists are different (including the order).
+ Returns [code]true[/code] if the two dictionaries do not contain the same keys and values.
</description>
</operator>
<operator name="operator ==">
<return type="bool" />
<param index="0" name="right" type="Dictionary" />
<description>
- Returns [code]true[/code] if both dictionaries have the same contents, i.e. their keys list and value list are equal.
+ Returns [code]true[/code] if the two dictionaries contain the same keys and values. The order of the entries does not matter.
+ [b]Note:[/b] In C#, by convention, this operator compares by [b]reference[/b]. If you need to compare by value, iterate over both dictionaries.
</description>
</operator>
<operator name="operator []">
<return type="Variant" />
<param index="0" name="key" type="Variant" />
<description>
- Returns a value at the given [param key] or [code]null[/code] and error if the key does not exist. For safe access, use [method get] or [method has].
+ Returns the corresponding value for the given [param key] in the dictionary. If the entry does not exist, fails and returns [code]null[/code]. For safe access, use [method get] or [method has].
</description>
</operator>
</operators>
diff --git a/doc/classes/DirectionalLight2D.xml b/doc/classes/DirectionalLight2D.xml
index 7a54980c19..f825a9e082 100644
--- a/doc/classes/DirectionalLight2D.xml
+++ b/doc/classes/DirectionalLight2D.xml
@@ -1,19 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="DirectionalLight2D" inherits="Light2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Directional light from a distance.
+ Directional 2D light from a distance.
</brief_description>
<description>
A directional light is a type of [Light2D] node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene (for example: to model sunlight or moonlight).
</description>
<tutorials>
+ <link title="2D lights and shadows">$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html</link>
</tutorials>
<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. Ranges from 0 (parallel to the plane) to 1 (perpendicular to the plane).
</member>
<member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="10000.0">
- Maximum distance this light covers. Increasing this value will make directional shadows visible from further away, at the cost of lower overall shadow detail and performance (due to more objects being included in shadow rendering).
+ The maximum distance from the camera center objects can be before their shadows are culled (in pixels). Decreasing this value can prevent objects located outside the camera from casting shadows (while also improving performance). [member Camera2D.zoom] is not taken into account by [member max_distance], which means that at higher zoom values, shadows will appear to fade out sooner when zooming onto a given point.
</member>
</members>
</class>
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 0039301bf6..c59bfbfe4f 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -1715,6 +1715,7 @@
<constant name="DISPLAY_HANDLE" value="0" enum="HandleType">
Display handle:
- Linux (X11): [code]X11::Display*[/code] for the display.
+ - Android: [code]EGLDisplay[/code] for the display.
</constant>
<constant name="WINDOW_HANDLE" value="1" enum="HandleType">
Window handle:
diff --git a/doc/classes/EditorSceneFormatImporter.xml b/doc/classes/EditorSceneFormatImporter.xml
index 6de9c2c5dc..db93cab14c 100644
--- a/doc/classes/EditorSceneFormatImporter.xml
+++ b/doc/classes/EditorSceneFormatImporter.xml
@@ -39,7 +39,6 @@
<param index="0" name="path" type="String" />
<param index="1" name="flags" type="int" />
<param index="2" name="options" type="Dictionary" />
- <param index="3" name="bake_fps" type="int" />
<description>
</description>
</method>
diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml
index 07457387a0..865faa13ae 100644
--- a/doc/classes/EditorSettings.xml
+++ b/doc/classes/EditorSettings.xml
@@ -592,6 +592,9 @@
<member name="interface/theme/custom_theme" type="String" setter="" getter="">
The custom theme resource to use for the editor. Must be a Godot theme resource in [code].tres[/code] or [code].res[/code] format.
</member>
+ <member name="interface/theme/draw_extra_borders" type="bool" setter="" getter="">
+ If [code]true[/code], draws additional borders around interactive UI elements in the editor. This is automatically enabled when using the [b]Black (OLED)[/b] theme preset, as this theme preset uses a fully black background.
+ </member>
<member name="interface/theme/icon_and_font_color" type="int" setter="" getter="">
The icon and font color scheme to use in the editor.
- [b]Auto[/b] determines the color scheme to use automatically based on [member interface/theme/base_color].
diff --git a/doc/classes/FileAccess.xml b/doc/classes/FileAccess.xml
index e52f897164..be0c8fd6ca 100644
--- a/doc/classes/FileAccess.xml
+++ b/doc/classes/FileAccess.xml
@@ -153,6 +153,20 @@
Returns the last error that happened when trying to perform operations. Compare with the [code]ERR_FILE_*[/code] constants from [enum Error].
</description>
</method>
+ <method name="get_file_as_bytes" qualifiers="static">
+ <return type="PackedByteArray" />
+ <param index="0" name="path" type="String" />
+ <description>
+ Returns the whole [param path] file contents as a [PackedByteArray] without any decoding.
+ </description>
+ </method>
+ <method name="get_file_as_string" qualifiers="static">
+ <return type="String" />
+ <param index="0" name="path" type="String" />
+ <description>
+ Returns the whole [param path] file contents as a [String]. Text is interpreted as being UTF-8 encoded.
+ </description>
+ </method>
<method name="get_float" qualifiers="const">
<return type="float" />
<description>
diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml
index 6a42b62bcf..761e75339a 100644
--- a/doc/classes/Font.xml
+++ b/doc/classes/Font.xml
@@ -161,6 +161,12 @@
Returns font family name.
</description>
</method>
+ <method name="get_font_stretch" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns font stretch amount, compared to a normal width. A percentage value between [code]50%[/code] and [code]200%[/code].
+ </description>
+ </method>
<method name="get_font_style" qualifiers="const">
<return type="int" enum="TextServer.FontStyle" />
<description>
@@ -173,6 +179,12 @@
Returns font style name.
</description>
</method>
+ <method name="get_font_weight" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns weight (boldness) of the font. A value in the [code]100...999[/code] range, normal font weight is [code]400[/code], bold font weight is [code]700[/code].
+ </description>
+ </method>
<method name="get_height" qualifiers="const">
<return type="float" />
<param index="0" name="font_size" type="int" default="16" />
diff --git a/doc/classes/FontFile.xml b/doc/classes/FontFile.xml
index 271f6a13e0..1019c271dc 100644
--- a/doc/classes/FontFile.xml
+++ b/doc/classes/FontFile.xml
@@ -542,6 +542,9 @@
</method>
</methods>
<members>
+ <member name="allow_system_fallback" type="bool" setter="set_allow_system_fallback" getter="is_allow_system_fallback" default="true">
+ If set to [code]true[/code], system fonts can be automatically used as fallbacks.
+ </member>
<member name="antialiasing" type="int" setter="set_antialiasing" getter="get_antialiasing" enum="TextServer.FontAntialiasing" default="1">
Font anti-aliasing mode.
</member>
@@ -557,9 +560,15 @@
<member name="font_name" type="String" setter="set_font_name" getter="get_font_name" default="&quot;&quot;">
Font family name.
</member>
+ <member name="font_stretch" type="int" setter="set_font_stretch" getter="get_font_stretch" default="100">
+ Font stretch amount, compared to a normal width. A percentage value between [code]50%[/code] and [code]200%[/code].
+ </member>
<member name="font_style" type="int" setter="set_font_style" getter="get_font_style" enum="TextServer.FontStyle" default="0">
Font style flags, see [enum TextServer.FontStyle].
</member>
+ <member name="font_weight" type="int" setter="set_font_weight" getter="get_font_weight" default="400">
+ Weight (boldness) of the font. A value in the [code]100...999[/code] range, normal font weight is [code]400[/code], bold font weight is [code]700[/code].
+ </member>
<member name="force_autohinter" type="bool" setter="set_force_autohinter" getter="is_force_autohinter" default="false">
If set to [code]true[/code], auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only.
</member>
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml
index 5050ce7715..ea4e4b53ba 100644
--- a/doc/classes/GraphEdit.xml
+++ b/doc/classes/GraphEdit.xml
@@ -291,7 +291,7 @@
</description>
</signal>
<signal name="connection_drag_started">
- <param index="0" name="from_node" type="String" />
+ <param index="0" name="from_node" type="StringName" />
<param index="1" name="from_port" type="int" />
<param index="2" name="is_output" type="bool" />
<description>
diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml
index 00815758a1..062d532464 100644
--- a/doc/classes/Light2D.xml
+++ b/doc/classes/Light2D.xml
@@ -4,8 +4,7 @@
Casts light in a 2D environment.
</brief_description>
<description>
- Casts light in a 2D environment. Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related).
- [b]Note:[/b] Light2D can also be used as a mask.
+ Casts light in a 2D environment. A light is defined as a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related).
</description>
<tutorials>
<link title="2D lights and shadows">$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html</link>
@@ -14,12 +13,14 @@
<method name="get_height" qualifiers="const">
<return type="float" />
<description>
+ Returns the light's height, which is used in 2D normal mapping. See [member PointLight2D.height] and [member DirectionalLight2D.height].
</description>
</method>
<method name="set_height">
<return type="void" />
<param index="0" name="height" type="float" />
<description>
+ Sets the light's height, which is used in 2D normal mapping. See [member PointLight2D.height] and [member DirectionalLight2D.height].
</description>
</method>
</methods>
@@ -64,7 +65,7 @@
Shadow filter type. See [enum ShadowFilter] for possible values.
</member>
<member name="shadow_filter_smooth" type="float" setter="set_shadow_smooth" getter="get_shadow_smooth" default="0.0">
- Smoothing value for shadows.
+ Smoothing value for shadows. Higher values will result in softer shadows, at the cost of visible streaks that can appear in shadow rendering. [member shadow_filter_smooth] only has an effect if [member shadow_filter] is [constant SHADOW_FILTER_PCF5] or [constant SHADOW_FILTER_PCF13].
</member>
<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.
@@ -72,13 +73,13 @@
</members>
<constants>
<constant name="SHADOW_FILTER_NONE" value="0" enum="ShadowFilter">
- No filter applies to the shadow map. See [member shadow_filter].
+ No filter applies to the shadow map. This provides hard shadow edges and is the fastest to render. See [member shadow_filter].
</constant>
<constant name="SHADOW_FILTER_PCF5" value="1" enum="ShadowFilter">
- Percentage closer filtering (5 samples) applies to the shadow map. See [member shadow_filter].
+ Percentage closer filtering (5 samples) applies to the shadow map. This is slower compared to hard shadow rendering. See [member shadow_filter].
</constant>
<constant name="SHADOW_FILTER_PCF13" value="2" enum="ShadowFilter">
- Percentage closer filtering (13 samples) applies to the shadow map. See [member shadow_filter].
+ Percentage closer filtering (13 samples) applies to the shadow map. This is the slowest shadow filtereing mode, and should be used sparingly. 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.
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index 640fa9efec..4d3fb7ed5c 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -97,7 +97,7 @@
</description>
</method>
<method name="create_convex_shape" qualifiers="const">
- <return type="Shape3D" />
+ <return type="ConvexPolygonShape3D" />
<param index="0" name="clean" type="bool" default="true" />
<param index="1" name="simplify" type="bool" default="false" />
<description>
@@ -115,7 +115,7 @@
</description>
</method>
<method name="create_trimesh_shape" qualifiers="const">
- <return type="Shape3D" />
+ <return type="ConcavePolygonShape3D" />
<description>
Calculate a [ConcavePolygonShape3D] from the mesh.
</description>
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 0368f29a13..24df5977f9 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -384,8 +384,11 @@
<method name="get_path_to" qualifiers="const">
<return type="NodePath" />
<param index="0" name="node" type="Node" />
+ <param index="1" name="use_unique_path" type="bool" default="false" />
<description>
Returns the relative [NodePath] from this node to the specified [param node]. Both nodes must be in the same scene or the function will fail.
+ If [param use_unique_path] is [code]true[/code], returns the shortest path considering unique node.
+ [b]Note:[/b] If you get a relative path which starts from a unique node, the path may be longer than a normal relative path due to the addition of the unique node's name.
</description>
</method>
<method name="get_physics_process_delta_time" qualifiers="const">
diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml
index 054ab532af..26efe37dce 100644
--- a/doc/classes/Node2D.xml
+++ b/doc/classes/Node2D.xml
@@ -125,15 +125,5 @@
<member name="transform" type="Transform2D" setter="set_transform" getter="get_transform">
Local [Transform2D].
</member>
- <member name="y_sort_enabled" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false">
- If [code]true[/code], child nodes with the lowest Y position are drawn before those with a higher Y position. If [code]false[/code], Y-sorting is disabled. Y-sorting only affects children that inherit from [CanvasItem].
- You can nest nodes with Y-sorting. Child Y-sorted nodes are sorted in the same space as the parent Y-sort. This feature allows you to organize a scene better or divide it into multiple ones without changing your scene tree.
- </member>
- <member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative" default="true">
- If [code]true[/code], the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5.
- </member>
- <member name="z_index" type="int" setter="set_z_index" getter="get_z_index" default="0">
- Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive).
- </member>
</members>
</class>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index ea9b83d2aa..0efc6ab399 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -182,10 +182,12 @@
<method name="get_cmdline_user_args">
<return type="PackedStringArray" />
<description>
- Similar to [method get_cmdline_args], but this returns the user arguments (any argument passed after the double dash [code]--[/code] argument). These are left untouched by Godot for the user.
+ Similar to [method get_cmdline_args], but this returns the user arguments (any argument passed after the double dash [code]--[/code] or double plus [code]++[/code] argument). These are left untouched by Godot for the user. [code]++[/code] can be used in situations where [code]--[/code] is intercepted by another program (such as [code]startx[/code]).
For example, in the command line below, [code]--fullscreen[/code] will not be returned in [method get_cmdline_user_args] and [code]--level 1[/code] will only be returned in [method get_cmdline_user_args]:
[codeblock]
godot --fullscreen -- --level 1
+ # Or:
+ godot --fullscreen ++ --level 1
[/codeblock]
</description>
</method>
@@ -392,18 +394,38 @@
<method name="get_system_font_path" qualifiers="const">
<return type="String" />
<param index="0" name="font_name" type="String" />
- <param index="1" name="bold" type="bool" default="false" />
- <param index="2" name="italic" type="bool" default="false" />
+ <param index="1" name="weight" type="int" default="400" />
+ <param index="2" name="stretch" type="int" default="100" />
+ <param index="3" name="italic" type="bool" default="false" />
<description>
- Returns path to the system font file with [param font_name] and style. Return empty string if no matching fonts found.
- [b]Note:[/b] This method is implemented on iOS, Linux, macOS and Windows.
+ Returns path to the system font file with [param font_name] and style. Returns empty string if no matching fonts found.
+ The following aliases can be used to request default fonts: "sans-serif", "serif", "monospace", "cursive", and "fantasy".
+ [b]Note:[/b] Returned font might have different style if the requested style is not available.
+ [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
+ </description>
+ </method>
+ <method name="get_system_font_path_for_text" qualifiers="const">
+ <return type="PackedStringArray" />
+ <param index="0" name="font_name" type="String" />
+ <param index="1" name="text" type="String" />
+ <param index="2" name="locale" type="String" default="&quot;&quot;" />
+ <param index="3" name="script" type="String" default="&quot;&quot;" />
+ <param index="4" name="weight" type="int" default="400" />
+ <param index="5" name="stretch" type="int" default="100" />
+ <param index="6" name="italic" type="bool" default="false" />
+ <description>
+ Returns an array of the system substitute font file paths, which are similar to the font with [param font_name] and style for the specified text, locale and script. Returns empty array if no matching fonts found.
+ The following aliases can be used to request default fonts: "sans-serif", "serif", "monospace", "cursive", and "fantasy".
+ [b]Note:[/b] Depending on OS, it's not guaranteed that any of the returned fonts is suitable for rendering specified text. Fonts should be loaded and checked in the order they are returned, and the first suitable one used.
+ [b]Note:[/b] Returned fonts might have different style if the requested style is not available or belong to a different font family.
+ [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
</description>
</method>
<method name="get_system_fonts" qualifiers="const">
<return type="PackedStringArray" />
<description>
Returns list of font family names available.
- [b]Note:[/b] This method is implemented on iOS, Linux, macOS and Windows.
+ [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
</description>
</method>
<method name="get_thread_caller_id" qualifiers="const">
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index bf15f96291..5e834b3d91 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -764,6 +764,22 @@
Emits the [signal property_list_changed] signal. This is mainly used to refresh the editor, so that the Inspector and editor plugins are properly updated.
</description>
</method>
+ <method name="property_can_revert" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="property" type="StringName" />
+ <description>
+ Returns [code]true[/code] if the given [param property] has a custom default value. Use [method property_get_revert] to get the [param property]'s default value.
+ [b]Note:[/b] This method is used by the Inspector dock to display a revert icon. The object must implement [method _property_can_revert] to customize the default value. If [method _property_can_revert] is not implemented, this method returns [code]false[/code].
+ </description>
+ </method>
+ <method name="property_get_revert" qualifiers="const">
+ <return type="Variant" />
+ <param index="0" name="property" type="StringName" />
+ <description>
+ Returns the custom default value of the given [param property]. Use [method property_can_revert] to check if the [param property] has a custom default value.
+ [b]Note:[/b] This method is used by the Inspector dock to display a revert icon. The object must implement [method _property_get_revert] to customize the default value. If [method _property_get_revert] is not implemented, this method returns [code]null[/code].
+ </description>
+ </method>
<method name="remove_meta">
<return type="void" />
<param index="0" name="name" type="StringName" />
diff --git a/doc/classes/PointLight2D.xml b/doc/classes/PointLight2D.xml
index 89cabbd428..0c51a78e49 100644
--- a/doc/classes/PointLight2D.xml
+++ b/doc/classes/PointLight2D.xml
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PointLight2D" inherits="Light2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
+ Positional 2D light source.
</brief_description>
<description>
+ Casts light in a 2D environment. This light's shape is defined by a (usually grayscale) texture
</description>
<tutorials>
+ <link title="2D lights and shadows">$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html</link>
</tutorials>
<members>
<member name="height" type="float" setter="set_height" getter="get_height" default="0.0">
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index b6f92c2c40..1f0a8d91fa 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -2266,7 +2266,20 @@
Set the default Variable Rate Shading (VRS) mode for the main viewport. See [member Viewport.vrs_mode] to change this at runtime, and [enum Viewport.VRSMode] for possible values.
</member>
<member name="rendering/vrs/texture" type="String" setter="" getter="" default="&quot;&quot;">
- If [member rendering/vrs/mode] is set to texture, this is the path to default texture loaded as the VRS image.
+ If [member rendering/vrs/mode] is set to [b]Texture[/b], this is the path to default texture loaded as the VRS image.
+ The texture [i]must[/i] use a lossless compression format so that colors can be matched precisely. The following VRS densities are mapped to various colors, with brighter colors representing a lower level of shading precision:
+ [codeblock]
+ - 1x1 = rgb(0, 0, 0) - #000000
+ - 1x2 = rgb(0, 85, 0) - #005500
+ - 2x1 = rgb(85, 0, 0) - #550000
+ - 2x2 = rgb(85, 85, 0) - #555500
+ - 2x4 = rgb(85, 170, 0) - #55aa00
+ - 4x2 = rgb(170, 85, 0) - #aa5500
+ - 4x4 = rgb(170, 170, 0) - #aaaa00
+ - 4x8 = rgb(170, 255, 0) - #aaff00 - Not supported on most hardware
+ - 8x4 = rgb(255, 170, 0) - #ffaa00 - Not supported on most hardware
+ - 8x8 = rgb(255, 255, 0) - #ffff00 - Not supported on most hardware
+ [/codeblock]
</member>
<member name="threading/worker_pool/low_priority_thread_ratio" type="float" setter="" getter="" default="0.3">
</member>
diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml
index a6523e4c8b..2d40a7be57 100644
--- a/doc/classes/RID.xml
+++ b/doc/classes/RID.xml
@@ -4,7 +4,8 @@
Handle for a [Resource]'s unique ID.
</brief_description>
<description>
- The RID type is used to access the unique integer ID of a resource. They are opaque, which means they do not grant access to the associated resource by themselves. They are used by and with the low-level Server classes such as [RenderingServer].
+ The RID [Variant] type is used to access a low-level resource by its unique ID. RIDs are opaque, which means they do not grant access to the resource by themselves. They are used by the low-level server classes, such as [DisplayServer], [RenderingServer], [TextServer], etc.
+ A low-level resource may correspond to a high-level [Resource], such as [Texture] or [Mesh].
</description>
<tutorials>
</tutorials>
@@ -27,13 +28,13 @@
<method name="get_id" qualifiers="const">
<return type="int" />
<description>
- Returns the ID of the referenced resource.
+ Returns the ID of the referenced low-level resource.
</description>
</method>
<method name="is_valid" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if [RID] is valid.
+ Returns [code]true[/code] if the [RID] is not [code]0[/code].
</description>
</method>
</methods>
@@ -42,36 +43,42 @@
<return type="bool" />
<param index="0" name="right" type="RID" />
<description>
+ Returns [code]true[/code] if the [RID]s are not equal.
</description>
</operator>
<operator name="operator &lt;">
<return type="bool" />
<param index="0" name="right" type="RID" />
<description>
+ Returns [code]true[/code] if the [RID]'s ID is less than [param right]'s ID.
</description>
</operator>
<operator name="operator &lt;=">
<return type="bool" />
<param index="0" name="right" type="RID" />
<description>
+ Returns [code]true[/code] if the [RID]'s ID is less than or equal to [param right]'s ID.
</description>
</operator>
<operator name="operator ==">
<return type="bool" />
<param index="0" name="right" type="RID" />
<description>
+ Returns [code]true[/code] if both [RID]s are equal, which means they both refer to the same low-level resource.
</description>
</operator>
<operator name="operator &gt;">
<return type="bool" />
<param index="0" name="right" type="RID" />
<description>
+ Returns [code]true[/code] if the [RID]'s ID is greater than [param right]'s ID.
</description>
</operator>
<operator name="operator &gt;=">
<return type="bool" />
<param index="0" name="right" type="RID" />
<description>
+ Returns [code]true[/code] if the [RID]'s ID is greater than or equal to [param right]'s ID.
</description>
</operator>
</operators>
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index cb2481f705..e222894647 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -399,6 +399,12 @@
Scrolls the window's top line to match first line of the [param paragraph].
</description>
</method>
+ <method name="scroll_to_selection">
+ <return type="void" />
+ <description>
+ Scrolls to the beginning of the current selection.
+ </description>
+ </method>
<method name="select_all">
<return type="void" />
<description>
diff --git a/doc/classes/SystemFont.xml b/doc/classes/SystemFont.xml
index b47d6ded7d..20bfd0d8ae 100644
--- a/doc/classes/SystemFont.xml
+++ b/doc/classes/SystemFont.xml
@@ -7,23 +7,32 @@
<description>
[SystemFont] loads a font from a system font with the first matching name from [member font_names].
It will attempt to match font style, but it's not guaranteed.
- The returned font might be part of a font collection or be a variable font with OpenType "weight" and/or "italic" features set.
+ The returned font might be part of a font collection or be a variable font with OpenType "weight", "width" and/or "italic" features set.
You can create [FontVariation] of the system font for fine control over its features.
</description>
<tutorials>
</tutorials>
<members>
+ <member name="allow_system_fallback" type="bool" setter="set_allow_system_fallback" getter="is_allow_system_fallback" default="true">
+ If set to [code]true[/code], system fonts can be automatically used as fallbacks.
+ </member>
<member name="antialiasing" type="int" setter="set_antialiasing" getter="get_antialiasing" enum="TextServer.FontAntialiasing" default="1">
Font anti-aliasing mode.
</member>
<member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]">
Array of fallback [Font]s.
</member>
+ <member name="font_italic" type="bool" setter="set_font_italic" getter="get_font_italic" default="false">
+ If set to [code]true[/code], italic or oblique font is preferred.
+ </member>
<member name="font_names" type="PackedStringArray" setter="set_font_names" getter="get_font_names" default="PackedStringArray()">
Array of font family names to search, first matching font found is used.
</member>
- <member name="font_style" type="int" setter="set_font_style" getter="get_font_style" enum="TextServer.FontStyle" default="0">
- Font style flags, see [enum TextServer.FontStyle].
+ <member name="font_stretch" type="int" setter="set_font_stretch" getter="get_font_stretch" default="100">
+ Preferred font stretch amount, compared to a normal width. A percentage value between [code]50%[/code] and [code]200%[/code].
+ </member>
+ <member name="font_weight" type="int" setter="set_font_weight" getter="get_font_weight" default="400">
+ Preferred weight (boldness) of the font. A value in the [code]100...999[/code] range, normal font weight is [code]400[/code], bold font weight is [code]700[/code].
</member>
<member name="force_autohinter" type="bool" setter="set_force_autohinter" getter="is_force_autohinter" default="false">
If set to [code]true[/code], auto-hinting is supported and preferred over font built-in hinting.
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index f4d92ab9b6..b3e55b5cd0 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -362,6 +362,13 @@
Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size.
</description>
</method>
+ <method name="font_get_stretch" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="font_rid" type="RID" />
+ <description>
+ Returns font stretch amount, compared to a normal width. A percentage value between [code]50%[/code] and [code]200%[/code].
+ </description>
+ </method>
<method name="font_get_style" qualifiers="const">
<return type="int" enum="TextServer.FontStyle" />
<param index="0" name="font_rid" type="RID" />
@@ -446,6 +453,13 @@
Returns variation coordinates for the specified font cache entry. See [method font_supported_variation_list] for more info.
</description>
</method>
+ <method name="font_get_weight" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="font_rid" type="RID" />
+ <description>
+ Returns weight (boldness) of the font. A value in the [code]100...999[/code] range, normal font weight is [code]400[/code], bold font weight is [code]700[/code].
+ </description>
+ </method>
<method name="font_has_char" qualifiers="const">
<return type="bool" />
<param index="0" name="font_rid" type="RID" />
@@ -454,6 +468,13 @@
Returns [code]true[/code] if a Unicode [param char] is available in the font.
</description>
</method>
+ <method name="font_is_allow_system_fallback" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="font_rid" type="RID" />
+ <description>
+ Returns [code]true[/code] if system fonts can be automatically used as fallbacks.
+ </description>
+ </method>
<method name="font_is_force_autohinter" qualifiers="const">
<return type="bool" />
<param index="0" name="font_rid" type="RID" />
@@ -556,6 +577,14 @@
Renders the range of characters to the font cache texture.
</description>
</method>
+ <method name="font_set_allow_system_fallback">
+ <return type="void" />
+ <param index="0" name="font_rid" type="RID" />
+ <param index="1" name="allow_system_fallback" type="bool" />
+ <description>
+ If set to [code]true[/code], system fonts can be automatically used as fallbacks.
+ </description>
+ </method>
<method name="font_set_antialiasing">
<return type="void" />
<param index="0" name="font_rid" type="RID" />
@@ -783,12 +812,22 @@
Adds override for [method font_is_script_supported].
</description>
</method>
+ <method name="font_set_stretch">
+ <return type="void" />
+ <param index="0" name="font_rid" type="RID" />
+ <param index="1" name="weight" type="int" />
+ <description>
+ Sets font stretch amount, compared to a normal width. A percentage value between [code]50%[/code] and [code]200%[/code].
+ [b]Note:[/b] This value is used for font matching only and will not affect font rendering. Use [method font_set_face_index], [method font_set_variation_coordinates], or [method font_set_transform] instead.
+ </description>
+ </method>
<method name="font_set_style">
<return type="void" />
<param index="0" name="font_rid" type="RID" />
<param index="1" name="style" type="int" enum="TextServer.FontStyle" />
<description>
Sets the font style flags, see [enum FontStyle].
+ [b]Note:[/b] This value is used for font matching only and will not affect font rendering. Use [method font_set_face_index], [method font_set_variation_coordinates], [method font_set_embolden], or [method font_set_transform] instead.
</description>
</method>
<method name="font_set_style_name">
@@ -862,6 +901,15 @@
Sets variation coordinates for the specified font cache entry. See [method font_supported_variation_list] for more info.
</description>
</method>
+ <method name="font_set_weight">
+ <return type="void" />
+ <param index="0" name="font_rid" type="RID" />
+ <param index="1" name="weight" type="int" />
+ <description>
+ Sets weight (boldness) of the font. A value in the [code]100...999[/code] range, normal font weight is [code]400[/code], bold font weight is [code]700[/code].
+ [b]Note:[/b] This value is used for font matching only and will not affect font rendering. Use [method font_set_face_index], [method font_set_variation_coordinates], or [method font_set_embolden] instead.
+ </description>
+ </method>
<method name="font_supported_feature_list" qualifiers="const">
<return type="Dictionary" />
<param index="0" name="font_rid" type="RID" />
diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml
index 37d2698dd4..4c9817fcd4 100644
--- a/doc/classes/TextServerExtension.xml
+++ b/doc/classes/TextServerExtension.xml
@@ -9,6 +9,11 @@
<tutorials>
</tutorials>
<methods>
+ <method name="_cleanup" qualifiers="virtual">
+ <return type="void" />
+ <description>
+ </description>
+ </method>
<method name="_create_font" qualifiers="virtual">
<return type="RID" />
<description>
@@ -306,6 +311,12 @@
<description>
</description>
</method>
+ <method name="_font_get_stretch" qualifiers="virtual const">
+ <return type="int" />
+ <param index="0" name="font_rid" type="RID" />
+ <description>
+ </description>
+ </method>
<method name="_font_get_style" qualifiers="virtual const">
<return type="int" enum="TextServer.FontStyle" />
<param index="0" name="font_rid" type="RID" />
@@ -379,6 +390,12 @@
<description>
</description>
</method>
+ <method name="_font_get_weight" qualifiers="virtual const">
+ <return type="int" />
+ <param index="0" name="font_rid" type="RID" />
+ <description>
+ </description>
+ </method>
<method name="_font_has_char" qualifiers="virtual const">
<return type="bool" />
<param index="0" name="font_rid" type="RID" />
@@ -386,6 +403,12 @@
<description>
</description>
</method>
+ <method name="_font_is_allow_system_fallback" qualifiers="virtual const">
+ <return type="bool" />
+ <param index="0" name="font_rid" type="RID" />
+ <description>
+ </description>
+ </method>
<method name="_font_is_force_autohinter" qualifiers="virtual const">
<return type="bool" />
<param index="0" name="font_rid" type="RID" />
@@ -474,6 +497,13 @@
<description>
</description>
</method>
+ <method name="_font_set_allow_system_fallback" qualifiers="virtual">
+ <return type="void" />
+ <param index="0" name="font_rid" type="RID" />
+ <param index="1" name="allow_system_fallback" type="bool" />
+ <description>
+ </description>
+ </method>
<method name="_font_set_antialiasing" qualifiers="virtual">
<return type="void" />
<param index="0" name="font_rid" type="RID" />
@@ -680,6 +710,13 @@
<description>
</description>
</method>
+ <method name="_font_set_stretch" qualifiers="virtual">
+ <return type="void" />
+ <param index="0" name="font_rid" type="RID" />
+ <param index="1" name="stretch" type="int" />
+ <description>
+ </description>
+ </method>
<method name="_font_set_style" qualifiers="virtual">
<return type="void" />
<param index="0" name="font_rid" type="RID" />
@@ -749,6 +786,13 @@
<description>
</description>
</method>
+ <method name="_font_set_weight" qualifiers="virtual">
+ <return type="void" />
+ <param index="0" name="font_rid" type="RID" />
+ <param index="1" name="weight" type="int" />
+ <description>
+ </description>
+ </method>
<method name="_font_supported_feature_list" qualifiers="virtual const">
<return type="Dictionary" />
<param index="0" name="font_rid" type="RID" />
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 4156030d77..1cd73688ee 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -93,7 +93,7 @@
<param index="2" name="end" type="Vector2" />
<param index="3" name="t" type="float" />
<description>
- Returns the derivative at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points.
+ Returns the derivative at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bézier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points.
</description>
</method>
<method name="bezier_interpolate" qualifiers="const">
@@ -103,7 +103,7 @@
<param index="2" name="end" type="Vector2" />
<param index="3" name="t" type="float" />
<description>
- Returns the point at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points.
+ Returns the point at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bézier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points.
</description>
</method>
<method name="bounce" qualifiers="const">
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index 2896408505..1d7eda6bb9 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -69,7 +69,7 @@
<param index="2" name="end" type="Vector3" />
<param index="3" name="t" type="float" />
<description>
- Returns the derivative at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points.
+ Returns the derivative at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bézier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points.
</description>
</method>
<method name="bezier_interpolate" qualifiers="const">
@@ -79,7 +79,7 @@
<param index="2" name="end" type="Vector3" />
<param index="3" name="t" type="float" />
<description>
- Returns the point at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points.
+ Returns the point at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bézier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points.
</description>
</method>
<method name="bounce" qualifiers="const">
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 78013a8f4b..236d34383f 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -343,6 +343,19 @@
</member>
<member name="vrs_texture" type="Texture2D" setter="set_vrs_texture" getter="get_vrs_texture">
Texture to use when [member vrs_mode] is set to [constant Viewport.VRS_TEXTURE].
+ The texture [i]must[/i] use a lossless compression format so that colors can be matched precisely. The following VRS densities are mapped to various colors, with brighter colors representing a lower level of shading precision:
+ [codeblock]
+ - 1x1 = rgb(0, 0, 0) - #000000
+ - 1x2 = rgb(0, 85, 0) - #005500
+ - 2x1 = rgb(85, 0, 0) - #550000
+ - 2x2 = rgb(85, 85, 0) - #555500
+ - 2x4 = rgb(85, 170, 0) - #55aa00
+ - 4x2 = rgb(170, 85, 0) - #aa5500
+ - 4x4 = rgb(170, 170, 0) - #aaaa00
+ - 4x8 = rgb(170, 255, 0) - #aaff00 - Not supported on most hardware
+ - 8x4 = rgb(255, 170, 0) - #ffaa00 - Not supported on most hardware
+ - 8x8 = rgb(255, 255, 0) - #ffff00 - Not supported on most hardware
+ [/codeblock]
</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.