summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/@GlobalScope.xml23
-rw-r--r--doc/classes/AStar.xml4
-rw-r--r--doc/classes/AStar2D.xml4
-rw-r--r--doc/classes/AnimationNode.xml22
-rw-r--r--doc/classes/Area3D.xml9
-rw-r--r--doc/classes/Array.xml10
-rw-r--r--doc/classes/ArrayMesh.xml1
-rw-r--r--doc/classes/AudioStream.xml15
-rw-r--r--doc/classes/AudioStreamPlayback.xml40
-rw-r--r--doc/classes/BaseMaterial3D.xml2
-rw-r--r--doc/classes/CPUParticles2D.xml148
-rw-r--r--doc/classes/CPUParticles3D.xml183
-rw-r--r--doc/classes/CanvasItem.xml14
-rw-r--r--doc/classes/CanvasItemMaterial.xml2
-rw-r--r--doc/classes/CharacterBody2D.xml13
-rw-r--r--doc/classes/CodeEdit.xml4
-rw-r--r--doc/classes/CollisionObject2D.xml2
-rw-r--r--doc/classes/CollisionObject3D.xml2
-rw-r--r--doc/classes/ColorPicker.xml2
-rw-r--r--doc/classes/ConfigFile.xml2
-rw-r--r--doc/classes/Control.xml22
-rw-r--r--doc/classes/DirectionalLight3D.xml2
-rw-r--r--doc/classes/DisplayServer.xml2
-rw-r--r--doc/classes/EditorImportPlugin.xml32
-rw-r--r--doc/classes/EditorInspectorPlugin.xml20
-rw-r--r--doc/classes/EditorNode3DGizmo.xml20
-rw-r--r--doc/classes/EditorNode3DGizmoPlugin.xml54
-rw-r--r--doc/classes/EditorPlugin.xml110
-rw-r--r--doc/classes/EditorProperty.xml5
-rw-r--r--doc/classes/EditorResourceConversionPlugin.xml10
-rw-r--r--doc/classes/EditorResourcePreviewGenerator.xml16
-rw-r--r--doc/classes/EditorSceneImporter.xml8
-rw-r--r--doc/classes/EditorSceneImporterMesh.xml45
-rw-r--r--doc/classes/EditorScenePostImport.xml2
-rw-r--r--doc/classes/EditorSyntaxHighlighter.xml12
-rw-r--r--doc/classes/EditorTranslationParserPlugin.xml4
-rw-r--r--doc/classes/Engine.xml22
-rw-r--r--doc/classes/File.xml2
-rw-r--r--doc/classes/Font.xml40
-rw-r--r--doc/classes/FontData.xml587
-rw-r--r--doc/classes/GradientTexture.xml3
-rw-r--r--doc/classes/GraphEdit.xml16
-rw-r--r--doc/classes/HTTPClient.xml4
-rw-r--r--doc/classes/Image.xml1
-rw-r--r--doc/classes/InputEventShortcut.xml (renamed from doc/classes/TextFile.xml)6
-rw-r--r--doc/classes/ItemList.xml3
-rw-r--r--doc/classes/Light3D.xml4
-rw-r--r--doc/classes/Line2D.xml1
-rw-r--r--doc/classes/MultiplayerAPI.xml104
-rw-r--r--doc/classes/MultiplayerReplicator.xml191
-rw-r--r--doc/classes/NativeExtensionManager.xml6
-rw-r--r--doc/classes/Node.xml62
-rw-r--r--doc/classes/Object.xml8
-rw-r--r--doc/classes/ParticlesMaterial.xml160
-rw-r--r--doc/classes/PhysicsServer2D.xml25
-rw-r--r--doc/classes/PhysicsServer3D.xml41
-rw-r--r--doc/classes/ProjectSettings.xml3
-rw-r--r--doc/classes/RandomNumberGenerator.xml2
-rw-r--r--doc/classes/RenderingServer.xml18
-rw-r--r--doc/classes/Resource.xml12
-rw-r--r--doc/classes/ResourceFormatLoader.xml32
-rw-r--r--doc/classes/ResourceFormatSaver.xml4
-rw-r--r--doc/classes/RichTextEffect.xml2
-rw-r--r--doc/classes/RichTextLabel.xml2
-rw-r--r--doc/classes/ScriptEditorBase.xml7
-rw-r--r--doc/classes/SeparationRayShape2D.xml24
-rw-r--r--doc/classes/SeparationRayShape3D.xml24
-rw-r--r--doc/classes/Skeleton2D.xml1
-rw-r--r--doc/classes/SkeletonModification3DJiggle.xml8
-rw-r--r--doc/classes/String.xml37
-rw-r--r--doc/classes/SyntaxHighlighter.xml2
-rw-r--r--doc/classes/TextEdit.xml2
-rw-r--r--doc/classes/TextParagraph.xml4
-rw-r--r--doc/classes/TextServer.xml651
-rw-r--r--doc/classes/Tree.xml3
-rw-r--r--doc/classes/TreeItem.xml35
-rw-r--r--doc/classes/Viewport.xml45
-rw-r--r--doc/classes/VisualScriptCustomNodes.xml39
-rw-r--r--doc/classes/VisualShaderNodeCustom.xml34
-rw-r--r--doc/classes/XRInterface.xml33
-rw-r--r--doc/classes/XRInterfaceExtension.xml126
-rw-r--r--doc/classes/XRServer.xml7
-rw-r--r--doc/classes/float.xml8
-rw-r--r--doc/classes/int.xml2
84 files changed, 2317 insertions, 1002 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index d4680d1836..585b94a522 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -711,6 +711,19 @@
<description>
</description>
</method>
+ <method name="rid_allocate_id">
+ <return type="int" />
+ <description>
+ Allocate a unique ID which can be used by the implementation to construct a RID. This is used mainly from native extensions to implement servers.
+ </description>
+ </method>
+ <method name="rid_from_int64">
+ <return type="RID" />
+ <argument index="0" name="base" type="int" />
+ <description>
+ Create a RID from an int64. This is used mainly from native extensions to build servers.
+ </description>
+ </method>
<method name="round">
<return type="float" />
<argument index="0" name="x" type="float" />
@@ -1072,8 +1085,8 @@
<member name="TranslationServer" type="TranslationServer" setter="" getter="">
The [TranslationServer] singleton.
</member>
- <member name="VisualScriptEditor" type="VisualScriptEditor" setter="" getter="">
- The [VisualScriptEditor] singleton.
+ <member name="VisualScriptEditor" type="VisualScriptCustomNodes" setter="" getter="">
+ The [VisualScriptCustomNodes] singleton.
</member>
<member name="XRServer" type="XRServer" setter="" getter="">
The [XRServer] singleton.
@@ -2351,9 +2364,11 @@
</constant>
<constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="38" enum="PropertyHint">
</constant>
+ <constant name="PROPERTY_HINT_INT_IS_POINTER" value="40" enum="PropertyHint">
+ </constant>
<constant name="PROPERTY_HINT_ARRAY_TYPE" value="39" enum="PropertyHint">
</constant>
- <constant name="PROPERTY_HINT_MAX" value="40" enum="PropertyHint">
+ <constant name="PROPERTY_HINT_MAX" value="41" enum="PropertyHint">
</constant>
<constant name="PROPERTY_USAGE_NONE" value="0" enum="PropertyUsageFlags">
</constant>
@@ -2458,6 +2473,8 @@
</constant>
<constant name="METHOD_FLAG_STATIC" value="256" enum="MethodFlags">
</constant>
+ <constant name="METHOD_FLAG_OBJECT_CORE" value="512" enum="MethodFlags">
+ </constant>
<constant name="METHOD_FLAGS_DEFAULT" value="1" enum="MethodFlags">
Default method flags.
</constant>
diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml
index 63dd250dbc..3e91184a65 100644
--- a/doc/classes/AStar.xml
+++ b/doc/classes/AStar.xml
@@ -38,7 +38,7 @@
<tutorials>
</tutorials>
<methods>
- <method name="_compute_cost" qualifiers="virtual">
+ <method name="_compute_cost" qualifiers="virtual const">
<return type="float" />
<argument index="0" name="from_id" type="int" />
<argument index="1" name="to_id" type="int" />
@@ -47,7 +47,7 @@
Note that this function is hidden in the default [code]AStar[/code] class.
</description>
</method>
- <method name="_estimate_cost" qualifiers="virtual">
+ <method name="_estimate_cost" qualifiers="virtual const">
<return type="float" />
<argument index="0" name="from_id" type="int" />
<argument index="1" name="to_id" type="int" />
diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml
index 31d695b051..453e8b6315 100644
--- a/doc/classes/AStar2D.xml
+++ b/doc/classes/AStar2D.xml
@@ -9,7 +9,7 @@
<tutorials>
</tutorials>
<methods>
- <method name="_compute_cost" qualifiers="virtual">
+ <method name="_compute_cost" qualifiers="virtual const">
<return type="float" />
<argument index="0" name="from_id" type="int" />
<argument index="1" name="to_id" type="int" />
@@ -18,7 +18,7 @@
Note that this function is hidden in the default [code]AStar2D[/code] class.
</description>
</method>
- <method name="_estimate_cost" qualifiers="virtual">
+ <method name="_estimate_cost" qualifiers="virtual const">
<return type="float" />
<argument index="0" name="from_id" type="int" />
<argument index="1" name="to_id" type="int" />
diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml
index a9a08efcf1..173ff43d2a 100644
--- a/doc/classes/AnimationNode.xml
+++ b/doc/classes/AnimationNode.xml
@@ -11,46 +11,46 @@
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
</tutorials>
<methods>
- <method name="_get_caption" qualifiers="virtual">
+ <method name="_get_caption" qualifiers="virtual const">
<return type="String" />
<description>
Gets the text caption for this node (used by some editors).
</description>
</method>
- <method name="_get_child_by_name" qualifiers="virtual">
- <return type="Object" />
- <argument index="0" name="name" type="String" />
+ <method name="_get_child_by_name" qualifiers="virtual const">
+ <return type="AnimationNode" />
+ <argument index="0" name="name" type="StringName" />
<description>
Gets a child node by index (used by editors inheriting from [AnimationRootNode]).
</description>
</method>
- <method name="_get_child_nodes" qualifiers="virtual">
+ <method name="_get_child_nodes" qualifiers="virtual const">
<return type="Dictionary" />
<description>
Gets all children nodes in order as a [code]name: node[/code] dictionary. Only useful when inheriting [AnimationRootNode].
</description>
</method>
- <method name="_get_parameter_default_value" qualifiers="virtual">
+ <method name="_get_parameter_default_value" qualifiers="virtual const">
<return type="Variant" />
- <argument index="0" name="name" type="StringName" />
+ <argument index="0" name="parameter" type="StringName" />
<description>
Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
</description>
</method>
- <method name="_get_parameter_list" qualifiers="virtual">
+ <method name="_get_parameter_list" qualifiers="virtual const">
<return type="Array" />
<description>
Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list].
</description>
</method>
- <method name="_has_filter" qualifiers="virtual">
+ <method name="_has_filter" qualifiers="virtual const">
<return type="bool" />
<description>
Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node.
</description>
</method>
- <method name="_process" qualifiers="virtual">
- <return type="void" />
+ <method name="_process" qualifiers="virtual const">
+ <return type="float" />
<argument index="0" name="time" type="float" />
<argument index="1" name="seek" type="bool" />
<description>
diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml
index 2180196bb5..e91cfd79a1 100644
--- a/doc/classes/Area3D.xml
+++ b/doc/classes/Area3D.xml
@@ -92,6 +92,15 @@
<member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area3D.SpaceOverride" default="0">
Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values.
</member>
+ <member name="wind_attenuation_factor" type="float" setter="set_wind_attenuation_factor" getter="get_wind_attenuation_factor" default="0.0">
+ The exponential rate at which wind force decreases with distance from its origin.
+ </member>
+ <member name="wind_force_magnitude" type="float" setter="set_wind_force_magnitude" getter="get_wind_force_magnitude" default="0.0">
+ The magnitude of area-specific wind force.
+ </member>
+ <member name="wind_source_path" type="NodePath" setter="set_wind_source_path" getter="get_wind_source_path" default="NodePath(&quot;&quot;)">
+ The [Node3D] which is used to specify the the direction and origin of an area-specific wind force. The direction is opposite to the z-axis of the [Node3D]'s local transform, and its origin is the origin of the [Node3D]'s local transform.
+ </member>
</members>
<signals>
<signal name="area_entered">
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index 7767a1028d..396490c8eb 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -302,7 +302,7 @@
</description>
</method>
<method name="insert">
- <return type="void" />
+ <return type="int" />
<argument index="0" name="position" type="int" />
<argument index="1" name="value" type="Variant" />
<description>
@@ -393,6 +393,14 @@
<description>
</description>
</method>
+ <method name="pop_at">
+ <return type="Variant" />
+ <argument index="0" name="position" type="int" />
+ <description>
+ Removes and returns the element of the array at index [code]position[/code]. If negative, [code]position[/code] is considered relative to the end of the array. Leaves the array untouched and returns [code]null[/code] if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty.
+ [b]Note:[/b] On large arrays, this method can be slower than [method pop_back] as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower [method pop_at] will be.
+ </description>
+ </method>
<method name="pop_back">
<return type="Variant" />
<description>
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index 637b9a9f16..670a25ab83 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -115,6 +115,7 @@
<argument index="0" name="index" type="int" />
<argument index="1" name="name" type="StringName" />
<description>
+ Sets the name of the blend shape at this index.
</description>
</method>
<method name="surface_find_by_name" qualifiers="const">
diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml
index 8a58b178d8..a954a06117 100644
--- a/doc/classes/AudioStream.xml
+++ b/doc/classes/AudioStream.xml
@@ -13,6 +13,21 @@
<link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
</tutorials>
<methods>
+ <method name="_get_length" qualifiers="virtual const">
+ <return type="float" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_stream_name" qualifiers="virtual const">
+ <return type="String" />
+ <description>
+ </description>
+ </method>
+ <method name="_instance_playback" qualifiers="virtual const">
+ <return type="AudioStreamPlayback" />
+ <description>
+ </description>
+ </method>
<method name="get_length" qualifiers="const">
<return type="float" />
<description>
diff --git a/doc/classes/AudioStreamPlayback.xml b/doc/classes/AudioStreamPlayback.xml
index cb01aa75e8..25f3e076b4 100644
--- a/doc/classes/AudioStreamPlayback.xml
+++ b/doc/classes/AudioStreamPlayback.xml
@@ -10,6 +10,46 @@
<link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
</tutorials>
<methods>
+ <method name="_get_loop_count" qualifiers="virtual const">
+ <return type="int" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_playback_position" qualifiers="virtual const">
+ <return type="float" />
+ <description>
+ </description>
+ </method>
+ <method name="_is_playing" qualifiers="virtual const">
+ <return type="bool" />
+ <description>
+ </description>
+ </method>
+ <method name="_mix" qualifiers="virtual">
+ <return type="int" />
+ <argument index="0" name="buffer" type="AudioFrame*" />
+ <argument index="1" name="rate_scale" type="float" />
+ <argument index="2" name="frames" type="int" />
+ <description>
+ </description>
+ </method>
+ <method name="_seek" qualifiers="virtual">
+ <return type="void" />
+ <argument index="0" name="position" type="float" />
+ <description>
+ </description>
+ </method>
+ <method name="_start" qualifiers="virtual">
+ <return type="void" />
+ <argument index="0" name="from_pos" type="float" />
+ <description>
+ </description>
+ </method>
+ <method name="_stop" qualifiers="virtual">
+ <return type="void" />
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml
index bbf7c5eb6d..a5516636aa 100644
--- a/doc/classes/BaseMaterial3D.xml
+++ b/doc/classes/BaseMaterial3D.xml
@@ -683,7 +683,7 @@
</constant>
<constant name="BILLBOARD_PARTICLES" value="3" enum="BillboardMode">
Used for particle systems when assigned to [GPUParticles3D] and [CPUParticles3D] nodes. Enables [code]particles_anim_*[/code] properties.
- The [member ParticlesMaterial.anim_speed] or [member CPUParticles3D.anim_speed] should also be set to a positive value for the animation to play.
+ The [member ParticlesMaterial.anim_speed_min] or [member CPUParticles3D.anim_speed_min] should also be set to a value bigger than zero for the animation to play.
</constant>
<constant name="TEXTURE_CHANNEL_RED" value="0" enum="TextureChannel">
Used to read from the red channel of a texture.
diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml
index ab6897ca1d..9226140c1a 100644
--- a/doc/classes/CPUParticles2D.xml
+++ b/doc/classes/CPUParticles2D.xml
@@ -18,25 +18,23 @@
Sets this node's properties to match a given [GPUParticles2D] node with an assigned [ParticlesMaterial].
</description>
</method>
- <method name="get_param" qualifiers="const">
- <return type="float" />
+ <method name="get_param_curve" qualifiers="const">
+ <return type="Curve" />
<argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter" />
<description>
- Returns the base value of the parameter specified by [enum Parameter].
+ Returns the [Curve] of the parameter specified by [enum Parameter].
</description>
</method>
- <method name="get_param_curve" qualifiers="const">
- <return type="Curve" />
+ <method name="get_param_max" qualifiers="const">
+ <return type="float" />
<argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter" />
<description>
- Returns the [Curve] of the parameter specified by [enum Parameter].
</description>
</method>
- <method name="get_param_randomness" qualifiers="const">
+ <method name="get_param_min" qualifiers="const">
<return type="float" />
<argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter" />
<description>
- Returns the randomness factor of the parameter specified by [enum Parameter].
</description>
</method>
<method name="get_particle_flag" qualifiers="const">
@@ -52,28 +50,26 @@
Restarts the particle emitter.
</description>
</method>
- <method name="set_param">
+ <method name="set_param_curve">
<return type="void" />
<argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter" />
- <argument index="1" name="value" type="float" />
+ <argument index="1" name="curve" type="Curve" />
<description>
- Sets the base value of the parameter specified by [enum Parameter].
+ Sets the [Curve] of the parameter specified by [enum Parameter].
</description>
</method>
- <method name="set_param_curve">
+ <method name="set_param_max">
<return type="void" />
<argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter" />
- <argument index="1" name="curve" type="Curve" />
+ <argument index="1" name="value" type="float" />
<description>
- Sets the [Curve] of the parameter specified by [enum Parameter].
</description>
</method>
- <method name="set_param_randomness">
+ <method name="set_param_min">
<return type="void" />
<argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter" />
- <argument index="1" name="randomness" type="float" />
+ <argument index="1" name="value" type="float" />
<description>
- Sets the randomness factor of the parameter specified by [enum Parameter].
</description>
</method>
<method name="set_particle_flag">
@@ -89,41 +85,33 @@
<member name="amount" type="int" setter="set_amount" getter="get_amount" default="8">
Number of particles emitted in one emission cycle.
</member>
- <member name="angle" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial rotation applied to each particle, in degrees.
- </member>
<member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's rotation will be animated along this [Curve].
</member>
- <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Rotation randomness ratio.
+ <member name="angle_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
</member>
- <member name="angular_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.
+ <member name="angle_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's angular velocity will vary along this [Curve].
</member>
- <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Angular velocity randomness ratio.
+ <member name="angular_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
</member>
- <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0">
- Particle animation offset.
+ <member name="angular_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's animation offset will vary along this [Curve].
</member>
- <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Animation offset randomness ratio.
+ <member name="anim_offset_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
</member>
- <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0">
- Particle animation speed.
+ <member name="anim_offset_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's animation speed will vary along this [Curve].
</member>
- <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Animation speed randomness ratio.
+ <member name="anim_speed_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ </member>
+ <member name="anim_speed_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)">
Each particle's initial color. If [member texture] is defined, it will be multiplied by this color.
@@ -131,14 +119,12 @@
<member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp">
Each particle's color will vary along this [Gradient] (multiplied with [member color]).
</member>
- <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0">
- The rate at which particles lose velocity.
- </member>
<member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Damping will vary along this [Curve].
</member>
- <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Damping randomness ratio.
+ <member name="damping_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ </member>
+ <member name="damping_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="direction" type="Vector2" setter="set_direction" getter="get_direction" default="Vector2(1, 0)">
Unit vector specifying the particles' emission direction.
@@ -179,20 +165,16 @@
<member name="gravity" type="Vector2" setter="set_gravity" getter="get_gravity" default="Vector2(0, 980)">
Gravity applied to every particle.
</member>
- <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial hue variation applied to each particle.
- </member>
<member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's hue will vary along this [Curve].
</member>
- <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Hue variation randomness ratio.
+ <member name="hue_variation_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ </member>
+ <member name="hue_variation_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
- <member name="initial_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial velocity magnitude for each particle. Direction comes from [member spread] and the node's orientation.
+ <member name="initial_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
</member>
- <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Initial velocity randomness ratio.
+ <member name="initial_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0">
Amount of time each particle will exist.
@@ -200,14 +182,12 @@
<member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0">
Particle lifetime randomness ratio.
</member>
- <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0">
- Linear acceleration applied to each particle in the direction of motion.
- </member>
<member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's linear acceleration will vary along this [Curve].
</member>
- <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Linear acceleration randomness ratio.
+ <member name="linear_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ </member>
+ <member name="linear_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
@@ -215,14 +195,12 @@
<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end.
</member>
- <member name="orbit_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
- Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.
- </member>
<member name="orbit_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's orbital velocity will vary along this [Curve].
</member>
- <member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Orbital velocity randomness ratio.
+ <member name="orbit_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ </member>
+ <member name="orbit_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="particle_flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
Align Y axis of particle with the direction of its velocity.
@@ -230,41 +208,41 @@
<member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0">
Particle system starts as if it had already run for this many seconds.
</member>
- <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0">
- Radial acceleration applied to each particle. Makes particle accelerate away from origin.
- </member>
<member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's radial acceleration will vary along this [Curve].
</member>
- <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Radial acceleration randomness ratio.
+ <member name="radial_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ </member>
+ <member name="radial_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" default="0.0">
Emission lifetime randomness ratio.
</member>
- <member name="scale_amount" type="float" setter="set_param" getter="get_param" default="1.0">
- Initial scale applied to each particle.
- </member>
<member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's scale will vary along this [Curve].
</member>
- <member name="scale_amount_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Scale randomness ratio.
+ <member name="scale_amount_max" type="float" setter="set_param_max" getter="get_param_max" default="1.0">
+ </member>
+ <member name="scale_amount_min" type="float" setter="set_param_min" getter="get_param_min" default="1.0">
+ </member>
+ <member name="scale_curve_x" type="Curve" setter="set_scale_curve_x" getter="get_scale_curve_x">
+ </member>
+ <member name="scale_curve_y" type="Curve" setter="set_scale_curve_y" getter="get_scale_curve_y">
</member>
<member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
Particle system's running speed scaling ratio. A value of [code]0[/code] can be used to pause the particles.
</member>
+ <member name="split_scale" type="bool" setter="set_split_scale" getter="get_split_scale" default="false">
+ </member>
<member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0">
Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees.
</member>
- <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0">
- Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
- </member>
<member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's tangential acceleration will vary along this [Curve].
</member>
- <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Tangential acceleration randomness ratio.
+ <member name="tangential_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ </member>
+ <member name="tangential_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
Particle texture. If [code]null[/code], particles will be squares.
@@ -278,40 +256,40 @@
Particles are drawn in order of remaining lifetime.
</constant>
<constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set initial velocity properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set initial velocity properties.
</constant>
<constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angular velocity properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angular velocity properties.
</constant>
<constant name="PARAM_ORBIT_VELOCITY" value="2" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set orbital velocity properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set orbital velocity properties.
</constant>
<constant name="PARAM_LINEAR_ACCEL" value="3" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set linear acceleration properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set linear acceleration properties.
</constant>
<constant name="PARAM_RADIAL_ACCEL" value="4" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set radial acceleration properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set radial acceleration properties.
</constant>
<constant name="PARAM_TANGENTIAL_ACCEL" value="5" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set tangential acceleration properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set tangential acceleration properties.
</constant>
<constant name="PARAM_DAMPING" value="6" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set damping properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set damping properties.
</constant>
<constant name="PARAM_ANGLE" value="7" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angle properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angle properties.
</constant>
<constant name="PARAM_SCALE" value="8" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set scale properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set scale properties.
</constant>
<constant name="PARAM_HUE_VARIATION" value="9" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set hue variation properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set hue variation properties.
</constant>
<constant name="PARAM_ANIM_SPEED" value="10" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation speed properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation speed properties.
</constant>
<constant name="PARAM_ANIM_OFFSET" value="11" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation offset properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation offset properties.
</constant>
<constant name="PARAM_MAX" value="12" enum="Parameter">
Represents the size of the [enum Parameter] enum.
diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml
index 8aa3573996..fe8c354427 100644
--- a/doc/classes/CPUParticles3D.xml
+++ b/doc/classes/CPUParticles3D.xml
@@ -17,25 +17,23 @@
Sets this node's properties to match a given [GPUParticles3D] node with an assigned [ParticlesMaterial].
</description>
</method>
- <method name="get_param" qualifiers="const">
- <return type="float" />
+ <method name="get_param_curve" qualifiers="const">
+ <return type="Curve" />
<argument index="0" name="param" type="int" enum="CPUParticles3D.Parameter" />
<description>
- Returns the base value of the parameter specified by [enum Parameter].
+ Returns the [Curve] of the parameter specified by [enum Parameter].
</description>
</method>
- <method name="get_param_curve" qualifiers="const">
- <return type="Curve" />
+ <method name="get_param_max" qualifiers="const">
+ <return type="float" />
<argument index="0" name="param" type="int" enum="CPUParticles3D.Parameter" />
<description>
- Returns the [Curve] of the parameter specified by [enum Parameter].
</description>
</method>
- <method name="get_param_randomness" qualifiers="const">
+ <method name="get_param_min" qualifiers="const">
<return type="float" />
<argument index="0" name="param" type="int" enum="CPUParticles3D.Parameter" />
<description>
- Returns the randomness factor of the parameter specified by [enum Parameter].
</description>
</method>
<method name="get_particle_flag" qualifiers="const">
@@ -51,28 +49,28 @@
Restarts the particle emitter.
</description>
</method>
- <method name="set_param">
+ <method name="set_param_curve">
<return type="void" />
<argument index="0" name="param" type="int" enum="CPUParticles3D.Parameter" />
- <argument index="1" name="value" type="float" />
+ <argument index="1" name="curve" type="Curve" />
<description>
- Sets the base value of the parameter specified by [enum Parameter].
+ Sets the [Curve] of the parameter specified by [enum Parameter].
</description>
</method>
- <method name="set_param_curve">
+ <method name="set_param_max">
<return type="void" />
<argument index="0" name="param" type="int" enum="CPUParticles3D.Parameter" />
- <argument index="1" name="curve" type="Curve" />
+ <argument index="1" name="value" type="float" />
<description>
- Sets the [Curve] of the parameter specified by [enum Parameter].
+ Sets the maximum value for the given parameter
</description>
</method>
- <method name="set_param_randomness">
+ <method name="set_param_min">
<return type="void" />
<argument index="0" name="param" type="int" enum="CPUParticles3D.Parameter" />
- <argument index="1" name="randomness" type="float" />
+ <argument index="1" name="value" type="float" />
<description>
- Sets the randomness factor of the parameter specified by [enum Parameter].
+ Sets the minimum value for the given parameter
</description>
</method>
<method name="set_particle_flag">
@@ -88,41 +86,41 @@
<member name="amount" type="int" setter="set_amount" getter="get_amount" default="8">
Number of particles emitted in one emission cycle.
</member>
- <member name="angle" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial rotation applied to each particle, in degrees.
- </member>
<member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's rotation will be animated along this [Curve].
</member>
- <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Rotation randomness ratio.
+ <member name="angle_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum angle.
</member>
- <member name="angular_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.
+ <member name="angle_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum angle.
</member>
<member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's angular velocity will vary along this [Curve].
</member>
- <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Angular velocity randomness ratio.
+ <member name="angular_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum angular velocity.
</member>
- <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0">
- Particle animation offset.
+ <member name="angular_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum angular velocity.
</member>
<member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's animation offset will vary along this [Curve].
</member>
- <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Animation offset randomness ratio.
+ <member name="anim_offset_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum animation offset.
</member>
- <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0">
- Particle animation speed.
+ <member name="anim_offset_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum animation offset.
</member>
<member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's animation speed will vary along this [Curve].
</member>
- <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Animation speed randomness ratio.
+ <member name="anim_speed_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum particle animation speed.
+ </member>
+ <member name="anim_speed_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum particle animation speed.
</member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)">
Each particle's initial color. To have particle display color in a [BaseMaterial3D] make sure to set [member BaseMaterial3D.vertex_color_use_as_albedo] to [code]true[/code].
@@ -130,14 +128,14 @@
<member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp">
Each particle's color will vary along this [GradientTexture] over its lifetime (multiplied with [member color]).
</member>
- <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0">
- The rate at which particles lose velocity.
- </member>
<member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Damping will vary along this [Curve].
</member>
- <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Damping randomness ratio.
+ <member name="damping_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum damping.
+ </member>
+ <member name="damping_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum damping
</member>
<member name="direction" type="Vector3" setter="set_direction" getter="get_direction" default="Vector3(1, 0, 0)">
Unit vector specifying the particles' emission direction.
@@ -193,20 +191,20 @@
<member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3(0, -9.8, 0)">
Gravity applied to every particle.
</member>
- <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial hue variation applied to each particle.
- </member>
<member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's hue will vary along this [Curve].
</member>
- <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Hue variation randomness ratio.
+ <member name="hue_variation_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum hue variation.
</member>
- <member name="initial_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial velocity magnitude for each particle. Direction comes from [member spread] and the node's orientation.
+ <member name="hue_variation_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum hue variation.
</member>
- <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Initial velocity randomness ratio.
+ <member name="initial_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum value of the initial velocity.
+ </member>
+ <member name="initial_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum value of the initial velocity.
</member>
<member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0">
Amount of time each particle will exist.
@@ -214,14 +212,14 @@
<member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0">
Particle lifetime randomness ratio.
</member>
- <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0">
- Linear acceleration applied to each particle in the direction of motion.
- </member>
<member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's linear acceleration will vary along this [Curve].
</member>
- <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Linear acceleration randomness ratio.
+ <member name="linear_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum linear acceleration.
+ </member>
+ <member name="linear_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum linear acceleration.
</member>
<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
@@ -232,15 +230,14 @@
<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end.
</member>
- <member name="orbit_velocity" type="float" setter="set_param" getter="get_param">
- Orbital velocity applied to each particle. Makes the particles circle around origin in the local XY plane. Specified in number of full rotations around origin per second.
- This property is only available when [member particle_flag_disable_z] is [code]true[/code].
- </member>
<member name="orbit_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's orbital velocity will vary along this [Curve].
</member>
- <member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
- Orbital velocity randomness ratio.
+ <member name="orbit_velocity_max" type="float" setter="set_param_max" getter="get_param_max">
+ Maximum orbit velocity.
+ </member>
+ <member name="orbit_velocity_min" type="float" setter="set_param_min" getter="get_param_min">
+ Minimum orbit velocity.
</member>
<member name="particle_flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
Align Y axis of particle with the direction of its velocity.
@@ -249,46 +246,58 @@
If [code]true[/code], particles will not move on the Z axis.
</member>
<member name="particle_flag_rotate_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
- If [code]true[/code], particles rotate around Y axis by [member angle].
+ If [code]true[/code], particles rotate around Y axis by [member angle_min].
</member>
<member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0">
Particle system starts as if it had already run for this many seconds.
</member>
- <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0">
- Radial acceleration applied to each particle. Makes particle accelerate away from origin.
- </member>
<member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's radial acceleration will vary along this [Curve].
</member>
- <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Radial acceleration randomness ratio.
+ <member name="radial_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum radial acceleration.
+ </member>
+ <member name="radial_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum radial acceleration.
</member>
<member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" default="0.0">
Emission lifetime randomness ratio.
</member>
- <member name="scale_amount" type="float" setter="set_param" getter="get_param" default="1.0">
- Initial scale applied to each particle.
- </member>
<member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's scale will vary along this [Curve].
</member>
- <member name="scale_amount_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Scale randomness ratio.
+ <member name="scale_amount_max" type="float" setter="set_param_max" getter="get_param_max" default="1.0">
+ Maximum scale.
+ </member>
+ <member name="scale_amount_min" type="float" setter="set_param_min" getter="get_param_min" default="1.0">
+ Minimum scale.
+ </member>
+ <member name="scale_curve_x" type="Curve" setter="set_scale_curve_x" getter="get_scale_curve_x">
+ Curve for the scale over life, along the x axis.
+ </member>
+ <member name="scale_curve_y" type="Curve" setter="set_scale_curve_y" getter="get_scale_curve_y">
+ Curve for the scale over life, along the y axis.
+ </member>
+ <member name="scale_curve_z" type="Curve" setter="set_scale_curve_z" getter="get_scale_curve_z">
+ Curve for the scale over life, along the z axis.
</member>
<member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0">
Particle system's running speed scaling ratio. A value of [code]0[/code] can be used to pause the particles.
</member>
+ <member name="split_scale" type="bool" setter="set_split_scale" getter="get_split_scale" default="false">
+ If set to true, three different scale curves can be specified, one per scale axis.
+ </member>
<member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0">
Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Applied to X/Z plane and Y/Z planes.
</member>
- <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0">
- Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
- </member>
<member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
Each particle's tangential acceleration will vary along this [Curve].
</member>
- <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Tangential acceleration randomness ratio.
+ <member name="tangential_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum tangent acceleration.
+ </member>
+ <member name="tangential_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum tangent acceleration.
</member>
</members>
<constants>
@@ -302,40 +311,40 @@
Particles are drawn in order of depth.
</constant>
<constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set initial velocity properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set initial velocity properties.
</constant>
<constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angular velocity properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angular velocity properties.
</constant>
<constant name="PARAM_ORBIT_VELOCITY" value="2" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set orbital velocity properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set orbital velocity properties.
</constant>
<constant name="PARAM_LINEAR_ACCEL" value="3" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set linear acceleration properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set linear acceleration properties.
</constant>
<constant name="PARAM_RADIAL_ACCEL" value="4" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set radial acceleration properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set radial acceleration properties.
</constant>
<constant name="PARAM_TANGENTIAL_ACCEL" value="5" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set tangential acceleration properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set tangential acceleration properties.
</constant>
<constant name="PARAM_DAMPING" value="6" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set damping properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set damping properties.
</constant>
<constant name="PARAM_ANGLE" value="7" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angle properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angle properties.
</constant>
<constant name="PARAM_SCALE" value="8" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set scale properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set scale properties.
</constant>
<constant name="PARAM_HUE_VARIATION" value="9" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set hue variation properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set hue variation properties.
</constant>
<constant name="PARAM_ANIM_SPEED" value="10" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation speed properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation speed properties.
</constant>
<constant name="PARAM_ANIM_OFFSET" value="11" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation offset properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation offset properties.
</constant>
<constant name="PARAM_MAX" value="12" enum="Parameter">
Represents the size of the [enum Parameter] enum.
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 2c92ce0185..4641bc52a4 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -106,6 +106,20 @@
Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation.
</description>
</method>
+ <method name="draw_msdf_texture_rect_region">
+ <return type="void" />
+ <argument index="0" name="texture" type="Texture2D" />
+ <argument index="1" name="rect" type="Rect2" />
+ <argument index="2" name="src_rect" type="Rect2" />
+ <argument index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
+ <argument index="4" name="outline" type="float" default="0.0" />
+ <argument index="5" name="pixel_range" type="float" default="4.0" />
+ <description>
+ Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color.
+ If [code]outline[/code] is positive, each alpha channel value of pixel in region is set to maximum value of true distance in the [code]outline[/code] radius.
+ Value of the [code]pixel_range[/code] should the same that was used during distance field texture generation.
+ </description>
+ </method>
<method name="draw_multiline">
<return type="void" />
<argument index="0" name="points" type="PackedVector2Array" />
diff --git a/doc/classes/CanvasItemMaterial.xml b/doc/classes/CanvasItemMaterial.xml
index c2d44c1d17..780899bff7 100644
--- a/doc/classes/CanvasItemMaterial.xml
+++ b/doc/classes/CanvasItemMaterial.xml
@@ -30,7 +30,7 @@
[b]Note:[/b] This property is only used and visible in the editor if [member particles_animation] is [code]true[/code].
</member>
<member name="particles_animation" type="bool" setter="set_particles_animation" getter="get_particles_animation" default="false">
- If [code]true[/code], enable spritesheet-based animation features when assigned to [GPUParticles2D] and [CPUParticles2D] nodes. The [member ParticlesMaterial.anim_speed] or [member CPUParticles2D.anim_speed] should also be set to a positive value for the animation to play.
+ If [code]true[/code], enable spritesheet-based animation features when assigned to [GPUParticles2D] and [CPUParticles2D] nodes. The [member ParticlesMaterial.anim_speed_max] or [member CPUParticles2D.anim_speed_max] should also be set to a positive value for the animation to play.
This property (and other [code]particles_anim_*[/code] properties that depend on it) has no effect on other types of nodes.
</member>
</members>
diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml
index e23ceedc28..e5f60541b9 100644
--- a/doc/classes/CharacterBody2D.xml
+++ b/doc/classes/CharacterBody2D.xml
@@ -111,6 +111,7 @@
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
Modifies [member linear_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision].
When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions.
+ The general behaviour and available properties change according to the [member motion_mode].
Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code].
</description>
</method>
@@ -139,12 +140,18 @@
<member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="false">
If [code]true[/code], the body will not slide on floor's slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still.
</member>
+ <member name="free_mode_min_slide_angle" type="float" setter="set_free_mode_min_slide_angle" getter="get_free_mode_min_slide_angle" default="0.261799">
+ Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees.
+ </member>
<member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2(0, 0)">
Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide].
</member>
<member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="4">
Maximum number of times the body can change direction before it stops when calling [method move_and_slide].
</member>
+ <member name="motion_mode" type="int" setter="set_motion_mode" getter="get_motion_mode" enum="CharacterBody2D.MotionMode" default="0">
+ Sets the motion mode which defines the behaviour of [method move_and_slide]. See [enum MotionMode] constants for available modes.
+ </member>
<member name="moving_platform_ignore_layers" type="int" setter="set_moving_platform_ignore_layers" getter="get_moving_platform_ignore_layers" default="0">
Collision layers that will be excluded for detecting bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all touching bodies are detected and propagate their velocity. You can add excluded layers to ignore bodies that are contained in these layers.
</member>
@@ -156,5 +163,11 @@
</member>
</members>
<constants>
+ <constant name="MOTION_MODE_GROUNDED" value="0" enum="MotionMode">
+ Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for sided games like platformers.
+ </constant>
+ <constant name="MOTION_MODE_FREE" value="1" enum="MotionMode">
+ Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will be always constant. This mode is suitable for top-down games.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml
index 47078330f3..93f72d45ae 100644
--- a/doc/classes/CodeEdit.xml
+++ b/doc/classes/CodeEdit.xml
@@ -17,9 +17,9 @@
Override this method to define how the selected entry should be inserted. If [code]replace[/code] is true, any existing text should be replaced.
</description>
</method>
- <method name="_filter_code_completion_candidates" qualifiers="virtual">
+ <method name="_filter_code_completion_candidates" qualifiers="virtual const">
<return type="Array" />
- <argument index="0" name="candidates" type="Array" />
+ <argument index="0" name="candidates" type="Dictionary[]" />
<description>
Override this method to define what items in [code]candidates[/code] should be displayed.
Both [code]candidates[/code] and the return is a [Array] of [Dictionary], see [method get_code_completion_option] for [Dictionary] content.
diff --git a/doc/classes/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml
index 7129c72e7c..ba1ee3909d 100644
--- a/doc/classes/CollisionObject2D.xml
+++ b/doc/classes/CollisionObject2D.xml
@@ -11,7 +11,7 @@
<methods>
<method name="_input_event" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="viewport" type="Object" />
+ <argument index="0" name="viewport" type="Viewport" />
<argument index="1" name="event" type="InputEvent" />
<argument index="2" name="shape_idx" type="int" />
<description>
diff --git a/doc/classes/CollisionObject3D.xml b/doc/classes/CollisionObject3D.xml
index f9151a2c2f..19bcdcbb27 100644
--- a/doc/classes/CollisionObject3D.xml
+++ b/doc/classes/CollisionObject3D.xml
@@ -11,7 +11,7 @@
<methods>
<method name="_input_event" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="camera" type="Object" />
+ <argument index="0" name="camera" type="Camera3D" />
<argument index="1" name="event" type="InputEvent" />
<argument index="2" name="position" type="Vector3" />
<argument index="3" name="normal" type="Vector3" />
diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml
index 99e121de75..571ffd592a 100644
--- a/doc/classes/ColorPicker.xml
+++ b/doc/classes/ColorPicker.xml
@@ -116,7 +116,7 @@
</theme_item>
<theme_item name="picker_cursor" data_type="icon" type="Texture2D">
</theme_item>
- <theme_item name="preset_bg" data_type="icon" type="Texture2D">
+ <theme_item name="sample_bg" data_type="icon" type="Texture2D">
</theme_item>
<theme_item name="screen_picker" data_type="icon" type="Texture2D">
The icon for the screen color picker button.
diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml
index f970be23a6..d6da4bc248 100644
--- a/doc/classes/ConfigFile.xml
+++ b/doc/classes/ConfigFile.xml
@@ -149,6 +149,8 @@
</method>
<method name="load">
<return type="int" enum="Error" />
+ <returns_error number="0"/>
+ <returns_error number="12"/>
<argument index="0" name="path" type="String" />
<description>
Loads the config file specified as a parameter. The file's contents are parsed and loaded in the [ConfigFile] object which the method was called on.
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index 0834521c91..5392189f6a 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -22,9 +22,9 @@
<link title="All GUI Demos">https://github.com/godotengine/godot-demo-projects/tree/master/gui</link>
</tutorials>
<methods>
- <method name="_can_drop_data" qualifiers="virtual">
+ <method name="_can_drop_data" qualifiers="virtual const">
<return type="bool" />
- <argument index="0" name="position" type="Vector2" />
+ <argument index="0" name="at_position" type="Vector2" />
<argument index="1" name="data" type="Variant" />
<description>
Godot calls this method to test if [code]data[/code] from a control's [method _get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control.
@@ -49,7 +49,7 @@
</method>
<method name="_drop_data" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="position" type="Vector2" />
+ <argument index="0" name="at_position" type="Vector2" />
<argument index="1" name="data" type="Variant" />
<description>
Godot calls this method to pass you the [code]data[/code] from a control's [method _get_drag_data] result. Godot first calls [method _can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control.
@@ -73,9 +73,9 @@
[/codeblocks]
</description>
</method>
- <method name="_get_drag_data" qualifiers="virtual">
+ <method name="_get_drag_data" qualifiers="virtual const">
<return type="Variant" />
- <argument index="0" name="position" type="Vector2" />
+ <argument index="0" name="at_position" type="Vector2" />
<description>
Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method _can_drop_data] and [method _drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag].
A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method.
@@ -97,7 +97,7 @@
[/codeblocks]
</description>
</method>
- <method name="_get_minimum_size" qualifiers="virtual">
+ <method name="_get_minimum_size" qualifiers="virtual const">
<return type="Vector2" />
<description>
Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member rect_min_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately).
@@ -141,15 +141,15 @@
</method>
<method name="_has_point" qualifiers="virtual const">
<return type="bool" />
- <argument index="0" name="" type="Vector2" />
+ <argument index="0" name="position" type="Vector2" />
<description>
Virtual method to be implemented by the user. Returns whether the given [code]point[/code] is inside this control.
If not overridden, default behavior is checking if the point is within control's Rect.
[b]Note:[/b] If you want to check if a point is inside the control, you can use [code]get_rect().has_point(point)[/code].
</description>
</method>
- <method name="_make_custom_tooltip" qualifiers="virtual">
- <return type="Control" />
+ <method name="_make_custom_tooltip" qualifiers="virtual const">
+ <return type="Object" />
<argument index="0" name="for_text" type="String" />
<description>
Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [code]for_text[/code] includes the contents of the [member hint_tooltip] property.
@@ -193,8 +193,8 @@
[/codeblocks]
</description>
</method>
- <method name="_structured_text_parser" qualifiers="virtual">
- <return type="void" />
+ <method name="_structured_text_parser" qualifiers="virtual const">
+ <return type="Array" />
<argument index="0" name="args" type="Array" />
<argument index="1" name="text" type="String" />
<description>
diff --git a/doc/classes/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml
index 0060368207..e3badea0f4 100644
--- a/doc/classes/DirectionalLight3D.xml
+++ b/doc/classes/DirectionalLight3D.xml
@@ -36,7 +36,7 @@
<member name="directional_shadow_split_3" type="float" setter="set_param" getter="get_param" default="0.5">
The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code].
</member>
- <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" override="true" default="1.0" />
+ <member name="shadow_bias" type="float" setter="set_param" getter="get_param" override="true" default="0.1" />
<member name="use_in_sky_only" type="bool" setter="set_sky_only" getter="is_sky_only" default="false">
If [code]true[/code], this [DirectionalLight3D] will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon.
</member>
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index abb715b34e..4f495eaec9 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -649,6 +649,8 @@
<argument index="0" name="min_size" type="Vector2i" />
<argument index="1" name="window_id" type="int" default="0" />
<description>
+ Sets the minimum size for the given window to [code]min_size[/code] (in pixels).
+ [b]Note:[/b] By default, the main window has a minimum size of [code]Vector2i(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size.
</description>
</method>
<method name="window_set_mode">
diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index b379ccc8c6..da6738d6b7 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -113,28 +113,28 @@
<link title="Import plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link>
</tutorials>
<methods>
- <method name="_get_import_options" qualifiers="virtual">
+ <method name="_get_import_options" qualifiers="virtual const">
<return type="Array" />
- <argument index="0" name="preset" type="int" />
+ <argument index="0" name="preset_index" type="int" />
<description>
Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: [code]name[/code], [code]default_value[/code], [code]property_hint[/code] (optional), [code]hint_string[/code] (optional), [code]usage[/code] (optional).
</description>
</method>
- <method name="_get_import_order" qualifiers="virtual">
+ <method name="_get_import_order" qualifiers="virtual const">
<return type="int" />
<description>
Gets the order of this importer to be run when importing resources. Importers with [i]lower[/i] import orders will be called first, and higher values will be called later. Use this to ensure the importer runs after the dependencies are already imported. The default import order is [code]0[/code] unless overridden by a specific importer. See [enum ResourceImporter.ImportOrder] for some predefined values.
</description>
</method>
- <method name="_get_importer_name" qualifiers="virtual">
+ <method name="_get_importer_name" qualifiers="virtual const">
<return type="String" />
<description>
Gets the unique name of the importer.
</description>
</method>
- <method name="_get_option_visibility" qualifiers="virtual">
+ <method name="_get_option_visibility" qualifiers="virtual const">
<return type="bool" />
- <argument index="0" name="option" type="String" />
+ <argument index="0" name="option_name" type="StringName" />
<argument index="1" name="options" type="Dictionary" />
<description>
This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example:
@@ -163,50 +163,50 @@
Return [code]true[/code] to make all options always visible.
</description>
</method>
- <method name="_get_preset_count" qualifiers="virtual">
+ <method name="_get_preset_count" qualifiers="virtual const">
<return type="int" />
<description>
Gets the number of initial presets defined by the plugin. Use [method _get_import_options] to get the default options for the preset and [method _get_preset_name] to get the name of the preset.
</description>
</method>
- <method name="_get_preset_name" qualifiers="virtual">
+ <method name="_get_preset_name" qualifiers="virtual const">
<return type="String" />
- <argument index="0" name="preset" type="int" />
+ <argument index="0" name="preset_index" type="int" />
<description>
Gets the name of the options preset at this index.
</description>
</method>
- <method name="_get_priority" qualifiers="virtual">
+ <method name="_get_priority" qualifiers="virtual const">
<return type="float" />
<description>
Gets the priority of this plugin for the recognized extension. Higher priority plugins will be preferred. The default priority is [code]1.0[/code].
</description>
</method>
- <method name="_get_recognized_extensions" qualifiers="virtual">
- <return type="Array" />
+ <method name="_get_recognized_extensions" qualifiers="virtual const">
+ <return type="PackedStringArray" />
<description>
Gets the list of file extensions to associate with this loader (case-insensitive). e.g. [code]["obj"][/code].
</description>
</method>
- <method name="_get_resource_type" qualifiers="virtual">
+ <method name="_get_resource_type" qualifiers="virtual const">
<return type="String" />
<description>
Gets the Godot resource type associated with this loader. e.g. [code]"Mesh"[/code] or [code]"Animation"[/code].
</description>
</method>
- <method name="_get_save_extension" qualifiers="virtual">
+ <method name="_get_save_extension" qualifiers="virtual const">
<return type="String" />
<description>
Gets the extension used to save this resource in the [code].godot/imported[/code] directory.
</description>
</method>
- <method name="_get_visible_name" qualifiers="virtual">
+ <method name="_get_visible_name" qualifiers="virtual const">
<return type="String" />
<description>
Gets the name to display in the import window. You should choose this name as a continuation to "Import as", e.g. "Import as Special Mesh".
</description>
</method>
- <method name="_import" qualifiers="virtual">
+ <method name="_import" qualifiers="virtual const">
<return type="int" />
<argument index="0" name="source_file" type="String" />
<argument index="1" name="save_path" type="String" />
diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml
index 62fd7a1d6e..ee93379210 100644
--- a/doc/classes/EditorInspectorPlugin.xml
+++ b/doc/classes/EditorInspectorPlugin.xml
@@ -16,9 +16,9 @@
<link title="Inspector plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/inspector_plugins.html</link>
</tutorials>
<methods>
- <method name="_can_handle" qualifiers="virtual">
+ <method name="_can_handle" qualifiers="virtual const">
<return type="bool" />
- <argument index="0" name="object" type="Object" />
+ <argument index="0" name="object" type="Variant" />
<description>
Returns [code]true[/code] if this object can be handled by this plugin.
</description>
@@ -31,9 +31,9 @@
</method>
<method name="_parse_category" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="category" type="String" />
+ <argument index="0" name="object" type="Object" />
+ <argument index="1" name="category" type="String" />
<description>
- Called to allow adding controls at the beginning of the category.
</description>
</method>
<method name="_parse_end" qualifiers="virtual">
@@ -44,11 +44,13 @@
</method>
<method name="_parse_property" qualifiers="virtual">
<return type="bool" />
- <argument index="0" name="type" type="int" />
- <argument index="1" name="path" type="String" />
- <argument index="2" name="hint" type="int" />
- <argument index="3" name="hint_text" type="String" />
- <argument index="4" name="usage" type="int" />
+ <argument index="0" name="object" type="Object" />
+ <argument index="1" name="type" type="int" />
+ <argument index="2" name="name" type="String" />
+ <argument index="3" name="hint_type" type="int" />
+ <argument index="4" name="hint_string" type="String" />
+ <argument index="5" name="usage_flags" type="int" />
+ <argument index="6" name="wide" type="bool" />
<description>
Called to allow adding property specific editors to the inspector. Usually these inherit [EditorProperty]. Returning [code]true[/code] removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one.
</description>
diff --git a/doc/classes/EditorNode3DGizmo.xml b/doc/classes/EditorNode3DGizmo.xml
index 39f6805254..91e024cc1c 100644
--- a/doc/classes/EditorNode3DGizmo.xml
+++ b/doc/classes/EditorNode3DGizmo.xml
@@ -13,7 +13,7 @@
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="restore" type="Variant" />
- <argument index="2" name="cancel" type="bool" default="false" />
+ <argument index="2" name="cancel" type="bool" />
<description>
Override this method to commit a handle being edited (handles must have been previously added by [method add_handles]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo".
If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action.
@@ -22,14 +22,14 @@
<method name="_commit_subgizmos" qualifiers="virtual">
<return type="void" />
<argument index="0" name="ids" type="PackedInt32Array" />
- <argument index="1" name="restore" type="Array" />
- <argument index="2" name="cancel" type="bool" default="false" />
+ <argument index="1" name="restores" type="Transform3D[]" />
+ <argument index="2" name="cancel" type="bool" />
<description>
Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [code]restore[/code] transforms as "undo".
If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] transforms should be directly set, without any [UndoRedo] action.
</description>
</method>
- <method name="_get_handle_name" qualifiers="virtual">
+ <method name="_get_handle_name" qualifiers="virtual const">
<return type="String" />
<argument index="0" name="id" type="int" />
<description>
@@ -37,21 +37,21 @@
Handles can be named for reference to the user when editing.
</description>
</method>
- <method name="_get_handle_value" qualifiers="virtual">
+ <method name="_get_handle_value" qualifiers="virtual const">
<return type="Variant" />
<argument index="0" name="id" type="int" />
<description>
Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle].
</description>
</method>
- <method name="_get_subgizmo_transform" qualifiers="virtual">
+ <method name="_get_subgizmo_transform" qualifiers="virtual const">
<return type="Transform3D" />
<argument index="0" name="id" type="int" />
<description>
Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_subgizmos].
</description>
</method>
- <method name="_is_handle_highlighted" qualifiers="virtual">
+ <method name="_is_handle_highlighted" qualifiers="virtual const">
<return type="bool" />
<argument index="0" name="id" type="int" />
<description>
@@ -81,15 +81,15 @@
Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [code]transform[/code] is given in the Node3D's local coordinate system.
</description>
</method>
- <method name="_subgizmos_intersect_frustum" qualifiers="virtual">
+ <method name="_subgizmos_intersect_frustum" qualifiers="virtual const">
<return type="PackedInt32Array" />
<argument index="0" name="camera" type="Camera3D" />
- <argument index="1" name="frustum" type="Array" />
+ <argument index="1" name="frustum" type="Plane[]" />
<description>
Override this method to allow selecting subgizmos using mouse drag box selection. Given a [code]camera[/code] and a [code]frustum[/code], this method should return which subgizmos are contained within the frustum. The [code]frustum[/code] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos].
</description>
</method>
- <method name="_subgizmos_intersect_ray" qualifiers="virtual">
+ <method name="_subgizmos_intersect_ray" qualifiers="virtual const">
<return type="int" />
<argument index="0" name="camera" type="Camera3D" />
<argument index="1" name="point" type="Vector2" />
diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml
index fb72427a7a..4ba455a336 100644
--- a/doc/classes/EditorNode3DGizmoPlugin.xml
+++ b/doc/classes/EditorNode3DGizmoPlugin.xml
@@ -10,7 +10,7 @@
<link title="Spatial gizmo plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link>
</tutorials>
<methods>
- <method name="_can_be_hidden" qualifiers="virtual">
+ <method name="_can_be_hidden" qualifiers="virtual const">
<return type="bool" />
<description>
Override this method to define whether the gizmos handled by this plugin can be hidden or not. Returns [code]true[/code] if not overridden.
@@ -19,9 +19,9 @@
<method name="_commit_handle" qualifiers="virtual">
<return type="void" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
- <argument index="1" name="id" type="int" />
+ <argument index="1" name="handle_id" type="int" />
<argument index="2" name="restore" type="Variant" />
- <argument index="3" name="cancel" type="bool" default="false" />
+ <argument index="3" name="cancel" type="bool" />
<description>
Override this method to commit a handle being edited (handles must have been previously added by [method EditorNode3DGizmo.add_handles] during [method _redraw]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo".
If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action. Called for this plugin's active gizmos.
@@ -31,73 +31,73 @@
<return type="void" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
<argument index="1" name="ids" type="PackedInt32Array" />
- <argument index="2" name="restore" type="Array" />
- <argument index="3" name="cancel" type="bool" default="false" />
+ <argument index="2" name="restores" type="Transform3D[]" />
+ <argument index="3" name="cancel" type="bool" />
<description>
Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [code]restore[/code] transforms as "undo".
If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] transforms should be directly set, without any [UndoRedo] action. As with all subgizmo methods, transforms are given in local space respect to the gizmo's Node3D. Called for this plugin's active gizmos.
</description>
</method>
- <method name="_create_gizmo" qualifiers="virtual">
+ <method name="_create_gizmo" qualifiers="virtual const">
<return type="EditorNode3DGizmo" />
- <argument index="0" name="spatial" type="Node3D" />
+ <argument index="0" name="for_node_3d" type="Node3D" />
<description>
Override this method to return a custom [EditorNode3DGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method _has_gizmo].
</description>
</method>
- <method name="_get_gizmo_name" qualifiers="virtual">
+ <method name="_get_gizmo_name" qualifiers="virtual const">
<return type="String" />
<description>
Override this method to provide the name that will appear in the gizmo visibility menu.
</description>
</method>
- <method name="_get_handle_name" qualifiers="virtual">
+ <method name="_get_handle_name" qualifiers="virtual const">
<return type="String" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
- <argument index="1" name="id" type="int" />
+ <argument index="1" name="handle_id" type="int" />
<description>
Override this method to provide gizmo's handle names. Called for this plugin's active gizmos.
</description>
</method>
- <method name="_get_handle_value" qualifiers="virtual">
+ <method name="_get_handle_value" qualifiers="virtual const">
<return type="Variant" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
- <argument index="1" name="id" type="int" />
+ <argument index="1" name="handle_id" type="int" />
<description>
Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle]. Called for this plugin's active gizmos.
</description>
</method>
- <method name="_get_priority" qualifiers="virtual">
+ <method name="_get_priority" qualifiers="virtual const">
<return type="int" />
<description>
Override this method to set the gizmo's priority. Gizmos with higher priority will have precedence when processing inputs like handles or subgizmos selection.
All built-in editor gizmos return a priority of [code]-1[/code]. If not overridden, this method will return [code]0[/code], which means custom gizmos will automatically get higher priority than built-in gizmos.
</description>
</method>
- <method name="_get_subgizmo_transform" qualifiers="virtual">
+ <method name="_get_subgizmo_transform" qualifiers="virtual const">
<return type="Transform3D" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
- <argument index="1" name="id" type="int" />
+ <argument index="1" name="subgizmo_id" type="int" />
<description>
Override this method to return the current transform of a subgizmo. As with all subgizmo methods, the transform should be in local space respect to the gizmo's Node3D. This transform will be requested at the start of an edit and used in the [code]restore[/code] argument in [method _commit_subgizmos]. Called for this plugin's active gizmos.
</description>
</method>
- <method name="_has_gizmo" qualifiers="virtual">
+ <method name="_has_gizmo" qualifiers="virtual const">
<return type="bool" />
- <argument index="0" name="spatial" type="Node3D" />
+ <argument index="0" name="for_node_3d" type="Node3D" />
<description>
Override this method to define which Node3D nodes have a gizmo from this plugin. Whenever a [Node3D] node is added to a scene this method is called, if it returns [code]true[/code] the node gets a generic [EditorNode3DGizmo] assigned and is added to this plugin's list of active gizmos.
</description>
</method>
- <method name="_is_handle_highlighted" qualifiers="virtual">
+ <method name="_is_handle_highlighted" qualifiers="virtual const">
<return type="bool" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
- <argument index="1" name="id" type="int" />
+ <argument index="1" name="handle_id" type="int" />
<description>
Override this method to return [code]true[/code] whenever to given handle should be highlighted in the editor. Called for this plugin's active gizmos.
</description>
</method>
- <method name="_is_selectable_when_hidden" qualifiers="virtual">
+ <method name="_is_selectable_when_hidden" qualifiers="virtual const">
<return type="bool" />
<description>
Override this method to define whether Node3D with this gizmo should be selectable even when the gizmo is hidden.
@@ -113,9 +113,9 @@
<method name="_set_handle" qualifiers="virtual">
<return type="void" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
- <argument index="1" name="id" type="int" />
+ <argument index="1" name="handle_id" type="int" />
<argument index="2" name="camera" type="Camera3D" />
- <argument index="3" name="point" type="Vector2" />
+ <argument index="3" name="screen_pos" type="Vector2" />
<description>
Override this method to update the node's properties when the user drags a gizmo handle (previously added with [method EditorNode3DGizmo.add_handles]). The provided [code]point[/code] is the mouse position in screen coordinates and the [code]camera[/code] can be used to convert it to raycasts. Called for this plugin's active gizmos.
</description>
@@ -123,26 +123,26 @@
<method name="_set_subgizmo_transform" qualifiers="virtual">
<return type="void" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
- <argument index="1" name="id" type="int" />
+ <argument index="1" name="subgizmo_id" type="int" />
<argument index="2" name="transform" type="Transform3D" />
<description>
Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [code]transform[/code] is given in the Node3D's local coordinate system. Called for this plugin's active gizmos.
</description>
</method>
- <method name="_subgizmos_intersect_frustum" qualifiers="virtual">
+ <method name="_subgizmos_intersect_frustum" qualifiers="virtual const">
<return type="PackedInt32Array" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
<argument index="1" name="camera" type="Camera3D" />
- <argument index="2" name="frustum" type="Array" />
+ <argument index="2" name="frustum_planes" type="Plane[]" />
<description>
Override this method to allow selecting subgizmos using mouse drag box selection. Given a [code]camera[/code] and a [code]frustum[/code], this method should return which subgizmos are contained within the frustum. The [code]frustum[/code] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, these identifiers can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos.
</description>
</method>
- <method name="_subgizmos_intersect_ray" qualifiers="virtual">
+ <method name="_subgizmos_intersect_ray" qualifiers="virtual const">
<return type="int" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
<argument index="1" name="camera" type="Camera3D" />
- <argument index="2" name="point" type="Vector2" />
+ <argument index="2" name="screen_pos" type="Vector2" />
<description>
Override this method to allow selecting subgizmos using mouse clicks. Given a [code]camera[/code] and a [code]point[/code] in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos.
</description>
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 37efca7f48..e564e8045c 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -38,7 +38,7 @@
</method>
<method name="_edit" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="object" type="Object" />
+ <argument index="0" name="object" type="Variant" />
<description>
This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object.
</description>
@@ -49,18 +49,18 @@
Called by the engine when the user enables the [EditorPlugin] in the Plugin tab of the project settings window.
</description>
</method>
- <method name="_forward_canvas_draw_over_viewport" qualifiers="virtual">
+ <method name="_forward_3d_draw_over_viewport" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="overlay" type="Control" />
+ <argument index="0" name="viewport_control" type="Control" />
<description>
- Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays].
+ Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays].
[codeblocks]
[gdscript]
- func _forward_canvas_draw_over_viewport(overlay):
+ func _forward_spatial_3d_over_viewport(overlay):
# Draw a circle at cursor position.
- overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white)
+ overlay.draw_circle(overlay.get_local_mouse_position(), 64)
- func _forward_canvas_gui_input(event):
+ func _forward_spatial_gui_input(camera, event):
if event is InputEventMouseMotion:
# Redraw viewport when cursor is moved.
update_overlays()
@@ -68,13 +68,13 @@
return false
[/gdscript]
[csharp]
- public override void ForwardCanvasDrawOverViewport(Godot.Control overlay)
+ public override void ForwardSpatialDrawOverViewport(Godot.Control overlay)
{
// Draw a circle at cursor position.
overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White);
}
- public override bool ForwardCanvasGuiInput(InputEvent @event)
+ public override bool ForwardSpatialGuiInput(Godot.Camera3D camera, InputEvent @event)
{
if (@event is InputEventMouseMotion)
{
@@ -87,28 +87,29 @@
[/codeblocks]
</description>
</method>
- <method name="_forward_canvas_force_draw_over_viewport" qualifiers="virtual">
+ <method name="_forward_3d_force_draw_over_viewport" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="overlay" type="Control" />
+ <argument index="0" name="viewport_control" type="Control" />
<description>
- This method is the same as [method _forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
+ This method is the same as [method _forward_3d_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled].
</description>
</method>
- <method name="_forward_canvas_gui_input" qualifiers="virtual">
+ <method name="_forward_3d_gui_input" qualifiers="virtual">
<return type="bool" />
- <argument index="0" name="event" type="InputEvent" />
+ <argument index="0" name="viewport_camera" type="Camera3D" />
+ <argument index="1" name="event" type="InputEvent" />
<description>
- Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example:
+ Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example:
[codeblocks]
[gdscript]
- # Prevents the InputEvent to reach other Editor classes
- func _forward_canvas_gui_input(event):
+ # Prevents the InputEvent to reach other Editor classes.
+ func _forward_spatial_gui_input(camera, event):
return true
[/gdscript]
[csharp]
- // Prevents the InputEvent to reach other Editor classes
- public override bool ForwardCanvasGuiInput(InputEvent @event)
+ // Prevents the InputEvent to reach other Editor classes.
+ public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event)
{
return true;
}
@@ -118,12 +119,12 @@
[codeblocks]
[gdscript]
# Consumes InputEventMouseMotion and forwards other InputEvent types.
- func _forward_canvas_gui_input(event):
+ func _forward_spatial_gui_input(camera, event):
return event is InputEventMouseMotion
[/gdscript]
[csharp]
// Consumes InputEventMouseMotion and forwards other InputEvent types.
- public override bool ForwardCanvasGuiInput(InputEvent @event)
+ public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event)
{
return @event is InputEventMouseMotion;
}
@@ -131,18 +132,18 @@
[/codeblocks]
</description>
</method>
- <method name="_forward_spatial_draw_over_viewport" qualifiers="virtual">
+ <method name="_forward_canvas_draw_over_viewport" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="overlay" type="Control" />
+ <argument index="0" name="viewport_control" type="Control" />
<description>
- Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays].
+ Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays].
[codeblocks]
[gdscript]
- func _forward_spatial_draw_over_viewport(overlay):
+ func _forward_canvas_draw_over_viewport(overlay):
# Draw a circle at cursor position.
- overlay.draw_circle(overlay.get_local_mouse_position(), 64)
+ overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white)
- func _forward_spatial_gui_input(camera, event):
+ func _forward_canvas_gui_input(event):
if event is InputEventMouseMotion:
# Redraw viewport when cursor is moved.
update_overlays()
@@ -150,13 +151,13 @@
return false
[/gdscript]
[csharp]
- public override void ForwardSpatialDrawOverViewport(Godot.Control overlay)
+ public override void ForwardCanvasDrawOverViewport(Godot.Control overlay)
{
// Draw a circle at cursor position.
overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White);
}
- public override bool ForwardSpatialGuiInput(Godot.Camera3D camera, InputEvent @event)
+ public override bool ForwardCanvasGuiInput(InputEvent @event)
{
if (@event is InputEventMouseMotion)
{
@@ -169,29 +170,28 @@
[/codeblocks]
</description>
</method>
- <method name="_forward_spatial_force_draw_over_viewport" qualifiers="virtual">
+ <method name="_forward_canvas_force_draw_over_viewport" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="overlay" type="Control" />
+ <argument index="0" name="viewport_control" type="Control" />
<description>
- This method is the same as [method _forward_spatial_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
+ This method is the same as [method _forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled].
</description>
</method>
- <method name="_forward_spatial_gui_input" qualifiers="virtual">
+ <method name="_forward_canvas_gui_input" qualifiers="virtual">
<return type="bool" />
- <argument index="0" name="camera" type="Camera3D" />
- <argument index="1" name="event" type="InputEvent" />
+ <argument index="0" name="event" type="InputEvent" />
<description>
- Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example:
+ Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example:
[codeblocks]
[gdscript]
- # Prevents the InputEvent to reach other Editor classes.
- func _forward_spatial_gui_input(camera, event):
+ # Prevents the InputEvent to reach other Editor classes
+ func _forward_canvas_gui_input(event):
return true
[/gdscript]
[csharp]
- // Prevents the InputEvent to reach other Editor classes.
- public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event)
+ // Prevents the InputEvent to reach other Editor classes
+ public override bool ForwardCanvasGuiInput(InputEvent @event)
{
return true;
}
@@ -201,12 +201,12 @@
[codeblocks]
[gdscript]
# Consumes InputEventMouseMotion and forwards other InputEvent types.
- func _forward_spatial_gui_input(camera, event):
+ func _forward_canvas_gui_input(event):
return event is InputEventMouseMotion
[/gdscript]
[csharp]
// Consumes InputEventMouseMotion and forwards other InputEvent types.
- public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event)
+ public override bool ForwardCanvasGuiInput(InputEvent @event)
{
return @event is InputEventMouseMotion;
}
@@ -214,13 +214,13 @@
[/codeblocks]
</description>
</method>
- <method name="_get_breakpoints" qualifiers="virtual">
+ <method name="_get_breakpoints" qualifiers="virtual const">
<return type="PackedStringArray" />
<description>
This is for editors that edit script-based objects. You can return a list of breakpoints in the format ([code]script:line[/code]), for example: [code]res://path_to_script.gd:25[/code].
</description>
</method>
- <method name="_get_plugin_icon" qualifiers="virtual">
+ <method name="_get_plugin_icon" qualifiers="virtual const">
<return type="Texture2D" />
<description>
Override this method in your plugin to return a [Texture2D] in order to give it an icon.
@@ -246,14 +246,14 @@
[/codeblocks]
</description>
</method>
- <method name="_get_plugin_name" qualifiers="virtual">
+ <method name="_get_plugin_name" qualifiers="virtual const">
<return type="String" />
<description>
Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor.
For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons.
</description>
</method>
- <method name="_get_state" qualifiers="virtual">
+ <method name="_get_state" qualifiers="virtual const">
<return type="Dictionary" />
<description>
Gets the state of your plugin editor. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns).
@@ -261,19 +261,19 @@
</method>
<method name="_get_window_layout" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="layout" type="ConfigFile" />
+ <argument index="0" name="configuration" type="ConfigFile" />
<description>
Gets the GUI layout of the plugin. This is used to save the project's editor layout when [method queue_save_layout] is called or the editor layout was changed(For example changing the position of a dock).
</description>
</method>
- <method name="_handles" qualifiers="virtual">
+ <method name="_handles" qualifiers="virtual const">
<return type="bool" />
- <argument index="0" name="object" type="Object" />
+ <argument index="0" name="object" type="Variant" />
<description>
- Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_spatial_gui_input] these will be called too.
+ Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_3d_gui_input] these will be called too.
</description>
</method>
- <method name="_has_main_screen" qualifiers="virtual">
+ <method name="_has_main_screen" qualifiers="virtual const">
<return type="bool" />
<description>
Returns [code]true[/code] if this is a main screen editor plugin (it goes in the workspace selector together with [b]2D[/b], [b]3D[/b], [b]Script[/b] and [b]AssetLib[/b]).
@@ -302,7 +302,7 @@
</method>
<method name="_set_window_layout" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="layout" type="ConfigFile" />
+ <argument index="0" name="configuration" type="ConfigFile" />
<description>
Restore the plugin GUI layout saved by [method _get_window_layout].
</description>
@@ -586,19 +586,19 @@
<method name="set_force_draw_over_forwarding_enabled">
<return type="void" />
<description>
- Enables calling of [method _forward_canvas_force_draw_over_viewport] for the 2D editor and [method _forward_spatial_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin.
+ Enables calling of [method _forward_canvas_force_draw_over_viewport] for the 2D editor and [method _forward_3d_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin.
</description>
</method>
<method name="set_input_event_forwarding_always_enabled">
<return type="void" />
<description>
- Use this method if you always want to receive inputs from 3D view screen inside [method _forward_spatial_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene.
+ Use this method if you always want to receive inputs from 3D view screen inside [method _forward_3d_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene.
</description>
</method>
<method name="update_overlays" qualifiers="const">
<return type="int" />
<description>
- Updates the overlays of the 2D and 3D editor viewport. Causes methods [method _forward_canvas_draw_over_viewport], [method _forward_canvas_force_draw_over_viewport], [method _forward_spatial_draw_over_viewport] and [method _forward_spatial_force_draw_over_viewport] to be called.
+ Updates the overlays of the 2D and 3D editor viewport. Causes methods [method _forward_canvas_draw_over_viewport], [method _forward_canvas_force_draw_over_viewport], [method _forward_3d_draw_over_viewport] and [method _forward_3d_force_draw_over_viewport] to be called.
</description>
</method>
</methods>
diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml
index 725b0ba8ff..822bcfd255 100644
--- a/doc/classes/EditorProperty.xml
+++ b/doc/classes/EditorProperty.xml
@@ -57,6 +57,11 @@
Puts the [code]editor[/code] control below the property label. The control must be previously added using [method Node.add_child].
</description>
</method>
+ <method name="update_property">
+ <return type="void" />
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="checkable" type="bool" setter="set_checkable" getter="is_checkable" default="false">
diff --git a/doc/classes/EditorResourceConversionPlugin.xml b/doc/classes/EditorResourceConversionPlugin.xml
index 3de508c88d..8543afa4ae 100644
--- a/doc/classes/EditorResourceConversionPlugin.xml
+++ b/doc/classes/EditorResourceConversionPlugin.xml
@@ -7,17 +7,23 @@
<tutorials>
</tutorials>
<methods>
- <method name="_convert" qualifiers="virtual">
+ <method name="_convert" qualifiers="virtual const">
<return type="Resource" />
<argument index="0" name="resource" type="Resource" />
<description>
</description>
</method>
- <method name="_converts_to" qualifiers="virtual">
+ <method name="_converts_to" qualifiers="virtual const">
<return type="String" />
<description>
</description>
</method>
+ <method name="_handles" qualifiers="virtual const">
+ <return type="bool" />
+ <argument index="0" name="resource" type="Resource" />
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
diff --git a/doc/classes/EditorResourcePreviewGenerator.xml b/doc/classes/EditorResourcePreviewGenerator.xml
index 7054b1f4d0..033e03c5b5 100644
--- a/doc/classes/EditorResourcePreviewGenerator.xml
+++ b/doc/classes/EditorResourcePreviewGenerator.xml
@@ -9,41 +9,41 @@
<tutorials>
</tutorials>
<methods>
- <method name="_can_generate_small_preview" qualifiers="virtual">
+ <method name="_can_generate_small_preview" qualifiers="virtual const">
<return type="bool" />
<description>
If this function returns [code]true[/code], the generator will call [method _generate] or [method _generate_from_path] for small previews as well.
By default, it returns [code]false[/code].
</description>
</method>
- <method name="_generate" qualifiers="virtual">
+ <method name="_generate" qualifiers="virtual const">
<return type="Texture2D" />
- <argument index="0" name="from" type="Resource" />
- <argument index="1" name="size" type="Vector2" />
+ <argument index="0" name="resource" type="Resource" />
+ <argument index="1" name="size" type="Vector2i" />
<description>
Generate a preview from a given resource with the specified size. This must always be implemented.
Returning an empty texture is an OK way to fail and let another generator take care.
Care must be taken because this function is always called from a thread (not the main thread).
</description>
</method>
- <method name="_generate_from_path" qualifiers="virtual">
+ <method name="_generate_from_path" qualifiers="virtual const">
<return type="Texture2D" />
<argument index="0" name="path" type="String" />
- <argument index="1" name="size" type="Vector2" />
+ <argument index="1" name="size" type="Vector2i" />
<description>
Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call [method _generate].
Returning an empty texture is an OK way to fail and let another generator take care.
Care must be taken because this function is always called from a thread (not the main thread).
</description>
</method>
- <method name="_generate_small_preview_automatically" qualifiers="virtual">
+ <method name="_generate_small_preview_automatically" qualifiers="virtual const">
<return type="bool" />
<description>
If this function returns [code]true[/code], the generator will automatically generate the small previews from the normal preview texture generated by the methods [method _generate] or [method _generate_from_path].
By default, it returns [code]false[/code].
</description>
</method>
- <method name="_handles" qualifiers="virtual">
+ <method name="_handles" qualifiers="virtual const">
<return type="bool" />
<argument index="0" name="type" type="String" />
<description>
diff --git a/doc/classes/EditorSceneImporter.xml b/doc/classes/EditorSceneImporter.xml
index 2e9d6a43d8..a400db551f 100644
--- a/doc/classes/EditorSceneImporter.xml
+++ b/doc/classes/EditorSceneImporter.xml
@@ -8,12 +8,12 @@
<tutorials>
</tutorials>
<methods>
- <method name="_get_extensions" qualifiers="virtual">
- <return type="Array" />
+ <method name="_get_extensions" qualifiers="virtual const">
+ <return type="PackedStringArray" />
<description>
</description>
</method>
- <method name="_get_import_flags" qualifiers="virtual">
+ <method name="_get_import_flags" qualifiers="virtual const">
<return type="int" />
<description>
</description>
@@ -27,7 +27,7 @@
</description>
</method>
<method name="_import_scene" qualifiers="virtual">
- <return type="Node" />
+ <return type="Object" />
<argument index="0" name="path" type="String" />
<argument index="1" name="flags" type="int" />
<argument index="2" name="bake_fps" type="int" />
diff --git a/doc/classes/EditorSceneImporterMesh.xml b/doc/classes/EditorSceneImporterMesh.xml
index 3a9eea87bb..b0f233da2f 100644
--- a/doc/classes/EditorSceneImporterMesh.xml
+++ b/doc/classes/EditorSceneImporterMesh.xml
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorSceneImporterMesh" inherits="Resource" version="4.0">
<brief_description>
+ A [Resource] that contains vertex array-based geometry during the import process.
</brief_description>
<description>
+ EditorSceneImporterMesh is a type of [Resource] analogous to [ArrayMesh]. It contains vertex array-based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.
+
+ Unlike its runtime counterpart, [EditorSceneImporterMesh] contains mesh data before various import steps, such as lod and shadow mesh generation, have taken place. Modify surface data by calling [method clear], followed by [method add_surface] for each surface.
</description>
<tutorials>
</tutorials>
@@ -11,6 +15,7 @@
<return type="void" />
<argument index="0" name="name" type="String" />
<description>
+ Adds name for a blend shape that will be added with [method add_surface]. Must be called before surface is added.
</description>
</method>
<method name="add_surface">
@@ -23,44 +28,56 @@
<argument index="4" name="material" type="Material" default="null" />
<argument index="5" name="name" type="String" default="&quot;&quot;" />
<description>
+ Creates a new surface, analogous to [method ArrayMesh.add_surface_from_arrays].
+ Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
+ The [code]arrays[/code] argument is an array of arrays. See [enum Mesh.ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant Mesh.ARRAY_INDEX] if it is used.
</description>
</method>
<method name="clear">
<return type="void" />
<description>
+ Removes all surfaces and blend shapes from this [EditorSceneImporterMesh].
</description>
</method>
<method name="get_blend_shape_count" qualifiers="const">
<return type="int" />
<description>
+ Returns the number of blend shapes that the mesh holds.
</description>
</method>
<method name="get_blend_shape_mode" qualifiers="const">
<return type="int" enum="Mesh.BlendShapeMode" />
<description>
+ Returns the blend shape mode for this Mesh.
</description>
</method>
<method name="get_blend_shape_name" qualifiers="const">
<return type="String" />
<argument index="0" name="blend_shape_idx" type="int" />
<description>
+ Returns the name of the blend shape at this index.
</description>
</method>
<method name="get_lightmap_size_hint" qualifiers="const">
<return type="Vector2i" />
<description>
+ Returns the size hint of this mesh for lightmap-unwrapping in UV-space.
</description>
</method>
<method name="get_mesh">
<return type="ArrayMesh" />
- <argument index="0" name="arg0" type="Mesh" />
+ <argument index="0" name="base_mesh" type="ArrayMesh" default="null" />
<description>
+ Returns the mesh data represented by this [EditorSceneImporterMesh] as a usable [ArrayMesh].
+ This method caches the returned mesh, and subsequent calls will return the cached data until [method clear] is called.
+ If not yet cached and [code]base_mesh[/code] is provided, [code]base_mesh[/code] will be used and mutated.
</description>
</method>
<method name="get_surface_arrays" qualifiers="const">
<return type="Array" />
<argument index="0" name="surface_idx" type="int" />
<description>
+ Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface. See [method add_surface].
</description>
</method>
<method name="get_surface_blend_shape_arrays" qualifiers="const">
@@ -68,17 +85,20 @@
<argument index="0" name="surface_idx" type="int" />
<argument index="1" name="blend_shape_idx" type="int" />
<description>
+ Returns a single set of blend shape arrays for the requested blend shape index for a surface.
</description>
</method>
<method name="get_surface_count" qualifiers="const">
<return type="int" />
<description>
+ Returns the amount of surfaces that the mesh holds.
</description>
</method>
<method name="get_surface_lod_count" qualifiers="const">
<return type="int" />
<argument index="0" name="surface_idx" type="int" />
<description>
+ Returns the amount of lods that the mesh holds on a given surface.
</description>
</method>
<method name="get_surface_lod_indices" qualifiers="const">
@@ -86,6 +106,7 @@
<argument index="0" name="surface_idx" type="int" />
<argument index="1" name="lod_idx" type="int" />
<description>
+ Returns the index buffer of a lod for a surface.
</description>
</method>
<method name="get_surface_lod_size" qualifiers="const">
@@ -93,36 +114,58 @@
<argument index="0" name="surface_idx" type="int" />
<argument index="1" name="lod_idx" type="int" />
<description>
+ Returns the screen ratio which activates a lod for a surface.
</description>
</method>
<method name="get_surface_material" qualifiers="const">
<return type="Material" />
<argument index="0" name="surface_idx" type="int" />
<description>
+ Returns a [Material] in a given surface. Surface is rendered using this material.
</description>
</method>
<method name="get_surface_name" qualifiers="const">
<return type="String" />
<argument index="0" name="surface_idx" type="int" />
<description>
+ Gets the name assigned to this surface.
</description>
</method>
<method name="get_surface_primitive_type">
<return type="int" enum="Mesh.PrimitiveType" />
<argument index="0" name="surface_idx" type="int" />
<description>
+ Returns the primitive type of the requested surface (see [method add_surface]).
</description>
</method>
<method name="set_blend_shape_mode">
<return type="void" />
<argument index="0" name="mode" type="int" enum="Mesh.BlendShapeMode" />
<description>
+ Sets the blend shape mode to one of [enum Mesh.BlendShapeMode].
</description>
</method>
<method name="set_lightmap_size_hint">
<return type="void" />
<argument index="0" name="size" type="Vector2i" />
<description>
+ Sets the size hint of this mesh for lightmap-unwrapping in UV-space.
+ </description>
+ </method>
+ <method name="set_surface_material">
+ <return type="void" />
+ <argument index="0" name="surface_idx" type="int" />
+ <argument index="1" name="material" type="Material" />
+ <description>
+ Sets a [Material] for a given surface. Surface will be rendered using this material.
+ </description>
+ </method>
+ <method name="set_surface_name">
+ <return type="void" />
+ <argument index="0" name="surface_idx" type="int" />
+ <argument index="1" name="name" type="String" />
+ <description>
+ Sets a name for a given surface.
</description>
</method>
</methods>
diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml
index 95b0b42d9f..43ca3db5fa 100644
--- a/doc/classes/EditorScenePostImport.xml
+++ b/doc/classes/EditorScenePostImport.xml
@@ -57,7 +57,7 @@
<methods>
<method name="_post_import" qualifiers="virtual">
<return type="Object" />
- <argument index="0" name="scene" type="Object" />
+ <argument index="0" name="scene" type="Node" />
<description>
Called after the scene was imported. This method must return the modified version of the scene.
</description>
diff --git a/doc/classes/EditorSyntaxHighlighter.xml b/doc/classes/EditorSyntaxHighlighter.xml
index 37644a8595..394a4ada46 100644
--- a/doc/classes/EditorSyntaxHighlighter.xml
+++ b/doc/classes/EditorSyntaxHighlighter.xml
@@ -5,24 +5,18 @@
</brief_description>
<description>
Base syntax highlighter resource all editor syntax highlighters extend from, it is used in the [ScriptEditor].
- Add a syntax highlighter to an individual script by calling [method ScriptEditorBase._add_syntax_highlighter]. To apply to all scripts on open, call [method ScriptEditor.register_syntax_highlighter]
+ Add a syntax highlighter to an individual script by calling ScriptEditorBase._add_syntax_highlighter (currently not working). To apply to all scripts on open, call [method ScriptEditor.register_syntax_highlighter]
</description>
<tutorials>
</tutorials>
<methods>
- <method name="_get_name" qualifiers="virtual">
+ <method name="_get_name" qualifiers="virtual const">
<return type="String" />
<description>
Virtual method which can be overridden to return the syntax highlighter name.
</description>
</method>
- <method name="_get_supported_extentions" qualifiers="virtual">
- <return type="Array" />
- <description>
- Virtual method which can be overridden to return the supported file extensions.
- </description>
- </method>
- <method name="_get_supported_languages" qualifiers="virtual">
+ <method name="_get_supported_languages" qualifiers="virtual const">
<return type="Array" />
<description>
Virtual method which can be overridden to return the supported language names.
diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml
index 47da8ec37b..94e96e985f 100644
--- a/doc/classes/EditorTranslationParserPlugin.xml
+++ b/doc/classes/EditorTranslationParserPlugin.xml
@@ -102,8 +102,8 @@
<tutorials>
</tutorials>
<methods>
- <method name="_get_recognized_extensions" qualifiers="virtual">
- <return type="Array" />
+ <method name="_get_recognized_extensions" qualifiers="virtual const">
+ <return type="PackedStringArray" />
<description>
Gets the list of file extensions to associate with this parser, e.g. [code]["csv"][/code].
</description>
diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml
index 886a18900e..8b399f64c9 100644
--- a/doc/classes/Engine.xml
+++ b/doc/classes/Engine.xml
@@ -84,11 +84,16 @@
</method>
<method name="get_singleton" qualifiers="const">
<return type="Object" />
- <argument index="0" name="name" type="String" />
+ <argument index="0" name="name" type="StringName" />
<description>
Returns a global singleton with given [code]name[/code]. Often used for plugins, e.g. GodotPayments.
</description>
</method>
+ <method name="get_singleton_list" qualifiers="const">
+ <return type="PackedStringArray" />
+ <description>
+ </description>
+ </method>
<method name="get_version_info" qualifiers="const">
<return type="Dictionary" />
<description>
@@ -125,7 +130,7 @@
</method>
<method name="has_singleton" qualifiers="const">
<return type="bool" />
- <argument index="0" name="name" type="String" />
+ <argument index="0" name="name" type="StringName" />
<description>
Returns [code]true[/code] if a singleton with given [code]name[/code] exists in global scope.
</description>
@@ -136,6 +141,19 @@
Returns [code]true[/code] if the game is inside the fixed process and physics phase of the game loop.
</description>
</method>
+ <method name="register_singleton">
+ <return type="void" />
+ <argument index="0" name="name" type="StringName" />
+ <argument index="1" name="instance" type="Object" />
+ <description>
+ </description>
+ </method>
+ <method name="unregister_singleton">
+ <return type="void" />
+ <argument index="0" name="name" type="StringName" />
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="editor_hint" type="bool" setter="set_editor_hint" getter="is_editor_hint" default="true">
diff --git a/doc/classes/File.xml b/doc/classes/File.xml
index 6622619fb3..8ecdc8b220 100644
--- a/doc/classes/File.xml
+++ b/doc/classes/File.xml
@@ -438,7 +438,7 @@
Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file.
</constant>
<constant name="COMPRESSION_FASTLZ" value="0" enum="CompressionMode">
- Uses the [url=http://fastlz.org/]FastLZ[/url] compression method.
+ Uses the [url=https://fastlz.org/]FastLZ[/url] compression method.
</constant>
<constant name="COMPRESSION_DEFLATE" value="1" enum="CompressionMode">
Uses the [url=https://en.wikipedia.org/wiki/DEFLATE]DEFLATE[/url] compression method.
diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml
index 06dcaca846..aa70856e32 100644
--- a/doc/classes/Font.xml
+++ b/doc/classes/Font.xml
@@ -70,6 +70,12 @@
Add font data source to the set.
</description>
</method>
+ <method name="clear_data">
+ <return type="void" />
+ <description>
+ Removes all font data sourcers for the set.
+ </description>
+ </method>
<method name="draw_char" qualifiers="const">
<return type="float" />
<argument index="0" name="canvas_item" type="RID" />
@@ -151,6 +157,13 @@
Returns the number of font data sources.
</description>
</method>
+ <method name="get_data_rid" qualifiers="const">
+ <return type="RID" />
+ <argument index="0" name="idx" type="int" />
+ <description>
+ Returns TextServer RID of the font data resources.
+ </description>
+ </method>
<method name="get_descent" qualifiers="const">
<return type="float" />
<argument index="0" name="size" type="int" default="-1" />
@@ -180,15 +193,18 @@
</method>
<method name="get_spacing" qualifiers="const">
<return type="int" />
- <argument index="0" name="type" type="int" />
+ <argument index="0" name="spacing" type="int" enum="TextServer.SpacingType" />
<description>
- Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
+ Returns the spacing for the given [code]type[/code] (see [enum TextServer.SpacingType]).
</description>
</method>
<method name="get_string_size" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="text" type="String" />
<argument index="1" name="size" type="int" default="-1" />
+ <argument index="2" name="align" type="int" enum="HAlign" default="0" />
+ <argument index="3" name="width" type="float" default="-1" />
+ <argument index="4" name="flags" type="int" default="3" />
<description>
Returns the size of a bounding box of a string, taking kerning and advance into account.
[b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by [method get_height].
@@ -242,10 +258,10 @@
</method>
<method name="set_spacing">
<return type="void" />
- <argument index="0" name="type" type="int" />
+ <argument index="0" name="spacing" type="int" enum="TextServer.SpacingType" />
<argument index="1" name="value" type="int" />
<description>
- Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
+ Sets the spacing for [code]type[/code] (see [enum TextServer.SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
</description>
</method>
<method name="update_changes">
@@ -256,19 +272,19 @@
</method>
</methods>
<members>
- <member name="extra_spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0">
+ <member name="base_size" type="int" setter="set_base_size" getter="get_base_size" default="16">
+ Default font size.
+ </member>
+ <member name="spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0">
Extra spacing at the bottom of the line in pixels.
</member>
- <member name="extra_spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0">
+ <member name="spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0">
Extra spacing at the top of the line in pixels.
</member>
+ <member name="variation_coordinates" type="Dictionary" setter="set_variation_coordinates" getter="get_variation_coordinates" default="{}">
+ Default font [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url].
+ </member>
</members>
<constants>
- <constant name="SPACING_TOP" value="0" enum="SpacingType">
- Spacing at the top of the line.
- </constant>
- <constant name="SPACING_BOTTOM" value="1" enum="SpacingType">
- Spacing at the bottom of the line.
- </constant>
</constants>
</class>
diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml
index 7a845a698f..72af7ca485 100644
--- a/doc/classes/FontData.xml
+++ b/doc/classes/FontData.xml
@@ -1,122 +1,179 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="FontData" inherits="Resource" version="4.0">
<brief_description>
- Font data source, file or memory buffer.
+ Font source data and prerendered glyph cache, imported from dynamic or bitmap font.
+ Supported font formats:
+ - Dynamic font importer: TrueType (.ttf), OpenType (.otf), WOFF (.woff), Type 1 (.pfb, .pfm).
+ - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants.
+ - Monospace image font importer: All supported image formats.
</brief_description>
<description>
- Built-in text servers support font data sources of the following formats:
- - Bitmap fonts in the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format. Handles [code].fnt, *.font[/code] fonts containing texture atlases. Non-scalable. Supports distance fields. Complex text shaping support is limited.
- - Dynamic fonts using the [url=https://www.freetype.org/]FreeType[/url] and [url=https://github.com/silnrsi/graphite/]Graphite[/url] library for rasterization. Handles [code]*.ttf, *.otf[/code] fonts. Scalable. Doesn't support distance fields. Supports complex text shaping and OpenType features.
</description>
<tutorials>
</tutorials>
<methods>
- <method name="bitmap_add_char">
+ <method name="clear_cache">
<return type="void" />
- <argument index="0" name="char" type="int" />
- <argument index="1" name="texture_idx" type="int" />
- <argument index="2" name="rect" type="Rect2" />
- <argument index="3" name="align" type="Vector2" />
- <argument index="4" name="advance" type="float" />
<description>
- Adds a character to the font, where [code]character[/code] is the Unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance.
+ Removes all font cache entries.
</description>
</method>
- <method name="bitmap_add_kerning_pair">
+ <method name="clear_glyphs">
<return type="void" />
- <argument index="0" name="A" type="int" />
- <argument index="1" name="B" type="int" />
- <argument index="2" name="kerning" type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
<description>
- Adds a kerning pair to the bitmap font as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
+ Removes all rendered glyphs information from the cache entry. Note: This function will not remove textures associated with the glyphs, use [method remove_texture] to remove them manually.
</description>
</method>
- <method name="bitmap_add_texture">
+ <method name="clear_kerning_map">
<return type="void" />
- <argument index="0" name="texture" type="Texture" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
<description>
- Adds a texture to the bitmap font.
+ Removes all kerning overrides.
</description>
</method>
- <method name="draw_glyph" qualifiers="const">
- <return type="Vector2" />
- <argument index="0" name="canvas" type="RID" />
- <argument index="1" name="size" type="int" />
- <argument index="2" name="pos" type="Vector2" />
- <argument index="3" name="index" type="int" />
- <argument index="4" name="color" type="Color" default="Color(1, 1, 1, 1)" />
+ <method name="clear_size_cache">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
<description>
- Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
- Returns advance of the glyph for horizontal and vertical layouts.
- Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+ Removes all font sizes from the cache entry
</description>
</method>
- <method name="draw_glyph_outline" qualifiers="const">
- <return type="Vector2" />
- <argument index="0" name="canvas" type="RID" />
- <argument index="1" name="size" type="int" />
- <argument index="2" name="outline_size" type="int" />
- <argument index="3" name="pos" type="Vector2" />
- <argument index="4" name="index" type="int" />
- <argument index="5" name="color" type="Color" default="Color(1, 1, 1, 1)" />
+ <method name="clear_textures">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <description>
+ Removes all textures from font cache entry. Note: This function will not remove glyphs associated with the texture, use [method remove_glyph] to remove them manually.
+ </description>
+ </method>
+ <method name="find_cache" qualifiers="const">
+ <return type="RID" />
+ <argument index="0" name="variation_coordinates" type="Dictionary" />
<description>
- Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code]. If outline drawing is not supported, nothing is drawn.
- Returns advance of the glyph for horizontal and vertical layouts (regardless of outline drawing support).
- Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+ Returns existing or creates a new font cache entry for the specified variation coordinates.
</description>
</method>
<method name="get_ascent" qualifiers="const">
<return type="float" />
- <argument index="0" name="size" type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
<description>
Returns the font ascent (number of pixels above the baseline).
</description>
</method>
- <method name="get_base_size" qualifiers="const">
- <return type="float" />
+ <method name="get_cache_count" qualifiers="const">
+ <return type="int" />
<description>
- Returns the base size of the font (the only size supported for non-scalable fonts, meaningless for scalable fonts).
+ Returns number of the font cache entries.
+ </description>
+ </method>
+ <method name="get_cache_rid" qualifiers="const">
+ <return type="RID" />
+ <argument index="0" name="cache_index" type="int" />
+ <description>
+ Returns text server font cache entry resource id.
+ </description>
+ </method>
+ <method name="get_data" qualifiers="const">
+ <return type="PackedByteArray" />
+ <description>
+ Returns contents of the dynamic font source file.
</description>
</method>
<method name="get_descent" qualifiers="const">
<return type="float" />
- <argument index="0" name="size" type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
<description>
- Returns the font descent (number of pixels below the baseline).
+ Returns font descent (number of pixels below the baseline).
</description>
</method>
<method name="get_glyph_advance" qualifiers="const">
<return type="Vector2" />
- <argument index="0" name="index" type="int" />
+ <argument index="0" name="cache_index" type="int" />
<argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph" type="int" />
<description>
- Returns advance of the glyph for horizontal and vertical layouts.
- Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+ Returns glyph advance (offset of the next glyph). Note: advance for glyphs outlines is the same as the base glyph advance and is not saved.
</description>
</method>
<method name="get_glyph_index" qualifiers="const">
<return type="int" />
<argument index="0" name="char" type="int" />
- <argument index="1" name="variation_selector" type="int" default="0" />
+ <argument index="1" name="variation_selector" type="int" />
+ <argument index="2" name="arg2" type="int" />
<description>
- Return the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
+ Returns the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
</description>
</method>
- <method name="get_glyph_kerning" qualifiers="const">
+ <method name="get_glyph_list" qualifiers="const">
+ <return type="Array" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <description>
+ Returns list of rendered glyphs in the cache entry.
+ </description>
+ </method>
+ <method name="get_glyph_offset" qualifiers="const">
<return type="Vector2" />
- <argument index="0" name="index_a" type="int" />
- <argument index="1" name="index_b" type="int" />
- <argument index="2" name="size" type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
<description>
- Returns a kerning of the pair of glyphs for horizontal and vertical layouts.
- Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+ Returns glyph offset from the baseline.
</description>
</method>
- <method name="get_height" qualifiers="const">
- <return type="float" />
- <argument index="0" name="size" type="int" />
+ <method name="get_glyph_size" qualifiers="const">
+ <return type="Vector2" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
<description>
- Returns the total font height (ascent plus descent) in pixels.
+ Returns glyph size.
+ </description>
+ </method>
+ <method name="get_glyph_texture_idx" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <description>
+ Returns index of the cache texture containing the glyph.
+ </description>
+ </method>
+ <method name="get_glyph_uv_rect" qualifiers="const">
+ <return type="Rect2" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <description>
+ Returns rectangle in the cache texture containing the glyph.
+ </description>
+ </method>
+ <method name="get_hinting" qualifiers="const">
+ <return type="int" enum="TextServer.Hinting" />
+ <description>
+ Returns the font hinting mode. Used by dynamic fonts only.
+ </description>
+ </method>
+ <method name="get_kerning" qualifiers="const">
+ <return type="Vector2" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph_pair" type="Vector2i" />
+ <description>
+ Returns kerning for the pair of glyphs.
+ </description>
+ </method>
+ <method name="get_kerning_list" qualifiers="const">
+ <return type="Array" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <description>
+ Returns list of the kerning overrides.
</description>
</method>
<method name="get_language_support_override" qualifiers="const">
@@ -132,6 +189,32 @@
Returns list of language support overrides.
</description>
</method>
+ <method name="get_msdf_pixel_range" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the width of the range around the shape between the minimum and maximum representable signed distance.
+ </description>
+ </method>
+ <method name="get_msdf_size" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns source font size used to generate MSDF textures.
+ </description>
+ </method>
+ <method name="get_oversampling" qualifiers="const">
+ <return type="float" />
+ <description>
+ Returns font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only.
+ </description>
+ </method>
+ <method name="get_scale" qualifiers="const">
+ <return type="float" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <description>
+ Returns scaling factor of the color bitmap font.
+ </description>
+ </method>
<method name="get_script_support_override" qualifiers="const">
<return type="bool" />
<argument index="0" name="script" type="String" />
@@ -145,11 +228,20 @@
Returns list of script support overrides.
</description>
</method>
+ <method name="get_size_cache_list" qualifiers="const">
+ <return type="Array" />
+ <argument index="0" name="cache_index" type="int" />
+ <description>
+ Return list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size.
+ </description>
+ </method>
<method name="get_spacing" qualifiers="const">
<return type="int" />
- <argument index="0" name="type" type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="arg2" type="int" enum="TextServer.SpacingType" />
<description>
- Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
+ Returns extra spacing added between glyphs in pixels.
</description>
</method>
<method name="get_supported_chars" qualifiers="const">
@@ -158,32 +250,66 @@
Returns a string containing all the characters available in the font.
</description>
</method>
- <method name="get_underline_position" qualifiers="const">
- <return type="float" />
- <argument index="0" name="size" type="int" />
+ <method name="get_supported_feature_list" qualifiers="const">
+ <return type="Dictionary" />
<description>
- Returns underline offset (number of pixels below the baseline).
+ Returns list of OpenType features supported by font.
</description>
</method>
- <method name="get_underline_thickness" qualifiers="const">
+ <method name="get_supported_variation_list" qualifiers="const">
+ <return type="Dictionary" />
+ <description>
+ Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code].
+ Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant.
+ </description>
+ </method>
+ <method name="get_texture_count" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <description>
+ Returns number of textures used by font cache entry.
+ </description>
+ </method>
+ <method name="get_texture_image" qualifiers="const">
+ <return type="Image" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <description>
+ Returns a copy of the font cache texture image.
+ </description>
+ </method>
+ <method name="get_texture_offsets" qualifiers="const">
+ <return type="PackedInt32Array" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <description>
+ Returns a copy of the array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty.
+ </description>
+ </method>
+ <method name="get_underline_position" qualifiers="const">
<return type="float" />
- <argument index="0" name="size" type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
<description>
- Returns underline thickness in pixels.
+ Returns pixel offset of the underline below the baseline.
</description>
</method>
- <method name="get_variation" qualifiers="const">
+ <method name="get_underline_thickness" qualifiers="const">
<return type="float" />
- <argument index="0" name="tag" type="String" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
<description>
- Returns variation coordinate [code]tag[/code].
+ Returns thickness of the underline in pixels.
</description>
</method>
- <method name="get_variation_list" qualifiers="const">
+ <method name="get_variation_coordinates" qualifiers="const">
<return type="Dictionary" />
+ <argument index="0" name="cache_index" type="int" />
<description>
- Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code].
- Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant.
+ Returns variation coordinates for the specified font cache entry. See [method get_supported_variation_list] for more info.
</description>
</method>
<method name="has_char" qualifiers="const">
@@ -193,10 +319,16 @@
Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
</description>
</method>
- <method name="has_outline" qualifiers="const">
+ <method name="is_antialiased" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if font 8-bit anitialiased glyph rendering is supported and enabled.
+ </description>
+ </method>
+ <method name="is_force_autohinter" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code], if font supports drawing glyph outlines.
+ Returns [code]true[/code] if auto-hinting is supported and preffered over font built-in hinting. Used by dynamic fonts only.
</description>
</method>
<method name="is_language_supported" qualifiers="const">
@@ -206,6 +338,12 @@
Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code).
</description>
</method>
+ <method name="is_multichannel_signed_distance_field" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
+ </description>
+ </method>
<method name="is_script_supported" qualifiers="const">
<return type="bool" />
<argument index="0" name="script" type="String" />
@@ -213,32 +351,29 @@
Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code).
</description>
</method>
- <method name="load_memory">
+ <method name="remove_cache">
<return type="void" />
- <argument index="0" name="data" type="PackedByteArray" />
- <argument index="1" name="type" type="String" />
- <argument index="2" name="base_size" type="int" default="16" />
+ <argument index="0" name="cache_index" type="int" />
<description>
- Creates new font from the data in memory.
- Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
+ Removes specified font cache entry.
</description>
</method>
- <method name="load_resource">
+ <method name="remove_glyph">
<return type="void" />
- <argument index="0" name="filename" type="String" />
- <argument index="1" name="base_size" type="int" default="16" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
<description>
- Creates new font from the file.
- Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
+ Removes specified rendered glyph information from the cache entry. Note: This function will not remove textures associated with the glyphs, use [method remove_texture] to remove them manually.
</description>
</method>
- <method name="new_bitmap">
+ <method name="remove_kerning">
<return type="void" />
- <argument index="0" name="height" type="float" />
- <argument index="1" name="ascent" type="float" />
- <argument index="2" name="base_size" type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph_pair" type="Vector2i" />
<description>
- Creates new, empty bitmap font.
+ Removes kerning override for the pair of glyphs.
</description>
</method>
<method name="remove_language_support_override">
@@ -255,6 +390,148 @@
Removes script support override.
</description>
</method>
+ <method name="remove_size_cache">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <description>
+ Removes specified font size from the cache entry.
+ </description>
+ </method>
+ <method name="remove_texture">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <description>
+ Removes specified texture from font cache entry. Note: This function will not remove glyphs associated with the texture, remove them manually, using [method remove_glyph].
+ </description>
+ </method>
+ <method name="render_glyph">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="index" type="int" />
+ <description>
+ Renders specified glyph the the font cache texture.
+ </description>
+ </method>
+ <method name="render_range">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="start" type="int" />
+ <argument index="3" name="end" type="int" />
+ <description>
+ Renders the range of characters to the font cache texture.
+ </description>
+ </method>
+ <method name="set_antialiased">
+ <return type="void" />
+ <argument index="0" name="antialiased" type="bool" />
+ <description>
+ If set to [code]true[/code], 8-bit antialiased glyph rendering is used, otherwise 1-bit rendering is used. Used by dynamic fonts only.
+ </description>
+ </method>
+ <method name="set_ascent">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="ascent" type="float" />
+ <description>
+ Sets the font ascent (number of pixels above the baseline).
+ </description>
+ </method>
+ <method name="set_data">
+ <return type="void" />
+ <argument index="0" name="data" type="PackedByteArray" />
+ <description>
+ Sets font source data, e.g contents of the dynamic font source file.
+ </description>
+ </method>
+ <method name="set_descent">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="descent" type="float" />
+ <description>
+ Sets the font descent (number of pixels below the baseline).
+ </description>
+ </method>
+ <method name="set_force_autohinter">
+ <return type="void" />
+ <argument index="0" name="force_autohinter" type="bool" />
+ <description>
+ If set to [code]true[/code] auto-hinting is preffered over font built-in hinting.
+ </description>
+ </method>
+ <method name="set_glyph_advance">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="advance" type="Vector2" />
+ <description>
+ Sets glyph advance (offset of the next glyph). Note: advance for glyphs outlines is the same as the base glyph advance and is not saved.
+ </description>
+ </method>
+ <method name="set_glyph_offset">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="offset" type="Vector2" />
+ <description>
+ Sets glyph offset from the baseline.
+ </description>
+ </method>
+ <method name="set_glyph_size">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="gl_size" type="Vector2" />
+ <description>
+ Sets glyph size.
+ </description>
+ </method>
+ <method name="set_glyph_texture_idx">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="texture_idx" type="int" />
+ <description>
+ Sets index of the cache texture containing the glyph.
+ </description>
+ </method>
+ <method name="set_glyph_uv_rect">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="uv_rect" type="Rect2" />
+ <description>
+ Sets rectangle in the cache texture containing the glyph.
+ </description>
+ </method>
+ <method name="set_hinting">
+ <return type="void" />
+ <argument index="0" name="hinting" type="int" enum="TextServer.Hinting" />
+ <description>
+ Sets font hinting mode. Used by dynamic fonts only.
+ </description>
+ </method>
+ <method name="set_kerning">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph_pair" type="Vector2i" />
+ <argument index="3" name="kerning" type="Vector2" />
+ <description>
+ Sets kerning for the pair of glyphs.
+ </description>
+ </method>
<method name="set_language_support_override">
<return type="void" />
<argument index="0" name="language" type="String" />
@@ -263,6 +540,43 @@
Adds override for [method is_language_supported].
</description>
</method>
+ <method name="set_msdf_pixel_range">
+ <return type="void" />
+ <argument index="0" name="msdf_pixel_range" type="int" />
+ <description>
+ Sets the width of the range around the shape between the minimum and maximum representable signed distance.
+ </description>
+ </method>
+ <method name="set_msdf_size">
+ <return type="void" />
+ <argument index="0" name="msdf_size" type="int" />
+ <description>
+ Sets source font size used to generate MSDF textures.
+ </description>
+ </method>
+ <method name="set_multichannel_signed_distance_field">
+ <return type="void" />
+ <argument index="0" name="msdf" type="bool" />
+ <description>
+ If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
+ </description>
+ </method>
+ <method name="set_oversampling">
+ <return type="void" />
+ <argument index="0" name="oversampling" type="float" />
+ <description>
+ Sets font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only.
+ </description>
+ </method>
+ <method name="set_scale">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="scale" type="float" />
+ <description>
+ Sets scaling factor of the color bitmap font.
+ </description>
+ </method>
<method name="set_script_support_override">
<return type="void" />
<argument index="0" name="script" type="String" />
@@ -273,52 +587,61 @@
</method>
<method name="set_spacing">
<return type="void" />
- <argument index="0" name="type" type="int" />
- <argument index="1" name="value" type="int" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" />
+ <argument index="3" name="arg3" type="int" />
+ <description>
+ Sets extra spacing added between glyphs in pixels.
+ </description>
+ </method>
+ <method name="set_texture_image">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <argument index="3" name="image" type="Image" />
+ <description>
+ Sets font cache texture image.
+ </description>
+ </method>
+ <method name="set_texture_offsets">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <argument index="3" name="offset" type="PackedInt32Array" />
+ <description>
+ Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty (for the fonts without dynamic glyph generation support).
+ </description>
+ </method>
+ <method name="set_underline_position">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="underline_position" type="float" />
+ <description>
+ Sets pixel offset of the underline below the baseline.
+ </description>
+ </method>
+ <method name="set_underline_thickness">
+ <return type="void" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="underline_thickness" type="float" />
<description>
- Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
+ Sets thickness of the underline in pixels.
</description>
</method>
- <method name="set_variation">
+ <method name="set_variation_coordinates">
<return type="void" />
- <argument index="0" name="tag" type="String" />
- <argument index="1" name="value" type="float" />
+ <argument index="0" name="cache_index" type="int" />
+ <argument index="1" name="variation_coordinates" type="Dictionary" />
<description>
- Sets variation coordinate [code]tag[/code].
+ Sets variation coordinates for the specified font cache entry. See [method get_supported_variation_list] for more info.
</description>
</method>
</methods>
- <members>
- <member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" default="false">
- If [code]true[/code], the font is rendered with anti-aliasing.
- </member>
- <member name="data_path" type="String" setter="set_data_path" getter="get_data_path" default="&quot;&quot;">
- The path to the font data file. If font data was loaded from memory location is set to [code]"(Memory)"[/code].
- </member>
- <member name="distance_field_hint" type="bool" setter="set_distance_field_hint" getter="get_distance_field_hint" default="false">
- If [code]true[/code], distance field hint is enabled.
- </member>
- <member name="extra_spacing_glyph" type="int" setter="set_spacing" getter="get_spacing" default="0">
- Extra spacing for each glyph in pixels.
- This can be a negative number to make the distance between glyphs smaller.
- </member>
- <member name="extra_spacing_space" type="int" setter="set_spacing" getter="get_spacing" default="0">
- Extra spacing for the space character in pixels.
- This can be a negative number to make the distance between words smaller.
- </member>
- <member name="force_autohinter" type="bool" setter="set_force_autohinter" getter="get_force_autohinter" default="false">
- If [code]true[/code], default autohinter is used for font hinting.
- </member>
- <member name="hinting" type="int" setter="set_hinting" getter="get_hinting" enum="TextServer.Hinting" default="0">
- The font hinting mode used by FreeType. See [enum TextServer.Hinting] for options.
- </member>
- </members>
<constants>
- <constant name="SPACING_GLYPH" value="0" enum="SpacingType">
- Spacing for each glyph.
- </constant>
- <constant name="SPACING_SPACE" value="1" enum="SpacingType">
- Spacing for the space character.
- </constant>
</constants>
</class>
diff --git a/doc/classes/GradientTexture.xml b/doc/classes/GradientTexture.xml
index 242a78b2e4..44da042dd4 100644
--- a/doc/classes/GradientTexture.xml
+++ b/doc/classes/GradientTexture.xml
@@ -14,6 +14,9 @@
<member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient">
The [Gradient] that will be used to fill the texture.
</member>
+ <member name="use_hdr" type="bool" setter="set_use_hdr" getter="is_using_hdr" default="false">
+ If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format).
+ </member>
<member name="width" type="int" setter="set_width" getter="get_width" default="2048">
The number of color samples that will be obtained from the [Gradient].
</member>
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml
index 907cf8587d..c870026d58 100644
--- a/doc/classes/GraphEdit.xml
+++ b/doc/classes/GraphEdit.xml
@@ -10,6 +10,14 @@
<tutorials>
</tutorials>
<methods>
+ <method name="_get_connection_line" qualifiers="virtual const">
+ <return type="PackedVector2Array" />
+ <argument index="0" name="from" type="Vector2" />
+ <argument index="1" name="to" type="Vector2" />
+ <description>
+ Virtual method which can be overridden to customize how connections are drawn.
+ </description>
+ </method>
<method name="add_valid_connection_type">
<return type="void" />
<argument index="0" name="from_type" type="int" />
@@ -64,6 +72,14 @@
Removes the connection between the [code]from_port[/code] slot of the [code]from[/code] GraphNode and the [code]to_port[/code] slot of the [code]to[/code] GraphNode. If the connection does not exist, no connection is removed.
</description>
</method>
+ <method name="get_connection_line">
+ <return type="PackedVector2Array" />
+ <argument index="0" name="from" type="Vector2" />
+ <argument index="1" name="to" type="Vector2" />
+ <description>
+ Returns the points which would make up a connection between [code]from[/code] and [code]to[/code].
+ </description>
+ </method>
<method name="get_connection_list" qualifiers="const">
<return type="Array" />
<description>
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index 22398cc3ce..861627b526 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -138,7 +138,7 @@
<argument index="3" name="body" type="String" default="&quot;&quot;" />
<description>
Sends a request to the connected host.
- The URL parameter is usually just the part after the host, so for [code]http://somehost.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
+ The URL parameter is usually just the part after the host, so for [code]https://somehost.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
Headers are HTTP request headers. For available HTTP methods, see [enum Method].
To create a POST request with query strings to push to the server, do:
[codeblocks]
@@ -166,7 +166,7 @@
<argument index="3" name="body" type="PackedByteArray" />
<description>
Sends a raw request to the connected host.
- The URL parameter is usually just the part after the host, so for [code]http://somehost.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
+ The URL parameter is usually just the part after the host, so for [code]https://somehost.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
Headers are HTTP request headers. For available HTTP methods, see [enum Method].
Sends the body data raw, as a byte array and does not encode it in any way.
</description>
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index 34c5fb582e..5d79e22c49 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -180,6 +180,7 @@
<argument index="0" name="renormalize" type="bool" default="false" />
<description>
Generates mipmaps for the image. Mipmaps are precalculated lower-resolution copies of the image that are automatically used if the image needs to be scaled down when rendered. They help improve image quality and performance when rendering. This method returns an error if the image is compressed, in a custom format, or if the image's width/height is [code]0[/code].
+ [b]Note:[/b] Mipmap generation is done on the CPU, is single-threaded and is [i]always[/i] done on the main thread. This means generating mipmaps will result in noticeable stuttering during gameplay, even if [method generate_mipmaps] is called from a [Thread].
</description>
</method>
<method name="get_data" qualifiers="const">
diff --git a/doc/classes/TextFile.xml b/doc/classes/InputEventShortcut.xml
index 1c2c2ff25c..35cca02cf7 100644
--- a/doc/classes/TextFile.xml
+++ b/doc/classes/InputEventShortcut.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="TextFile" inherits="Resource" version="4.0">
+<class name="InputEventShortcut" inherits="InputEvent" version="4.0">
<brief_description>
</brief_description>
<description>
@@ -8,6 +8,10 @@
</tutorials>
<methods>
</methods>
+ <members>
+ <member name="shortcut" type="Shortcut" setter="set_shortcut" getter="get_shortcut">
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml
index 06e98f7e57..e3e4a9fa7d 100644
--- a/doc/classes/ItemList.xml
+++ b/doc/classes/ItemList.xml
@@ -403,6 +403,9 @@
<member name="select_mode" type="int" setter="set_select_mode" getter="get_select_mode" enum="ItemList.SelectMode" default="0">
Allows single or multiple item selection. See the [enum SelectMode] constants.
</member>
+ <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextParagraph.OverrunBehavior" default="0">
+ Sets the clipping behavior when the text exceeds an item's bounding rectangle. See [enum TextParagraph.OverrunBehavior] for a description of all modes.
+ </member>
</members>
<signals>
<signal name="item_activated">
diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml
index 380e9314d4..cd2f4eca18 100644
--- a/doc/classes/Light3D.xml
+++ b/doc/classes/Light3D.xml
@@ -61,7 +61,7 @@
<member name="light_specular" type="float" setter="set_param" getter="get_param" default="0.5">
The intensity of the specular blob in objects affected by the light. At [code]0[/code], the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface.
</member>
- <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.1">
+ <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.2">
Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed.
</member>
<member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0">
@@ -75,7 +75,7 @@
</member>
<member name="shadow_fog_fade" type="float" setter="set_param" getter="get_param" default="0.1">
</member>
- <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="2.0">
+ <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="1.0">
Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible.
</member>
<member name="shadow_reverse_cull_face" type="bool" setter="set_shadow_reverse_cull_face" getter="get_shadow_reverse_cull_face" default="false">
diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml
index 093ba51755..4d9abbbb19 100644
--- a/doc/classes/Line2D.xml
+++ b/doc/classes/Line2D.xml
@@ -58,6 +58,7 @@
<members>
<member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" default="false">
If [code]true[/code], the line's border will be anti-aliased.
+ [b]Note:[/b] Line2D is not accelerated by batching when being anti-aliased.
</member>
<member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode" default="0">
Controls the style of the line's first point. Use [enum LineCapMode] constants.
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index b9f50ad02a..70046fc3e9 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -66,34 +66,6 @@
Sends the given raw [code]bytes[/code] to a specific peer identified by [code]id[/code] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers.
</description>
</method>
- <method name="send_despawn">
- <return type="int" enum="Error" />
- <argument index="0" name="peer_id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="path" type="NodePath" />
- <argument index="3" name="data" type="PackedByteArray" default="PackedByteArray()" />
- <description>
- Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant SPAWN_MODE_SERVER] (see [method spawnable_config]) and the request is sent by the server (see [method is_network_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal network_despawn]. In all other cases no deletion happens, and the signal [signal network_despawn_request] is emitted instead.
- </description>
- </method>
- <method name="send_spawn">
- <return type="int" enum="Error" />
- <argument index="0" name="peer_id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="path" type="NodePath" />
- <argument index="3" name="data" type="PackedByteArray" default="PackedByteArray()" />
- <description>
- Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant SPAWN_MODE_SERVER] (see [method spawnable_config]) and the request is sent by the server (see [method is_network_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal network_spawn]. In all other cases no instantiation happens, and the signal [signal network_spawn_request] is emitted instead.
- </description>
- </method>
- <method name="spawnable_config">
- <return type="int" enum="Error" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="spawn_mode" type="int" enum="MultiplayerAPI.SpawnMode" />
- <description>
- Configures the MultiplayerAPI to track instances of the [PackedScene] idenfied by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication. See [enum SpawnMode] for the possible configurations.
- </description>
- </method>
</methods>
<members>
<member name="allow_object_decoding" type="bool" setter="set_allow_object_decoding" getter="is_object_decoding_allowed" default="false">
@@ -101,11 +73,13 @@
[b]Warning:[/b] Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution.
</member>
<member name="network_peer" type="MultiplayerPeer" setter="set_network_peer" getter="get_network_peer">
- The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master, or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals.
+ The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to authority, or it will become a regular client peer. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals.
</member>
<member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections" default="false">
If [code]true[/code], the MultiplayerAPI's [member network_peer] refuses new incoming connections.
</member>
+ <member name="replicator" type="MultiplayerReplicator" setter="" getter="get_replicator">
+ </member>
<member name="root_node" type="Node" setter="set_root_node" getter="get_root_node">
The root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed.
This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene.
@@ -122,25 +96,6 @@
Emitted when this MultiplayerAPI's [member network_peer] fails to establish a connection to a server. Only emitted on clients.
</description>
</signal>
- <signal name="network_despawn">
- <argument index="0" name="id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="node" type="Node" />
- <argument index="3" name="data" type="PackedByteArray" />
- <description>
- Emitted on a client before deleting a local Node upon receiving a despawn request from the server.
- </description>
- </signal>
- <signal name="network_despawn_request">
- <argument index="0" name="id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="parent" type="Node" />
- <argument index="3" name="name" type="String" />
- <argument index="4" name="data" type="PackedByteArray" />
- <description>
- Emitted when a network despawn request has been received from a client, or for a [PackedScene] that has been configured as [constant SPAWN_MODE_CUSTOM].
- </description>
- </signal>
<signal name="network_peer_connected">
<argument index="0" name="id" type="int" />
<description>
@@ -160,39 +115,6 @@
Emitted when this MultiplayerAPI's [member network_peer] receive a [code]packet[/code] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet.
</description>
</signal>
- <signal name="network_spawn">
- <argument index="0" name="id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="node" type="Node" />
- <argument index="3" name="data" type="PackedByteArray" />
- <description>
- Emitted on a client after a new Node is instantiated locally and added to the SceneTree upon receiving a spawn request from the server.
- </description>
- </signal>
- <signal name="network_spawn_request">
- <argument index="0" name="id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="parent" type="Node" />
- <argument index="3" name="name" type="String" />
- <argument index="4" name="data" type="PackedByteArray" />
- <description>
- Emitted when a network spawn request has been received from a client, or for a [PackedScene] that has been configured as [constant SPAWN_MODE_CUSTOM].
- </description>
- </signal>
- <signal name="network_spawnable_added">
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="node" type="Node" />
- <description>
- Emitted when an instance of a [PackedScene] that has been configured for networking enters the [SceneTree]. See [method spawnable_config].
- </description>
- </signal>
- <signal name="network_spawnable_removed">
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="node" type="Node" />
- <description>
- Emitted when an instance of a [PackedScene] that has been configured for networking leaves the [SceneTree]. See [method spawnable_config].
- </description>
- </signal>
<signal name="server_disconnected">
<description>
Emitted when this MultiplayerAPI's [member network_peer] disconnects from server. Only emitted on clients.
@@ -203,23 +125,11 @@
<constant name="RPC_MODE_DISABLED" value="0" enum="RPCMode">
Used with [method Node.rpc_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods.
</constant>
- <constant name="RPC_MODE_REMOTE" value="1" enum="RPCMode">
- Used with [method Node.rpc_config] to set a method to be called or a property to be changed only on the remote end, not locally. Analogous to the [code]remote[/code] keyword. Calls and property changes are accepted from all remote peers, no matter if they are node's master or puppets.
- </constant>
- <constant name="RPC_MODE_MASTER" value="2" enum="RPCMode">
- Used with [method Node.rpc_config] to set a method to be called or a property to be changed only on the network master for this node. Analogous to the [code]master[/code] keyword. Only accepts calls or property changes from the node's network puppets, see [method Node.set_network_master].
- </constant>
- <constant name="RPC_MODE_PUPPET" value="3" enum="RPCMode">
- Used with [method Node.rpc_config] to set a method to be called or a property to be changed only on puppets for this node. Analogous to the [code]puppet[/code] keyword. Only accepts calls or property changes from the node's network master, see [method Node.set_network_master].
- </constant>
- <constant name="SPAWN_MODE_NONE" value="0" enum="SpawnMode">
- Used with [method spawnable_config] to identify a [PackedScene] that should not be replicated.
- </constant>
- <constant name="SPAWN_MODE_SERVER" value="1" enum="SpawnMode">
- Used with [method spawnable_config] to identify a [PackedScene] that should be automatically replicated from server to clients.
+ <constant name="RPC_MODE_ANY" value="1" enum="RPCMode">
+ Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the [code]@rpc(any)[/code] annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not.
</constant>
- <constant name="SPAWN_MODE_CUSTOM" value="2" enum="SpawnMode">
- Used with [method spawnable_config] to identify a [PackedScene] that can be manually replicated among peers.
+ <constant name="RPC_MODE_AUTHORITY" value="2" enum="RPCMode">
+ Used with [method Node.rpc_config] to set a method to be callable remotely only by the current network authority (which is the server by default). Analogous to the [code]@rpc(auth)[/code] annotation. See [method Node.set_network_authority].
</constant>
</constants>
</class>
diff --git a/doc/classes/MultiplayerReplicator.xml b/doc/classes/MultiplayerReplicator.xml
new file mode 100644
index 0000000000..0778a7335f
--- /dev/null
+++ b/doc/classes/MultiplayerReplicator.xml
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="MultiplayerReplicator" inherits="Object" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="decode_state">
+ <return type="int" enum="Error" />
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="object" type="Object" />
+ <argument index="2" name="data" type="PackedByteArray" />
+ <argument index="3" name="initial" type="bool" default="true" />
+ <description>
+ Decode the given [code]data[/code] representing a spawnable state into [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when a client receives a server spawn for a scene with [constant REPLICATION_MODE_SERVER]. See [method spawn_config].
+ Tip: You may find this function useful in servers when parsing spawn requests from clients, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM].
+ </description>
+ </method>
+ <method name="despawn">
+ <return type="int" enum="Error" />
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="object" type="Object" />
+ <argument index="2" name="peer_id" type="int" default="0" />
+ <description>
+ Request a despawn for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code]. This will either trigger the default behaviour, or invoke the custom spawn/despawn callables specified in [method spawn_config]. See [method send_despawn] for the default behavior.
+ </description>
+ </method>
+ <method name="encode_state">
+ <return type="PackedByteArray" />
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="object" type="Object" />
+ <argument index="2" name="initial" type="bool" default="true" />
+ <description>
+ Encode the given [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when the server spawns scenes with [constant REPLICATION_MODE_SERVER]. See [method spawn_config].
+ Tip: You may find this function useful when requesting spawns from clients to server, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM].
+ </description>
+ </method>
+ <method name="send_despawn">
+ <return type="int" enum="Error" />
+ <argument index="0" name="peer_id" type="int" />
+ <argument index="1" name="scene_id" type="int" />
+ <argument index="2" name="data" type="Variant" default="null" />
+ <argument index="3" name="path" type="NodePath" default="NodePath(&quot;&quot;)" />
+ <description>
+ Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal despawned]. In all other cases no deletion happens, and the signal [signal despawn_requested] is emitted instead.
+ </description>
+ </method>
+ <method name="send_spawn">
+ <return type="int" enum="Error" />
+ <argument index="0" name="peer_id" type="int" />
+ <argument index="1" name="scene_id" type="int" />
+ <argument index="2" name="data" type="Variant" default="null" />
+ <argument index="3" name="path" type="NodePath" default="NodePath(&quot;&quot;)" />
+ <description>
+ Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal spawned]. In all other cases no instantiation happens, and the signal [signal spawn_requested] is emitted instead.
+ </description>
+ </method>
+ <method name="send_sync">
+ <return type="int" enum="Error" />
+ <argument index="0" name="peer_id" type="int" />
+ <argument index="1" name="scene_id" type="int" />
+ <argument index="2" name="data" type="PackedByteArray" />
+ <argument index="3" name="transfer_mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" />
+ <argument index="4" name="channel" type="int" default="0" />
+ <description>
+ Sends a sync request for the instances of the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). This function can only be called manually when overriding the send and receive sync functions (see [method sync_config]).
+ </description>
+ </method>
+ <method name="spawn">
+ <return type="int" enum="Error" />
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="object" type="Object" />
+ <argument index="2" name="peer_id" type="int" default="0" />
+ <description>
+ Request a spawn for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code]. This will either trigger the default behaviour, or invoke the custom spawn/despawn callables specified in [method spawn_config]. See [method send_spawn] for the default behavior.
+ </description>
+ </method>
+ <method name="spawn_config">
+ <return type="int" enum="Error" />
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="spawn_mode" type="int" enum="MultiplayerReplicator.ReplicationMode" />
+ <argument index="2" name="properties" type="StringName[]" default="[]" />
+ <argument index="3" name="custom_send" type="Callable" />
+ <argument index="4" name="custom_receive" type="Callable" />
+ <description>
+ Configures the MultiplayerReplicator to track instances of the [PackedScene] identified by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication. When [code]mode[/code] is [constant REPLICATION_MODE_SERVER], the specified [code]properties[/code] will also be replicated to clients during the initial spawn. You can optionally specify a [code]custom_send[/code] and a [code]custom_receive[/code] to override the default behaviour and customize the spawn/despawn proecess.
+ Tip: You can use a custom property in the scene main script to return a customly optimized state representation.
+ </description>
+ </method>
+ <method name="sync_all">
+ <return type="int" enum="Error" />
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="peer_id" type="int" default="0" />
+ <description>
+ Manually request a sync for all the instances of the scene identified by [code]scene_id[/code]. This function will trigger the default sync behaviour, or call your send custom send callable if specified in [method sync_config].
+ Note: The default implementation only allow syncing from server to clients.
+ </description>
+ </method>
+ <method name="sync_config">
+ <return type="int" enum="Error" />
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="interval" type="int" />
+ <argument index="2" name="properties" type="StringName[]" default="[]" />
+ <argument index="3" name="custom_send" type="Callable" />
+ <argument index="4" name="custom_receive" type="Callable" />
+ <description>
+ Configures the MultiplayerReplicator to sync instances of the [PackedScene] identified by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication at the desired [code]interval[/code] (in milliseconds). The specified [code]properties[/code] will be part of the state sync. You can optionally specify a [code]custom_send[/code] and a [code]custom_receive[/code] to override the default behaviour and customize the syncronization proecess.
+ Tip: You can use a custom property in the scene main script to return a customly optimized state representation (having a single property that returns a PackedByteArray is higly recommended when dealing with many instances).
+ </description>
+ </method>
+ <method name="track">
+ <return type="void" />
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="object" type="Object" />
+ <description>
+ Track the given [code]object[/code] as an instance of the scene identified by [code]scene_id[/code]. This object will be passed to your custom sync callables (see [method sync_config]). Tracking and untracking is automatic in [constant REPLICATION_MODE_SERVER].
+ </description>
+ </method>
+ <method name="untrack">
+ <return type="void" />
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="object" type="Object" />
+ <description>
+ Untrack the given [code]object[/code]. This object will no longer be passed to your custom sync callables (see [method sync_config]). Tracking and untracking is automatic in [constant REPLICATION_MODE_SERVER].
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="despawn_requested">
+ <argument index="0" name="id" type="int" />
+ <argument index="1" name="scene_id" type="int" />
+ <argument index="2" name="parent" type="Node" />
+ <argument index="3" name="name" type="String" />
+ <argument index="4" name="data" type="PackedByteArray" />
+ <description>
+ Emitted when a network despawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM].
+ </description>
+ </signal>
+ <signal name="despawned">
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="node" type="Node" />
+ <description>
+ Emitted on a client before deleting a local Node upon receiving a despawn request from the server.
+ </description>
+ </signal>
+ <signal name="replicated_instance_added">
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="node" type="Node" />
+ <description>
+ Emitted when an instance of a [PackedScene] that has been configured for networking enters the [SceneTree]. See [method spawn_config].
+ </description>
+ </signal>
+ <signal name="replicated_instance_removed">
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="node" type="Node" />
+ <description>
+ Emitted when an instance of a [PackedScene] that has been configured for networking leaves the [SceneTree]. See [method spawn_config].
+ </description>
+ </signal>
+ <signal name="spawn_requested">
+ <argument index="0" name="id" type="int" />
+ <argument index="1" name="scene_id" type="int" />
+ <argument index="2" name="parent" type="Node" />
+ <argument index="3" name="name" type="String" />
+ <argument index="4" name="data" type="PackedByteArray" />
+ <description>
+ Emitted when a network spawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM].
+ </description>
+ </signal>
+ <signal name="spawned">
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="node" type="Node" />
+ <description>
+ Emitted on a client after a new Node is instantiated locally and added to the SceneTree upon receiving a spawn request from the server.
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ <constant name="REPLICATION_MODE_NONE" value="0" enum="ReplicationMode">
+ Used with [method spawn_config] to identify a [PackedScene] that should not be replicated.
+ </constant>
+ <constant name="REPLICATION_MODE_SERVER" value="1" enum="ReplicationMode">
+ Used with [method spawn_config] to identify a [PackedScene] that should be automatically replicated from server to clients.
+ </constant>
+ <constant name="REPLICATION_MODE_CUSTOM" value="2" enum="ReplicationMode">
+ Used with [method spawn_config] to identify a [PackedScene] that can be manually replicated among peers.
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/NativeExtensionManager.xml b/doc/classes/NativeExtensionManager.xml
index c14ce94aff..42246619f6 100644
--- a/doc/classes/NativeExtensionManager.xml
+++ b/doc/classes/NativeExtensionManager.xml
@@ -18,6 +18,12 @@
<description>
</description>
</method>
+ <method name="is_extension_loaded" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="path" type="String" />
+ <description>
+ </description>
+ </method>
<method name="load_extension">
<return type="int" enum="NativeExtensionManager.LoadStatus" />
<argument index="0" name="path" type="String" />
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 096fbbf2c0..7d79c50466 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -35,8 +35,8 @@
Corresponds to the [constant NOTIFICATION_EXIT_TREE] notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited].
</description>
</method>
- <method name="_get_configuration_warnings" qualifiers="virtual">
- <return type="String[]" />
+ <method name="_get_configuration_warnings" qualifiers="virtual const">
+ <return type="PackedStringArray" />
<description>
The elements in the array returned from this method are displayed as warnings in the Scene Dock if the script that overrides it is a [code]tool[/code] script.
Returning an empty array produces no warnings.
@@ -96,9 +96,9 @@
</method>
<method name="_unhandled_key_input" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="event" type="InputEventKey" />
+ <argument index="0" name="event" type="InputEvent" />
<description>
- Called when an [InputEventKey] hasn't been consumed by [method _input] or any GUI. The input event propagates up through the node tree until a node consumes it.
+ Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed by [method _input] or any GUI. The input event propagates up through the node tree until a node consumes it.
It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input].
To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called.
For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first.
@@ -109,9 +109,11 @@
<return type="void" />
<argument index="0" name="node" type="Node" />
<argument index="1" name="legible_unique_name" type="bool" default="false" />
+ <argument index="2" name="internal" type="int" enum="Node.InternalMode" default="0" />
<description>
Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instantiated instead of its type.
+ If [code]internal[/code] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. Such nodes are ignored by methods like [method get_children], unless their parameter [code]include_internal[/code] is [code]true[/code].The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes.
[b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example:
[codeblocks]
[gdscript]
@@ -141,6 +143,7 @@
Adds a [code]sibling[/code] node to current's node parent, at the same level as that node, right below it.
If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instantiated instead of its type.
Use [method add_child] instead of this method if you don't need the child node to be added below a specific node in the list of children.
+ [b]Note:[/b] If this node is internal, the new sibling will be internal too (see [code]internal[/code] parameter in [method add_child]).
</description>
</method>
<method name="add_to_group">
@@ -200,22 +203,28 @@
<method name="get_child" qualifiers="const">
<return type="Node" />
<argument index="0" name="idx" type="int" />
+ <argument index="1" name="include_internal" type="bool" default="false" />
<description>
Returns a child node by its index (see [method get_child_count]). This method is often used for iterating all children of a node.
Negative indices access the children from the last one.
+ If [code]include_internal[/code] is [code]true[/code], internal children are skipped (see [code]internal[/code] parameter in [method add_child]).
To access a child node via its name, use [method get_node].
</description>
</method>
<method name="get_child_count" qualifiers="const">
<return type="int" />
+ <argument index="0" name="include_internal" type="bool" default="false" />
<description>
Returns the number of child nodes.
+ If [code]include_internal[/code] is [code]false[/code], internal children aren't counted (see [code]internal[/code] parameter in [method add_child]).
</description>
</method>
<method name="get_children" qualifiers="const">
<return type="Node[]" />
+ <argument index="0" name="include_internal" type="bool" default="false" />
<description>
Returns an array of references to node's children.
+ If [code]include_internal[/code] is [code]false[/code], the returned array won't include internal children (see [code]internal[/code] parameter in [method add_child]).
</description>
</method>
<method name="get_editor_description" qualifiers="const">
@@ -231,14 +240,16 @@
</method>
<method name="get_index" qualifiers="const">
<return type="int" />
+ <argument index="0" name="include_internal" type="bool" default="false" />
<description>
Returns the node's order in the scene tree branch. For example, if called on the first child node the position is [code]0[/code].
+ If [code]include_internal[/code] is [code]false[/code], the index won't take internal children into account, i.e. first non-internal child will have index of 0 (see [code]internal[/code] parameter in [method add_child]).
</description>
</method>
- <method name="get_network_master" qualifiers="const">
+ <method name="get_network_authority" qualifiers="const">
<return type="int" />
<description>
- Returns the peer ID of the network master for this node. See [method set_network_master].
+ Returns the peer ID of the network authority for this node. See [method set_network_authority].
</description>
</method>
<method name="get_node" qualifiers="const">
@@ -376,7 +387,14 @@
<method name="is_displayed_folded" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the node is folded (collapsed) in the Scene dock.
+ Returns [code]true[/code] if the node is folded (collapsed) in the Scene dock. This method is only intended for use with editor tooling.
+ </description>
+ </method>
+ <method name="is_editable_instance" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="node" type="Node" />
+ <description>
+ Returns [code]true[/code] if [code]node[/code] has editable children enabled relative to this node. This method is only intended for use with editor tooling.
</description>
</method>
<method name="is_greater_than" qualifiers="const">
@@ -399,10 +417,10 @@
Returns [code]true[/code] if this node is currently inside a [SceneTree].
</description>
</method>
- <method name="is_network_master" qualifiers="const">
+ <method name="is_network_authority" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the local system is the master of this node.
+ Returns [code]true[/code] if the local system is the authority of this node.
</description>
</method>
<method name="is_physics_processing" qualifiers="const">
@@ -453,6 +471,7 @@
<argument index="1" name="to_position" type="int" />
<description>
Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful.
+ [b]Note:[/b] Internal children can only be moved within their expected "internal range" (see [code]internal[/code] parameter in [method add_child]).
</description>
</method>
<method name="print_stray_nodes">
@@ -569,7 +588,7 @@
<argument index="2" name="transfer_mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" />
<argument index="3" name="channel" type="int" default="0" />
<description>
- Changes the RPC mode for the given [code]method[/code] to the given [code]rpc_mode[/code], optionally specifying the [code]transfer_mode[/code] and [code]channel[/code] (on supported peers). See [enum MultiplayerAPI.RPCMode] and [enum MultiplayerPeer.TransferMode]. An alternative is annotating methods and properties with the corresponding keywords ([code]remote[/code], [code]master[/code], [code]puppet[/code], [code]remotesync[/code], [code]mastersync[/code], [code]puppetsync[/code]). By default, methods are not exposed to networking (and RPCs).
+ Changes the RPC mode for the given [code]method[/code] to the given [code]rpc_mode[/code], optionally specifying the [code]transfer_mode[/code] and [code]channel[/code] (on supported peers). See [enum MultiplayerAPI.RPCMode] and [enum MultiplayerPeer.TransferMode]. An alternative is annotating methods and properties with the corresponding annotation ([code]@rpc(any)[/code], [code]@rpc(auth)[/code]). By default, methods are not exposed to networking (and RPCs).
</description>
</method>
<method name="rpc_id" qualifiers="vararg">
@@ -584,7 +603,15 @@
<return type="void" />
<argument index="0" name="fold" type="bool" />
<description>
- Sets the folded state of the node in the Scene dock.
+ Sets the folded state of the node in the Scene dock. This method is only intended for use with editor tooling.
+ </description>
+ </method>
+ <method name="set_editable_instance">
+ <return type="void" />
+ <argument index="0" name="node" type="Node" />
+ <argument index="1" name="is_editable" type="bool" />
+ <description>
+ Sets the editable children state of [code]node[/code] relative to this node. This method is only intended for use with editor tooling.
</description>
</method>
<method name="set_editor_description">
@@ -593,12 +620,12 @@
<description>
</description>
</method>
- <method name="set_network_master">
+ <method name="set_network_authority">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="recursive" type="bool" default="true" />
<description>
- Sets the node's network master to the peer with the given peer ID. The network master is the peer that has authority over the node on the network. Useful in conjunction with the [code]master[/code] and [code]puppet[/code] keywords. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If [code]recursive[/code], the given peer is recursively set as the master for all children of this node.
+ Sets the node's network authority to the peer with the given peer ID. The network authority is the peer that has authority over the node on the network. Useful in conjunction with [method rpc_config] and the [MultiplayerAPI]. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If [code]recursive[/code], the given peer is recursively set as the authority for all children of this node.
</description>
</method>
<method name="set_physics_process">
@@ -873,5 +900,14 @@
Duplicate using instancing.
An instance stays linked to the original so when the original changes, the instance changes too.
</constant>
+ <constant name="INTERNAL_MODE_DISABLED" value="0" enum="InternalMode">
+ Node will not be internal.
+ </constant>
+ <constant name="INTERNAL_MODE_FRONT" value="1" enum="InternalMode">
+ Node will be placed at the front of parent's node list, before any non-internal sibling.
+ </constant>
+ <constant name="INTERNAL_MODE_BACK" value="2" enum="InternalMode">
+ Node will be placed at the back of parent's node list, after any non-internal sibling.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index 9ad79dc17a..c9e9a0699c 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -13,15 +13,15 @@
[codeblocks]
[gdscript]
var n = Node2D.new()
- print("position" in n) # Prints "True".
- print("other_property" in n) # Prints "False".
+ print("position" in n) # Prints "true".
+ print("other_property" in n) # Prints "false".
[/gdscript]
[csharp]
var node = new Node2D();
// C# has no direct equivalent to GDScript's `in` operator here, but we
// can achieve the same behavior by performing `Get` with a null check.
- GD.Print(node.Get("position") != null); // Prints "True".
- GD.Print(node.Get("other_property") != null); // Prints "False".
+ GD.Print(node.Get("position") != null); // Prints "true".
+ GD.Print(node.Get("other_property") != null); // Prints "false".
[/csharp]
[/codeblocks]
The [code]in[/code] operator will evaluate to [code]true[/code] as long as the key exists, even if the value is [code]null[/code].
diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml
index 3520d3b966..3b583f5c89 100644
--- a/doc/classes/ParticlesMaterial.xml
+++ b/doc/classes/ParticlesMaterial.xml
@@ -11,18 +11,18 @@
<tutorials>
</tutorials>
<methods>
- <method name="get_param" qualifiers="const">
+ <method name="get_param_max" qualifiers="const">
<return type="float" />
<argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter" />
<description>
- Returns the value of the specified parameter.
+ Return the maximum value range for the given prameter.
</description>
</method>
- <method name="get_param_randomness" qualifiers="const">
+ <method name="get_param_min" qualifiers="const">
<return type="float" />
<argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter" />
<description>
- Returns the randomness ratio associated with the specified parameter.
+ Return the minimum value range for the given parameter.
</description>
</method>
<method name="get_param_texture" qualifiers="const">
@@ -39,20 +39,20 @@
Returns [code]true[/code] if the specified particle flag is enabled. See [enum ParticleFlags] for options.
</description>
</method>
- <method name="set_param">
+ <method name="set_param_max">
<return type="void" />
<argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter" />
<argument index="1" name="value" type="float" />
<description>
- Sets the specified [enum Parameter].
+ Sets the maximum value range for the given parameter.
</description>
</method>
- <method name="set_param_randomness">
+ <method name="set_param_min">
<return type="void" />
<argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter" />
- <argument index="1" name="randomness" type="float" />
+ <argument index="1" name="value" type="float" />
<description>
- Sets the randomness ratio for the specified [enum Parameter].
+ Sets the minimum value range for the given parameter.
</description>
</method>
<method name="set_param_texture">
@@ -73,53 +73,56 @@
</method>
</methods>
<members>
- <member name="angle" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial rotation applied to each particle, in degrees.
- Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are [code]true[/code] or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES].
- </member>
<member name="angle_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's rotation will be animated along this [CurveTexture].
</member>
- <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Rotation randomness ratio.
+ <member name="angle_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum angle.
</member>
- <member name="angular_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.
- Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are [code]true[/code] or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES].
+ <member name="angle_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum angle.
</member>
<member name="angular_velocity_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's angular velocity will vary along this [CurveTexture].
</member>
- <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Angular velocity randomness ratio.
+ <member name="angular_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum angular velocity.
</member>
- <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0">
- Particle animation offset.
+ <member name="angular_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum angular velocity.
</member>
<member name="anim_offset_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's animation offset will vary along this [CurveTexture].
</member>
- <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Animation offset randomness ratio.
+ <member name="anim_offset_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum animation offset.
</member>
- <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0">
- Particle animation speed.
+ <member name="anim_offset_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum animation offset.
</member>
<member name="anim_speed_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's animation speed will vary along this [CurveTexture].
</member>
- <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Animation speed randomness ratio.
+ <member name="anim_speed_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum particle animation speed.
+ </member>
+ <member name="anim_speed_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum particle animation speed.
</member>
<member name="attractor_interaction_enabled" type="bool" setter="set_attractor_interaction_enabled" getter="is_attractor_interaction_enabled" default="true">
+ True if the interaction with particle attractors is enabled.
</member>
<member name="collision_bounce" type="float" setter="set_collision_bounce" getter="get_collision_bounce" default="0.0">
+ Collision bouncyness.
</member>
<member name="collision_enabled" type="bool" setter="set_collision_enabled" getter="is_collision_enabled" default="false">
+ True if collisions are enabled for this particle system.
</member>
<member name="collision_friction" type="float" setter="set_collision_friction" getter="get_collision_friction" default="0.0">
+ Collision friction.
</member>
<member name="collision_use_scale" type="bool" setter="set_collision_use_scale" getter="is_collision_using_scale" default="false">
+ Should collision take scale into account.
</member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)">
Each particle's initial color. If the [GPUParticles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [BaseMaterial3D] make sure to set [member BaseMaterial3D.vertex_color_use_as_albedo] to [code]true[/code].
@@ -127,14 +130,12 @@
<member name="color_ramp" type="Texture2D" setter="set_color_ramp" getter="get_color_ramp">
Each particle's color will vary along this [GradientTexture] over its lifetime (multiplied with [member color]).
</member>
- <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0">
- The rate at which particles lose velocity.
- </member>
<member name="damping_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Damping will vary along this [CurveTexture].
</member>
- <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Damping randomness ratio.
+ <member name="damping_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ </member>
+ <member name="damping_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
</member>
<member name="direction" type="Vector3" setter="set_direction" getter="get_direction" default="Vector3(1, 0, 0)">
Unit vector specifying the particles' emission direction.
@@ -178,42 +179,41 @@
<member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3(0, -9.8, 0)">
Gravity applied to every particle.
</member>
- <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial hue variation applied to each particle.
- </member>
<member name="hue_variation_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's hue will vary along this [CurveTexture].
</member>
- <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Hue variation randomness ratio.
+ <member name="hue_variation_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum hue variation.
+ </member>
+ <member name="hue_variation_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum hue variation.
</member>
- <member name="initial_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
- Initial velocity magnitude for each particle. Direction comes from [member spread] and the node's orientation.
+ <member name="initial_velocity_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum initial velocity.
</member>
- <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Initial velocity randomness ratio.
+ <member name="initial_velocity_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum initial velocity.
</member>
<member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0">
Particle lifetime randomness ratio.
</member>
- <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0">
- Linear acceleration applied to each particle in the direction of motion.
- </member>
<member name="linear_accel_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's linear acceleration will vary along this [CurveTexture].
</member>
- <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Linear acceleration randomness ratio.
+ <member name="linear_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum linear acceleration.
</member>
- <member name="orbit_velocity" type="float" setter="set_param" getter="get_param">
- Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.
- Only available when [member particle_flag_disable_z] is [code]true[/code].
+ <member name="linear_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum linear acceleration.
</member>
<member name="orbit_velocity_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's orbital velocity will vary along this [CurveTexture].
</member>
- <member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
- Orbital velocity randomness ratio.
+ <member name="orbit_velocity_max" type="float" setter="set_param_max" getter="get_param_max">
+ Maximum orbit velocity.
+ </member>
+ <member name="orbit_velocity_min" type="float" setter="set_param_min" getter="get_param_min">
+ Minimum orbit velocity.
</member>
<member name="particle_flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
Align Y axis of particle with the direction of its velocity.
@@ -222,25 +222,25 @@
If [code]true[/code], particles will not move on the z axis.
</member>
<member name="particle_flag_rotate_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
- If [code]true[/code], particles rotate around Y axis by [member angle].
- </member>
- <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0">
- Radial acceleration applied to each particle. Makes particle accelerate away from origin.
+ If [code]true[/code], particles rotate around Y axis by [member angle_min].
</member>
<member name="radial_accel_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's radial acceleration will vary along this [CurveTexture].
</member>
- <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Radial acceleration randomness ratio.
+ <member name="radial_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum radial acceleration.
</member>
- <member name="scale" type="float" setter="set_param" getter="get_param" default="1.0">
- Initial scale applied to each particle.
+ <member name="radial_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum radial acceleration.
</member>
<member name="scale_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
- Each particle's scale will vary along this [CurveTexture].
+ Each particle's scale will vary along this [CurveTexture]. If a [CurveXYZTexture] is supplied instead, the scale will be separated per-axis.
</member>
- <member name="scale_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Scale randomness ratio.
+ <member name="scale_max" type="float" setter="set_param_max" getter="get_param_max" default="1.0">
+ Maximum scale.
+ </member>
+ <member name="scale_min" type="float" setter="set_param_min" getter="get_param_min" default="1.0">
+ Minimum scale.
</member>
<member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0">
Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees.
@@ -253,52 +253,52 @@
</member>
<member name="sub_emitter_mode" type="int" setter="set_sub_emitter_mode" getter="get_sub_emitter_mode" enum="ParticlesMaterial.SubEmitterMode" default="0">
</member>
- <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0">
- Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
- </member>
<member name="tangential_accel_curve" type="Texture2D" setter="set_param_texture" getter="get_param_texture">
Each particle's tangential acceleration will vary along this [CurveTexture].
</member>
- <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
- Tangential acceleration randomness ratio.
+ <member name="tangential_accel_max" type="float" setter="set_param_max" getter="get_param_max" default="0.0">
+ Maximum tangential acceleration.
+ </member>
+ <member name="tangential_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
+ Minimum tangential acceleration.
</member>
</members>
<constants>
<constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set initial velocity properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set initial velocity properties.
</constant>
<constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angular velocity properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set angular velocity properties.
</constant>
<constant name="PARAM_ORBIT_VELOCITY" value="2" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set orbital velocity properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set orbital velocity properties.
</constant>
<constant name="PARAM_LINEAR_ACCEL" value="3" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set linear acceleration properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set linear acceleration properties.
</constant>
<constant name="PARAM_RADIAL_ACCEL" value="4" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set radial acceleration properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set radial acceleration properties.
</constant>
<constant name="PARAM_TANGENTIAL_ACCEL" value="5" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set tangential acceleration properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set tangential acceleration properties.
</constant>
<constant name="PARAM_DAMPING" value="6" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set damping properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set damping properties.
</constant>
<constant name="PARAM_ANGLE" value="7" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angle properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set angle properties.
</constant>
<constant name="PARAM_SCALE" value="8" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set scale properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set scale properties.
</constant>
<constant name="PARAM_HUE_VARIATION" value="9" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set hue variation properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set hue variation properties.
</constant>
<constant name="PARAM_ANIM_SPEED" value="10" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation speed properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set animation speed properties.
</constant>
<constant name="PARAM_ANIM_OFFSET" value="11" enum="Parameter">
- Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation offset properties.
+ Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set animation offset properties.
</constant>
<constant name="PARAM_MAX" value="12" enum="Parameter">
Represents the size of the [enum Parameter] enum.
diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml
index 1df2fd0158..d0ae665139 100644
--- a/doc/classes/PhysicsServer2D.xml
+++ b/doc/classes/PhysicsServer2D.xml
@@ -595,7 +595,8 @@
<argument index="2" name="motion" type="Vector2" />
<argument index="3" name="margin" type="float" default="0.08" />
<argument index="4" name="result" type="PhysicsTestMotionResult2D" default="null" />
- <argument index="5" name="exclude" type="Array" default="[]" />
+ <argument index="5" name="collide_separation_ray" type="bool" default="false" />
+ <argument index="6" name="exclude" type="Array" default="[]" />
<description>
Returns [code]true[/code] if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. [PhysicsTestMotionResult2D] can be passed to return additional information in.
</description>
@@ -726,6 +727,11 @@
<description>
</description>
</method>
+ <method name="separation_ray_shape_create">
+ <return type="RID" />
+ <description>
+ </description>
+ </method>
<method name="set_active">
<return type="void" />
<argument index="0" name="active" type="bool" />
@@ -840,25 +846,28 @@
<constant name="SHAPE_WORLD_MARGIN" value="0" enum="ShapeType">
This is the constant for creating world margin shapes. A world margin shape is an [i]infinite[/i] line with an origin point, and a normal. Thus, it can be used for front/behind checks.
</constant>
- <constant name="SHAPE_SEGMENT" value="1" enum="ShapeType">
+ <constant name="SHAPE_SEPARATION_RAY" value="1" enum="ShapeType">
+ This is the constant for creating separation ray shapes. A separation ray is defined by a length and separates itself from what is touching its far endpoint. Useful for character controllers.
+ </constant>
+ <constant name="SHAPE_SEGMENT" value="2" enum="ShapeType">
This is the constant for creating segment shapes. A segment shape is a [i]finite[/i] line from a point A to a point B. It can be checked for intersections.
</constant>
- <constant name="SHAPE_CIRCLE" value="2" enum="ShapeType">
+ <constant name="SHAPE_CIRCLE" value="3" enum="ShapeType">
This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks.
</constant>
- <constant name="SHAPE_RECTANGLE" value="3" enum="ShapeType">
+ <constant name="SHAPE_RECTANGLE" value="4" enum="ShapeType">
This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks.
</constant>
- <constant name="SHAPE_CAPSULE" value="4" enum="ShapeType">
+ <constant name="SHAPE_CAPSULE" value="5" enum="ShapeType">
This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks.
</constant>
- <constant name="SHAPE_CONVEX_POLYGON" value="5" enum="ShapeType">
+ <constant name="SHAPE_CONVEX_POLYGON" value="6" enum="ShapeType">
This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the [member CollisionPolygon2D.polygon] property, polygons modified with [method shape_set_data] do not verify that the points supplied form is a convex polygon.
</constant>
- <constant name="SHAPE_CONCAVE_POLYGON" value="6" enum="ShapeType">
+ <constant name="SHAPE_CONCAVE_POLYGON" value="7" enum="ShapeType">
This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks.
</constant>
- <constant name="SHAPE_CUSTOM" value="7" enum="ShapeType">
+ <constant name="SHAPE_CUSTOM" value="8" enum="ShapeType">
This constant is used internally by the engine. Any attempt to create this kind of shape results in an error.
</constant>
<constant name="AREA_PARAM_GRAVITY" value="0" enum="AreaParameter">
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index d46e38ac5f..c47a311161 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -571,7 +571,8 @@
<argument index="2" name="motion" type="Vector3" />
<argument index="3" name="margin" type="float" default="0.001" />
<argument index="4" name="result" type="PhysicsTestMotionResult3D" default="null" />
- <argument index="5" name="exclude" type="Array" default="[]" />
+ <argument index="5" name="collide_separation_ray" type="bool" default="false" />
+ <argument index="6" name="exclude" type="Array" default="[]" />
<description>
Returns [code]true[/code] if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. [PhysicsTestMotionResult3D] can be passed to return additional information in.
</description>
@@ -849,6 +850,11 @@
<description>
</description>
</method>
+ <method name="separation_ray_shape_create">
+ <return type="RID" />
+ <description>
+ </description>
+ </method>
<method name="set_active">
<return type="void" />
<argument index="0" name="active" type="bool" />
@@ -1171,31 +1177,34 @@
<constant name="SHAPE_PLANE" value="0" enum="ShapeType">
The [Shape3D] is a [WorldMarginShape3D].
</constant>
- <constant name="SHAPE_SPHERE" value="1" enum="ShapeType">
+ <constant name="SHAPE_SEPARATION_RAY" value="1" enum="ShapeType">
+ The [Shape3D] is a [SeparationRayShape3D].
+ </constant>
+ <constant name="SHAPE_SPHERE" value="2" enum="ShapeType">
The [Shape3D] is a [SphereShape3D].
</constant>
- <constant name="SHAPE_BOX" value="2" enum="ShapeType">
+ <constant name="SHAPE_BOX" value="3" enum="ShapeType">
The [Shape3D] is a [BoxShape3D].
</constant>
- <constant name="SHAPE_CAPSULE" value="3" enum="ShapeType">
+ <constant name="SHAPE_CAPSULE" value="4" enum="ShapeType">
The [Shape3D] is a [CapsuleShape3D].
</constant>
- <constant name="SHAPE_CYLINDER" value="4" enum="ShapeType">
+ <constant name="SHAPE_CYLINDER" value="5" enum="ShapeType">
The [Shape3D] is a [CylinderShape3D].
</constant>
- <constant name="SHAPE_CONVEX_POLYGON" value="5" enum="ShapeType">
+ <constant name="SHAPE_CONVEX_POLYGON" value="6" enum="ShapeType">
The [Shape3D] is a [ConvexPolygonShape3D].
</constant>
- <constant name="SHAPE_CONCAVE_POLYGON" value="6" enum="ShapeType">
+ <constant name="SHAPE_CONCAVE_POLYGON" value="7" enum="ShapeType">
The [Shape3D] is a [ConcavePolygonShape3D].
</constant>
- <constant name="SHAPE_HEIGHTMAP" value="7" enum="ShapeType">
+ <constant name="SHAPE_HEIGHTMAP" value="8" enum="ShapeType">
The [Shape3D] is a [HeightMapShape3D].
</constant>
- <constant name="SHAPE_SOFT_BODY" value="8" enum="ShapeType">
+ <constant name="SHAPE_SOFT_BODY" value="9" enum="ShapeType">
The [Shape3D] is a [SoftBody3D].
</constant>
- <constant name="SHAPE_CUSTOM" value="9" enum="ShapeType">
+ <constant name="SHAPE_CUSTOM" value="10" enum="ShapeType">
This constant is used internally by the engine. Any attempt to create this kind of shape results in an error.
</constant>
<constant name="AREA_PARAM_GRAVITY" value="0" enum="AreaParameter">
@@ -1222,6 +1231,18 @@
<constant name="AREA_PARAM_PRIORITY" value="7" enum="AreaParameter">
Constant to set/get the priority (order of processing) of an area.
</constant>
+ <constant name="AREA_PARAM_WIND_FORCE_MAGNITUDE" value="8" enum="AreaParameter">
+ Constant to set/get the magnitude of area-specific wind force.
+ </constant>
+ <constant name="AREA_PARAM_WIND_SOURCE" value="9" enum="AreaParameter">
+ Constant to set/get the 3D vector that specifies the origin from which an area-specific wind blows.
+ </constant>
+ <constant name="AREA_PARAM_WIND_DIRECTION" value="10" enum="AreaParameter">
+ Constant to set/get the 3D vector that specifies the direction in which an area-specific wind blows.
+ </constant>
+ <constant name="AREA_PARAM_WIND_ATTENUATION_FACTOR" value="11" enum="AreaParameter">
+ Constant to set/get the exponential rate at which wind force decreases with distance from its origin.
+ </constant>
<constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0" enum="AreaSpaceOverrideMode">
This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
</constant>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 0d1fa0e70f..58c9d9e44b 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -1473,6 +1473,9 @@
</member>
<member name="rendering/2d/snap/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false">
</member>
+ <member name="rendering/3d/viewport/scale" type="int" setter="" getter="" default="0">
+ Scale the 3D render buffer based on the viewport size. The smaller the faster 3D rendering is performed but at the cost of quality.
+ </member>
<member name="rendering/anti_aliasing/quality/msaa" type="int" setter="" getter="" default="0">
Sets the number of MSAA samples to use (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware.
</member>
diff --git a/doc/classes/RandomNumberGenerator.xml b/doc/classes/RandomNumberGenerator.xml
index 2cf3cbb83d..fed6568d22 100644
--- a/doc/classes/RandomNumberGenerator.xml
+++ b/doc/classes/RandomNumberGenerator.xml
@@ -4,7 +4,7 @@
A class for generating pseudo-random numbers.
</brief_description>
<description>
- RandomNumberGenerator is a class for generating pseudo-random numbers. It currently uses [url=http://www.pcg-random.org/]PCG32[/url].
+ RandomNumberGenerator is a class for generating pseudo-random numbers. It currently uses [url=https://www.pcg-random.org/]PCG32[/url].
[b]Note:[/b] The underlying algorithm is an implementation detail. As a result, it should not be depended upon for reproducible random streams across Godot versions.
To generate a random float number (within a given range) based on a time-dependant seed:
[codeblock]
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index df8bfb7e34..638c657492 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -3082,6 +3082,14 @@
If [code]true[/code], render the contents of the viewport directly to screen. This allows a low-level optimization where you can skip drawing a viewport to the root viewport. While this optimization can result in a significant increase in speed (especially on older devices), it comes at a cost of usability. When this is enabled, you cannot read from the viewport or from the [code]SCREEN_TEXTURE[/code]. You also lose the benefit of certain window settings, such as the various stretch modes. Another consequence to be aware of is that in 2D the rendering happens in window coordinates, so if you have a viewport that is double the size of the window, and you set this, then only the portion that fits within the window will be drawn, no automatic scaling is possible, even if your game scene is significantly larger than the window size.
</description>
</method>
+ <method name="viewport_set_scale_3d">
+ <return type="void" />
+ <argument index="0" name="viewport" type="RID" />
+ <argument index="1" name="scale" type="int" enum="RenderingServer.ViewportScale3D" />
+ <description>
+ Sets the scale at which we render 3D contents.
+ </description>
+ </method>
<method name="viewport_set_scenario">
<return type="void" />
<argument index="0" name="viewport" type="RID" />
@@ -3896,6 +3904,16 @@
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_OCCLUDERS" value="23" enum="ViewportDebugDraw">
</constant>
+ <constant name="VIEWPORT_SCALE_3D_DISABLED" value="0" enum="ViewportScale3D">
+ </constant>
+ <constant name="VIEWPORT_SCALE_3D_75_PERCENT" value="1" enum="ViewportScale3D">
+ </constant>
+ <constant name="VIEWPORT_SCALE_3D_50_PERCENT" value="2" enum="ViewportScale3D">
+ </constant>
+ <constant name="VIEWPORT_SCALE_3D_33_PERCENT" value="3" enum="ViewportScale3D">
+ </constant>
+ <constant name="VIEWPORT_SCALE_3D_25_PERCENT" value="4" enum="ViewportScale3D">
+ </constant>
<constant name="SKY_MODE_AUTOMATIC" value="0" enum="SkyMode">
</constant>
<constant name="SKY_MODE_QUALITY" value="1" enum="SkyMode">
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index 701ecf815c..65dedf5280 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -12,12 +12,6 @@
<link title="When and how to avoid using nodes for everything">https://docs.godotengine.org/en/latest/getting_started/workflow/best_practices/node_alternatives.html</link>
</tutorials>
<methods>
- <method name="_setup_local_to_scene" qualifiers="virtual">
- <return type="void" />
- <description>
- Virtual function which can be overridden to customize the behavior value of [method setup_local_to_scene].
- </description>
- </method>
<method name="duplicate" qualifiers="const">
<return type="Resource" />
<argument index="0" name="subresources" type="bool" default="false" />
@@ -54,7 +48,7 @@
<method name="setup_local_to_scene">
<return type="void" />
<description>
- This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a [PackedScene] instantiation. Its behavior can be customized by overriding [method _setup_local_to_scene] from script.
+ This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a [PackedScene] instantiation. Its behavior can be customized by connecting [signal setup_local_to_scene_requested] from script.
For most resources, this method performs no base logic. [ViewportTexture] performs custom logic to properly set the proxy texture and flags in the local viewport.
</description>
</method>
@@ -84,6 +78,10 @@
[b]Note:[/b] This signal is not emitted automatically for custom resources, which means that you need to create a setter and emit the signal yourself.
</description>
</signal>
+ <signal name="setup_local_to_scene_requested">
+ <description>
+ </description>
+ </signal>
</signals>
<constants>
</constants>
diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml
index bce5785cc1..0c2bb26c02 100644
--- a/doc/classes/ResourceFormatLoader.xml
+++ b/doc/classes/ResourceFormatLoader.xml
@@ -11,22 +11,28 @@
<tutorials>
</tutorials>
<methods>
- <method name="_get_dependencies" qualifiers="virtual">
- <return type="void" />
+ <method name="_exists" qualifiers="virtual const">
+ <return type="bool" />
+ <argument index="0" name="path" type="String" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_dependencies" qualifiers="virtual const">
+ <return type="PackedStringArray" />
<argument index="0" name="path" type="String" />
- <argument index="1" name="add_types" type="String" />
+ <argument index="1" name="add_types" type="bool" />
<description>
If implemented, gets the dependencies of a given resource. If [code]add_types[/code] is [code]true[/code], paths should be appended [code]::TypeName[/code], where [code]TypeName[/code] is the class name of the dependency.
[b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return [code]"Resource"[/code] for them.
</description>
</method>
- <method name="_get_recognized_extensions" qualifiers="virtual">
+ <method name="_get_recognized_extensions" qualifiers="virtual const">
<return type="PackedStringArray" />
<description>
Gets the list of extensions for files this loader is able to read.
</description>
</method>
- <method name="_get_resource_type" qualifiers="virtual">
+ <method name="_get_resource_type" qualifiers="virtual const">
<return type="String" />
<argument index="0" name="path" type="String" />
<description>
@@ -34,15 +40,21 @@
[b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return [code]"Resource"[/code] for them.
</description>
</method>
- <method name="_handles_type" qualifiers="virtual">
+ <method name="_get_resource_uid" qualifiers="virtual const">
+ <return type="int" />
+ <argument index="0" name="path" type="String" />
+ <description>
+ </description>
+ </method>
+ <method name="_handles_type" qualifiers="virtual const">
<return type="bool" />
- <argument index="0" name="typename" type="StringName" />
+ <argument index="0" name="type" type="StringName" />
<description>
Tells which resource class this loader can load.
[b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just handle [code]"Resource"[/code] for them.
</description>
</method>
- <method name="_load" qualifiers="virtual">
+ <method name="_load" qualifiers="virtual const">
<return type="Variant" />
<argument index="0" name="path" type="String" />
<argument index="1" name="original_path" type="String" />
@@ -53,10 +65,10 @@
The [code]cache_mode[/code] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
</description>
</method>
- <method name="_rename_dependencies" qualifiers="virtual">
+ <method name="_rename_dependencies" qualifiers="virtual const">
<return type="int" />
<argument index="0" name="path" type="String" />
- <argument index="1" name="renames" type="String" />
+ <argument index="1" name="renames" type="Dictionary" />
<description>
If implemented, renames dependencies within the given resource and saves it. [code]renames[/code] is a dictionary [code]{ String =&gt; String }[/code] mapping old dependency paths to new paths.
Returns [constant OK] on success, or an [enum Error] constant in case of failure.
diff --git a/doc/classes/ResourceFormatSaver.xml b/doc/classes/ResourceFormatSaver.xml
index ef9eebc953..7ee8875321 100644
--- a/doc/classes/ResourceFormatSaver.xml
+++ b/doc/classes/ResourceFormatSaver.xml
@@ -10,14 +10,14 @@
<tutorials>
</tutorials>
<methods>
- <method name="_get_recognized_extensions" qualifiers="virtual">
+ <method name="_get_recognized_extensions" qualifiers="virtual const">
<return type="PackedStringArray" />
<argument index="0" name="resource" type="Resource" />
<description>
Returns the list of extensions available for saving the resource object, provided it is recognized (see [method _recognize]).
</description>
</method>
- <method name="_recognize" qualifiers="virtual">
+ <method name="_recognize" qualifiers="virtual const">
<return type="bool" />
<argument index="0" name="resource" type="Resource" />
<description>
diff --git a/doc/classes/RichTextEffect.xml b/doc/classes/RichTextEffect.xml
index 142afbb860..fd93f6be56 100644
--- a/doc/classes/RichTextEffect.xml
+++ b/doc/classes/RichTextEffect.xml
@@ -23,7 +23,7 @@
<link title="RichTextEffect test project (third-party)">https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
</tutorials>
<methods>
- <method name="_process_custom_fx" qualifiers="virtual">
+ <method name="_process_custom_fx" qualifiers="virtual const">
<return type="bool" />
<argument index="0" name="char_fx" type="CharFXTransform" />
<description>
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index 7bbcc5e0b5..e77232a613 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -555,7 +555,7 @@
<theme_item name="italics_font_size" data_type="font_size" type="int">
The font size used for italics text.
</theme_item>
- <theme_item name="line_separation" data_type="constant" type="int" default="1">
+ <theme_item name="line_separation" data_type="constant" type="int" default="0">
The vertical space between lines.
</theme_item>
<theme_item name="mono_font" data_type="font" type="Font">
diff --git a/doc/classes/ScriptEditorBase.xml b/doc/classes/ScriptEditorBase.xml
index 0efcde5638..08baa705e8 100644
--- a/doc/classes/ScriptEditorBase.xml
+++ b/doc/classes/ScriptEditorBase.xml
@@ -9,13 +9,6 @@
<tutorials>
</tutorials>
<methods>
- <method name="_add_syntax_highlighter" qualifiers="virtual">
- <return type="void" />
- <argument index="0" name="highlighter" type="Object" />
- <description>
- Adds a [EditorSyntaxHighlighter] to the open script.
- </description>
- </method>
<method name="get_base_editor" qualifiers="const">
<return type="Control" />
<description>
diff --git a/doc/classes/SeparationRayShape2D.xml b/doc/classes/SeparationRayShape2D.xml
new file mode 100644
index 0000000000..fb90606577
--- /dev/null
+++ b/doc/classes/SeparationRayShape2D.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="SeparationRayShape2D" inherits="Shape2D" version="4.0">
+ <brief_description>
+ Separation ray shape for 2D collisions.
+ </brief_description>
+ <description>
+ Separation ray shape for 2D collisions. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="length" type="float" setter="set_length" getter="get_length" default="20.0">
+ The ray's length.
+ </member>
+ <member name="slide_on_slope" type="bool" setter="set_slide_on_slope" getter="get_slide_on_slope" default="false">
+ If [code]false[/code] (default), the shape always separates and returns a normal along its own direction.
+ If [code]true[/code], the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/SeparationRayShape3D.xml b/doc/classes/SeparationRayShape3D.xml
new file mode 100644
index 0000000000..ea57e4eb59
--- /dev/null
+++ b/doc/classes/SeparationRayShape3D.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="SeparationRayShape3D" inherits="Shape3D" version="4.0">
+ <brief_description>
+ Separation ray shape for 3D collisions.
+ </brief_description>
+ <description>
+ Separation ray shape for 3D collisions, which can be set into a [PhysicsBody3D] or [Area3D]. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <members>
+ <member name="length" type="float" setter="set_length" getter="get_length" default="1.0">
+ The ray's length.
+ </member>
+ <member name="slide_on_slope" type="bool" setter="set_slide_on_slope" getter="get_slide_on_slope" default="false">
+ If [code]false[/code] (default), the shape always separates and returns a normal along its own direction.
+ If [code]true[/code], the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/Skeleton2D.xml b/doc/classes/Skeleton2D.xml
index 828d24338b..839193fb61 100644
--- a/doc/classes/Skeleton2D.xml
+++ b/doc/classes/Skeleton2D.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Skeleton2D parents a hierarchy of [Bone2D] objects. It is a requirement of [Bone2D]. Skeleton2D holds a reference to the rest pose of its children and acts as a single point of access to its bones.
+ To setup different types of inverse kinematics for the given Skeleton2D, a [SkeletonModificationStack2D] should be created. They can be applied by creating the desired number of modifications, which can be done by increasing [member SkeletonModificationStack2D.modification_count].
</description>
<tutorials>
<link title="2D skeletons">https://docs.godotengine.org/en/latest/tutorials/animation/2d_skeletons.html</link>
diff --git a/doc/classes/SkeletonModification3DJiggle.xml b/doc/classes/SkeletonModification3DJiggle.xml
index e48e382cd4..6cc1c0b266 100644
--- a/doc/classes/SkeletonModification3DJiggle.xml
+++ b/doc/classes/SkeletonModification3DJiggle.xml
@@ -175,19 +175,19 @@
</methods>
<members>
<member name="damping" type="float" setter="set_damping" getter="get_damping" default="0.75">
- The default amount of dampening applied to the Jiggle joints, if they are not overriden. Higher values lead to more of the calculated velocity being applied.
+ The default amount of dampening applied to the Jiggle joints, if they are not overridden. Higher values lead to more of the calculated velocity being applied.
</member>
<member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3(0, -6, 0)">
- The default amount of gravity applied to the Jiggle joints, if they are not overriden.
+ The default amount of gravity applied to the Jiggle joints, if they are not overridden.
</member>
<member name="jiggle_data_chain_length" type="int" setter="set_jiggle_data_chain_length" getter="get_jiggle_data_chain_length" default="0">
The amount of Jiggle joints in the Jiggle modification.
</member>
<member name="mass" type="float" setter="set_mass" getter="get_mass" default="0.75">
- The default amount of mass assigned to the Jiggle joints, if they are not overriden. Higher values lead to faster movements and more overshooting.
+ The default amount of mass assigned to the Jiggle joints, if they are not overridden. Higher values lead to faster movements and more overshooting.
</member>
<member name="stiffness" type="float" setter="set_stiffness" getter="get_stiffness" default="3.0">
- The default amount of stiffness assigned to the Jiggle joints, if they are not overriden. Higher values act more like springs, quickly moving into the correct position.
+ The default amount of stiffness assigned to the Jiggle joints, if they are not overridden. Higher values act more like springs, quickly moving into the correct position.
</member>
<member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath(&quot;&quot;)">
The NodePath to the node that is the target for the Jiggle modification. This node is what the Jiggle chain will attempt to rotate the bone chain to.
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 0376a3f96e..de9eb518c6 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -181,7 +181,17 @@
<method name="get_extension" qualifiers="const">
<return type="String" />
<description>
- If the string is a valid file path, returns the extension.
+ Returns the extension without the leading period character ([code].[/code]) if the string is a valid file name or path. If the string does not contain an extension, returns an empty string instead.
+ [codeblock]
+ print("/path/to/file.txt".get_extension()) # "txt"
+ print("file.txt".get_extension()) # "txt"
+ print("file.sample.txt".get_extension()) # "txt"
+ print(".txt".get_extension()) # "txt"
+ print("file.txt.".get_extension()) # "" (empty string)
+ print("file.txt..".get_extension()) # "" (empty string)
+ print("txt".get_extension()) # "" (empty string)
+ print("".get_extension()) # "" (empty string)
+ [/codeblock]
</description>
</method>
<method name="get_file" qualifiers="const">
@@ -229,7 +239,7 @@
<method name="is_absolute_path" qualifiers="const">
<return type="bool" />
<description>
- If the string is a path to a file or directory, returns [code]true[/code] if the path is absolute.
+ Returns [code]true[/code] if the string is a path to a file or directory and its starting point is explicitly defined. This includes [code]res://[/code], [code]user://[/code], [code]C:\[/code], [code]/[/code], etc.
</description>
</method>
<method name="is_empty" qualifiers="const">
@@ -241,7 +251,7 @@
<method name="is_rel_path" qualifiers="const">
<return type="bool" />
<description>
- If the string is a path to a file or directory, returns [code]true[/code] if the path is relative.
+ Returns [code]true[/code] if the string is a path to a file or directory and its starting point is implicitly defined within the context it is being used. The starting point may refer to the current directory ([code]./[/code]), or the current [Node].
</description>
</method>
<method name="is_subsequence_of" qualifiers="const">
@@ -410,6 +420,21 @@
<argument index="0" name="number" type="float" />
<argument index="1" name="decimals" type="int" default="-1" />
<description>
+ Converts a [float] to a string representation of a decimal number.
+ The number of decimal places can be specified with [code]decimals[/code]. If [code]decimals[/code] is [code]-1[/code] (default), decimal places will be automatically adjusted so that the string representation has 14 significant digits (counting both digits to the left and the right of the decimal point).
+ Trailing zeros are not included in the string. The last digit will be rounded and not truncated.
+ Some examples:
+ [codeblock]
+ String.num(3.141593) # "3.141593"
+ String.num(3.141593, 3) # "3.142"
+ String.num(3.14159300) # "3.141593", no trailing zeros.
+ # Last digit will be rounded up here, which reduces total digit count since
+ # trailing zeros are removed:
+ String.num(42.129999, 5) # "42.13"
+ # If `decimals` is not specified, the total amount of significant digits is 14:
+ String.num(-0.0000012345432123454321) # "-0.00000123454321"
+ String.num(-10000.0000012345432123454321) # "-10000.0000012345"
+ [/codeblock]
</description>
</method>
<method name="num_scientific" qualifiers="static">
@@ -621,6 +646,12 @@
Returns the similarity index of the text compared to this string. 1 means totally similar and 0 means totally dissimilar.
</description>
</method>
+ <method name="simplify_path" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns a simplified canonical path.
+ </description>
+ </method>
<method name="split" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="delimiter" type="String" />
diff --git a/doc/classes/SyntaxHighlighter.xml b/doc/classes/SyntaxHighlighter.xml
index ea0d1c27a3..c478cb0eb6 100644
--- a/doc/classes/SyntaxHighlighter.xml
+++ b/doc/classes/SyntaxHighlighter.xml
@@ -17,7 +17,7 @@
Virtual method which can be overridden to clear any local caches.
</description>
</method>
- <method name="_get_line_syntax_highlighting" qualifiers="virtual">
+ <method name="_get_line_syntax_highlighting" qualifiers="virtual const">
<return type="Dictionary" />
<argument index="0" name="line" type="int" />
<description>
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index 7aa627b7d0..abb4119584 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -30,7 +30,7 @@
</method>
<method name="_handle_unicode_input" qualifiers="virtual">
<return type="void" />
- <argument index="0" name="unicode" type="int" />
+ <argument index="0" name="unicode_char" type="int" />
<description>
Override this method to define what happens when the types in the provided key [code]unicode[/code].
</description>
diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml
index fb94e14c8d..aa35acdbd2 100644
--- a/doc/classes/TextParagraph.xml
+++ b/doc/classes/TextParagraph.xml
@@ -220,13 +220,13 @@
<method name="get_spacing_bottom" qualifiers="const">
<return type="int" />
<description>
- Returns extra spacing at the bottom of the line. See [member Font.extra_spacing_bottom].
+ Returns extra spacing at the bottom of the line. See [member Font.spacing_bottom].
</description>
</method>
<method name="get_spacing_top" qualifiers="const">
<return type="int" />
<description>
- Returns extra spacing at the top of the line. See [member Font.extra_spacing_top].
+ Returns extra spacing at the top of the line. See [member Font.spacing_top].
</description>
</method>
<method name="hit_test" qualifiers="const">
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index ac56be4392..d7af2204cf 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -9,42 +9,10 @@
<tutorials>
</tutorials>
<methods>
- <method name="create_font_bitmap">
+ <method name="create_font">
<return type="RID" />
- <argument index="0" name="height" type="float" />
- <argument index="1" name="ascent" type="float" />
- <argument index="2" name="base_size" type="int" />
<description>
- Creates new, empty bitmap font. To free the resulting font, use [method free_rid] method.
- </description>
- </method>
- <method name="create_font_memory">
- <return type="RID" />
- <argument index="0" name="data" type="PackedByteArray" />
- <argument index="1" name="type" type="String" />
- <argument index="2" name="base_size" type="int" default="16" />
- <description>
- Creates new font from the data in memory. To free the resulting font, use [method free_rid] method.
- Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method font_get_base_size] to check actual font size.
- </description>
- </method>
- <method name="create_font_resource">
- <return type="RID" />
- <argument index="0" name="filename" type="String" />
- <argument index="1" name="base_size" type="int" default="16" />
- <description>
- Creates new font from the file. To free the resulting font, use [method free_rid] method.
- Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method font_get_base_size] to check actual font size.
- </description>
- </method>
- <method name="create_font_system">
- <return type="RID" />
- <argument index="0" name="name" type="String" />
- <argument index="1" name="base_size" type="int" default="16" />
- <description>
- Creates new font from the system font. To free the resulting font, use [method free_rid] method.
- Note: This method is supported by servers with the [code]FEATURE_FONT_SYSTEM[/code] feature.
- Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method font_get_base_size] to check actual font size.
+ Creates new, empty font cache entry resource. To free the resulting resourec, use [method free_rid] method.
</description>
</method>
<method name="create_shaped_text">
@@ -68,52 +36,53 @@
Draws box displaying character hexadecimal code. Used for replacing missing characters.
</description>
</method>
- <method name="font_bitmap_add_char">
+ <method name="font_clear_glyphs">
<return type="void" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="char" type="int" />
- <argument index="2" name="texture_idx" type="int" />
- <argument index="3" name="rect" type="Rect2" />
- <argument index="4" name="align" type="Vector2" />
- <argument index="5" name="advance" type="float" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
<description>
- Adds a character to the font, where [code]character[/code] is the Unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance.
+ Removes all rendered glyphs information from the cache entry. Note: This function will not remove textures associated with the glyphs, use [method font_remove_texture] to remove them manually.
</description>
</method>
- <method name="font_bitmap_add_kerning_pair">
+ <method name="font_clear_kerning_map">
<return type="void" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="A" type="int" />
- <argument index="2" name="B" type="int" />
- <argument index="3" name="kerning" type="int" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
<description>
- Adds a kerning pair to the bitmap font as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
+ Removes all kerning overrides.
</description>
</method>
- <method name="font_bitmap_add_texture">
+ <method name="font_clear_size_cache">
<return type="void" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="texture" type="Texture" />
+ <argument index="0" name="font_rid" type="RID" />
+ <description>
+ Removes all font sizes from the cache entry
+ </description>
+ </method>
+ <method name="font_clear_textures">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
<description>
- Adds a texture to the bitmap font.
+ Removes all textures from font cache entry. Note: This function will not remove glyphs associated with the texture, use [method font_remove_glyph] to remove them manually.
</description>
</method>
<method name="font_draw_glyph" qualifiers="const">
- <return type="Vector2" />
- <argument index="0" name="font" type="RID" />
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="canvas" type="RID" />
<argument index="2" name="size" type="int" />
<argument index="3" name="pos" type="Vector2" />
<argument index="4" name="index" type="int" />
<argument index="5" name="color" type="Color" default="Color(1, 1, 1, 1)" />
<description>
- Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
+ Draws single glyph into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code].
Note: Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index].
</description>
</method>
<method name="font_draw_glyph_outline" qualifiers="const">
- <return type="Vector2" />
- <argument index="0" name="font" type="RID" />
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="canvas" type="RID" />
<argument index="2" name="size" type="int" />
<argument index="3" name="outline_size" type="int" />
@@ -121,68 +90,46 @@
<argument index="5" name="index" type="int" />
<argument index="6" name="color" type="Color" default="Color(1, 1, 1, 1)" />
<description>
- Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
+ Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code].
Note: Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index].
</description>
</method>
- <method name="font_get_antialiased" qualifiers="const">
- <return type="bool" />
- <argument index="0" name="font" type="RID" />
- <description>
- Returns [code]true[/code], if font anti-aliasing is supported and enabled.
- </description>
- </method>
<method name="font_get_ascent" qualifiers="const">
<return type="float" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="size" type="int" />
<description>
Returns the font ascent (number of pixels above the baseline).
</description>
</method>
- <method name="font_get_base_size" qualifiers="const">
- <return type="float" />
- <argument index="0" name="font" type="RID" />
- <description>
- Returns the default size of the font.
- </description>
- </method>
<method name="font_get_descent" qualifiers="const">
<return type="float" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="size" type="int" />
<description>
Returns the font descent (number of pixels below the baseline).
</description>
</method>
- <method name="font_get_distance_field_hint" qualifiers="const">
- <return type="bool" />
- <argument index="0" name="font" type="RID" />
- <description>
- Returns [code]true[/code], if distance field hint is enabled.
- </description>
- </method>
- <method name="font_get_feature_list" qualifiers="const">
- <return type="Dictionary" />
- <argument index="0" name="font" type="RID" />
+ <method name="font_get_fixed_size" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
- Returns list of OpenType features supported by font.
+ Returns bitmap font fixed size.
</description>
</method>
- <method name="font_get_force_autohinter" qualifiers="const">
- <return type="bool" />
- <argument index="0" name="font" type="RID" />
+ <method name="font_get_global_oversampling" qualifiers="const">
+ <return type="float" />
<description>
- Returns [code]true[/code], if autohinter is supported and enabled.
+ Returns the font oversampling factor, shared by all fonts in the TextServer.
</description>
</method>
<method name="font_get_glyph_advance" qualifiers="const">
<return type="Vector2" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="index" type="int" />
- <argument index="2" name="size" type="int" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph" type="int" />
<description>
- Returns advance of the glyph.
+ Returns glyph advance (offset of the next glyph). Note: advance for glyphs outlines is the same as the base glyph advance and is not saved.
</description>
</method>
<method name="font_get_glyph_contours" qualifiers="const">
@@ -191,7 +138,7 @@
<argument index="1" name="size" type="int" />
<argument index="2" name="index" type="int" />
<description>
- Returns outline contours of the glyph in a Dictionary.
+ Returns outline contours of the glyph as a [code]Dictionary[/code] with the following contents:
[code]points[/code] - [PackedVector3Array], containing outline points. [code]x[/code] and [code]y[/code] are point coordinates. [code]z[/code] is the type of the point, using the [enum ContourPointTag] values.
[code]contours[/code] - [PackedInt32Array], containing indices the end points of each contour.
[code]orientation[/code] - [bool], contour orientation. If [code]true[/code], clockwise contours must be filled.
@@ -199,41 +146,85 @@
</method>
<method name="font_get_glyph_index" qualifiers="const">
<return type="int" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="char" type="int" />
- <argument index="2" name="variation_selector" type="int" default="0" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="char" type="int" />
+ <argument index="3" name="variation_selector" type="int" />
<description>
Returns the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
</description>
</method>
- <method name="font_get_glyph_kerning" qualifiers="const">
+ <method name="font_get_glyph_list" qualifiers="const">
+ <return type="Array" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <description>
+ Returns list of rendered glyphs in the cache entry.
+ </description>
+ </method>
+ <method name="font_get_glyph_offset" qualifiers="const">
<return type="Vector2" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="index_a" type="int" />
- <argument index="2" name="index_b" type="int" />
- <argument index="3" name="size" type="int" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
<description>
- Returns a kerning of the pair of glyphs.
+ Returns glyph offset from the baseline.
</description>
</method>
- <method name="font_get_height" qualifiers="const">
- <return type="float" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="size" type="int" />
+ <method name="font_get_glyph_size" qualifiers="const">
+ <return type="Vector2" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
<description>
- Returns the total font height (ascent plus descent) in pixels.
+ Returns size of the glyph.
+ </description>
+ </method>
+ <method name="font_get_glyph_texture_idx" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <description>
+ Returns index of the cache texture containing the glyph.
+ </description>
+ </method>
+ <method name="font_get_glyph_uv_rect" qualifiers="const">
+ <return type="Rect2" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <description>
+ Returns rectangle in the cache texture containing the glyph.
</description>
</method>
<method name="font_get_hinting" qualifiers="const">
<return type="int" enum="TextServer.Hinting" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
- Returns the font hinting.
+ Returns the font hinting mode. Used by dynamic fonts only.
+ </description>
+ </method>
+ <method name="font_get_kerning" qualifiers="const">
+ <return type="Vector2" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph_pair" type="Vector2i" />
+ <description>
+ Returns kerning for the pair of glyphs.
+ </description>
+ </method>
+ <method name="font_get_kerning_list" qualifiers="const">
+ <return type="Array" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <description>
+ Returns list of the kerning overrides.
</description>
</method>
<method name="font_get_language_support_override">
<return type="bool" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="language" type="String" />
<description>
Returns [code]true[/code] if support override is enabled for the [code]language[/code].
@@ -241,20 +232,43 @@
</method>
<method name="font_get_language_support_overrides">
<return type="PackedStringArray" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
Returns list of language support overrides.
</description>
</method>
+ <method name="font_get_msdf_pixel_range" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="font_rid" type="RID" />
+ <description>
+ Return the width of the range around the shape between the minimum and maximum representable signed distance.
+ </description>
+ </method>
+ <method name="font_get_msdf_size" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="font_rid" type="RID" />
+ <description>
+ Returns source font size used to generate MSDF textures.
+ </description>
+ </method>
<method name="font_get_oversampling" qualifiers="const">
<return type="float" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
- Returns the font oversampling factor, shared by all fonts in the TextServer.
+ Returns font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only.
+ </description>
+ </method>
+ <method name="font_get_scale" qualifiers="const">
+ <return type="float" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <description>
+ Returns scaling factor of the color bitmap font.
</description>
</method>
<method name="font_get_script_support_override">
<return type="bool" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="script" type="String" />
<description>
Returns [code]true[/code] if support override is enabled for the [code]script[/code].
@@ -262,98 +276,149 @@
</method>
<method name="font_get_script_support_overrides">
<return type="PackedStringArray" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
Returns list of script support overrides.
</description>
</method>
- <method name="font_get_spacing_glyph" qualifiers="const">
- <return type="int" />
- <argument index="0" name="font" type="RID" />
+ <method name="font_get_size_cache_list" qualifiers="const">
+ <return type="Array" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
- Returns extra spacing for each glyph in pixels.
+ Return 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_spacing_space" qualifiers="const">
+ <method name="font_get_spacing" qualifiers="const">
<return type="int" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" />
<description>
- Sets extra spacing for each glyph in pixels.
+ Returns extra spacing added between glyphs in pixels.
</description>
</method>
<method name="font_get_supported_chars" qualifiers="const">
<return type="String" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
Returns a string containing all the characters available in the font.
</description>
</method>
- <method name="font_get_underline_position" qualifiers="const">
- <return type="float" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="size" type="int" />
+ <method name="font_get_texture_count" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
<description>
- Returns underline offset (number of pixels below the baseline).
+ Returns number of textures used by font cache entry.
</description>
</method>
- <method name="font_get_underline_thickness" qualifiers="const">
+ <method name="font_get_texture_image" qualifiers="const">
+ <return type="Image" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <description>
+ Returns font cache texture image data.
+ </description>
+ </method>
+ <method name="font_get_texture_offsets" qualifiers="const">
+ <return type="PackedInt32Array" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <description>
+ Returns array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty.
+ </description>
+ </method>
+ <method name="font_get_underline_position" qualifiers="const">
<return type="float" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="size" type="int" />
<description>
- Returns underline thickness in pixels.
+ Returns pixel offset of the underline below the baseline.
</description>
</method>
- <method name="font_get_variation" qualifiers="const">
+ <method name="font_get_underline_thickness" qualifiers="const">
<return type="float" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="tag" type="String" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
<description>
- Returns variation coordinate [code]tag[/code].
+ Returns thickness of the underline in pixels.
</description>
</method>
- <method name="font_get_variation_list" qualifiers="const">
+ <method name="font_get_variation_coordinates" qualifiers="const">
<return type="Dictionary" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
- Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code].
- Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant.
+ Returns variation coordinates for the specified font cache entry. See [method font_supported_variation_list] for more info.
</description>
</method>
<method name="font_has_char" qualifiers="const">
<return type="bool" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="char" type="int" />
<description>
- Returns [code]true[/code] if [code]char[/code] is available in the font.
+ Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
</description>
</method>
- <method name="font_has_outline" qualifiers="const">
+ <method name="font_is_antialiased" qualifiers="const">
<return type="bool" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
+ <description>
+ Returns [code]true[/code] if font 8-bit anitialiased glyph rendering is supported and enabled.
+ </description>
+ </method>
+ <method name="font_is_force_autohinter" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
- Returns [code]true[/code], if font supports glyph outlines.
+ Returns [code]true[/code] if auto-hinting is supported and preffered over font built-in hinting. Used by dynamic fonts only.
</description>
</method>
<method name="font_is_language_supported" qualifiers="const">
<return type="bool" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="language" type="String" />
<description>
- Returns [code]true[/code], if font supports given language (ISO 639 code).
+ Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code).
+ </description>
+ </method>
+ <method name="font_is_multichannel_signed_distance_field" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="font_rid" type="RID" />
+ <description>
+ Returns [code]true[/code] if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
</description>
</method>
<method name="font_is_script_supported" qualifiers="const">
<return type="bool" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="script" type="String" />
<description>
Returns [code]true[/code], if font supports given script (ISO 15924 code).
</description>
</method>
+ <method name="font_remove_glyph">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <description>
+ Removes specified rendered glyph information from the cache entry. Note: This function will not remove textures associated with the glyphs, use [method font_remove_texture] to remove them manually.
+ </description>
+ </method>
+ <method name="font_remove_kerning">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph_pair" type="Vector2i" />
+ <description>
+ Removes kerning override for the pair of glyphs.
+ </description>
+ </method>
<method name="font_remove_language_support_override">
<return type="void" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="language" type="String" />
<description>
Remove language support override.
@@ -361,92 +426,299 @@
</method>
<method name="font_remove_script_support_override">
<return type="void" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="script" type="String" />
<description>
Removes script support override.
</description>
</method>
+ <method name="font_remove_size_cache">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <description>
+ Removes specified font size from the cache entry.
+ </description>
+ </method>
+ <method name="font_remove_texture">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <description>
+ Removes specified texture from font cache entry. Note: This function will not remove glyphs associated with the texture, remove them manually, using [method font_remove_glyph].
+ </description>
+ </method>
+ <method name="font_render_glyph">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="index" type="int" />
+ <description>
+ Renders specified glyph the the font cache texture.
+ </description>
+ </method>
+ <method name="font_render_range">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="start" type="int" />
+ <argument index="3" name="end" type="int" />
+ <description>
+ Renders the range of characters to the font cache texture.
+ </description>
+ </method>
<method name="font_set_antialiased">
<return type="void" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="antialiased" type="bool" />
<description>
- Sets font anti-aliasing.
+ If set to [code]true[/code], 8-bit antialiased glyph rendering is used, otherwise 1-bit rendering is used. Used by dynamic fonts only.
</description>
</method>
- <method name="font_set_distance_field_hint">
+ <method name="font_set_ascent">
<return type="void" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="distance_field" type="bool" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="ascent" type="float" />
+ <description>
+ Sets the font ascent (number of pixels above the baseline).
+ </description>
+ </method>
+ <method name="font_set_data">
+ <return type="void" />
+ <argument index="0" name="data" type="RID" />
+ <argument index="1" name="arg1" type="PackedByteArray" />
<description>
- Sets font distance field hint.
+ Sets font source data, e.g contents of the dynamic font source file.
+ </description>
+ </method>
+ <method name="font_set_descent">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="descent" type="float" />
+ <description>
+ Sets the font descent (number of pixels below the baseline).
+ </description>
+ </method>
+ <method name="font_set_fixed_size">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="fixed_size" type="int" />
+ <description>
+ Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes.
</description>
</method>
<method name="font_set_force_autohinter">
<return type="void" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="enabeld" type="bool" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="force_autohinter" type="bool" />
+ <description>
+ If set to [code]true[/code] auto-hinting is preffered over font built-in hinting.
+ </description>
+ </method>
+ <method name="font_set_global_oversampling">
+ <return type="void" />
+ <argument index="0" name="oversampling" type="float" />
+ <description>
+ Sets oversampling factor, shared by all font in the TextServer.
+ Note: This value can be automaticaly changed by display server.
+ </description>
+ </method>
+ <method name="font_set_glyph_advance">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="advance" type="Vector2" />
+ <description>
+ Sets glyph advance (offset of the next glyph). Note: advance for glyphs outlines is the same as the base glyph advance and is not saved.
+ </description>
+ </method>
+ <method name="font_set_glyph_offset">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="offset" type="Vector2" />
+ <description>
+ Sets glyph offset from the baseline.
+ </description>
+ </method>
+ <method name="font_set_glyph_size">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="gl_size" type="Vector2" />
<description>
- Enables/disables default autohinter.
+ Sets size of the glyph.
+ </description>
+ </method>
+ <method name="font_set_glyph_texture_idx">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="texture_idx" type="int" />
+ <description>
+ Sets index of the cache texture containing the glyph.
+ </description>
+ </method>
+ <method name="font_set_glyph_uv_rect">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="glyph" type="int" />
+ <argument index="3" name="uv_rect" type="Rect2" />
+ <description>
+ Sets rectangle in the cache texture containing the glyph.
</description>
</method>
<method name="font_set_hinting">
<return type="void" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="hinting" type="int" enum="TextServer.Hinting" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="_hinting" type="int" enum="TextServer.Hinting" />
<description>
- Sets font hinting.
+ Sets font hinting mode. Used by dynamic fonts only.
+ </description>
+ </method>
+ <method name="font_set_kerning">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="glyph_pair" type="Vector2i" />
+ <argument index="3" name="kerning" type="Vector2" />
+ <description>
+ Sets kerning for the pair of glyphs.
</description>
</method>
<method name="font_set_language_support_override">
<return type="void" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="language" type="String" />
<argument index="2" name="supported" type="bool" />
<description>
Adds override for [method font_is_language_supported].
</description>
</method>
+ <method name="font_set_msdf_pixel_range">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="msdf_pixel_range" type="int" />
+ <description>
+ Sets the width of the range around the shape between the minimum and maximum representable signed distance.
+ </description>
+ </method>
+ <method name="font_set_msdf_size">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="msdf_size" type="int" />
+ <description>
+ Sets source font size used to generate MSDF textures.
+ </description>
+ </method>
+ <method name="font_set_multichannel_signed_distance_field">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="msdf" type="bool" />
+ <description>
+ If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
+ </description>
+ </method>
<method name="font_set_oversampling">
<return type="void" />
- <argument index="0" name="oversampling" type="float" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="oversampling" type="float" />
<description>
- Sets oversampling factor, shared by all font in the TextServer.
+ Sets font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only.
+ </description>
+ </method>
+ <method name="font_set_scale">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="scale" type="float" />
+ <description>
+ Sets scaling factor of the color bitmap font.
</description>
</method>
<method name="font_set_script_support_override">
<return type="void" />
- <argument index="0" name="font" type="RID" />
+ <argument index="0" name="font_rid" type="RID" />
<argument index="1" name="script" type="String" />
<argument index="2" name="supported" type="bool" />
<description>
Adds override for [method font_is_script_supported].
</description>
</method>
- <method name="font_set_spacing_glyph">
+ <method name="font_set_spacing">
<return type="void" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="value" type="int" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" />
+ <argument index="3" name="value" type="int" />
<description>
- Returns extra spacing for the space character in pixels.
+ Sets extra spacing added between glyphs in pixels.
</description>
</method>
- <method name="font_set_spacing_space">
+ <method name="font_set_texture_image">
<return type="void" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="value" type="int" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <argument index="3" name="image" type="Image" />
<description>
- Sets extra spacing for the space character in pixels.
+ Sets font cache texture image data.
</description>
</method>
- <method name="font_set_variation">
+ <method name="font_set_texture_offsets">
<return type="void" />
- <argument index="0" name="font" type="RID" />
- <argument index="1" name="tag" type="String" />
- <argument index="2" name="value" type="float" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="Vector2i" />
+ <argument index="2" name="texture_index" type="int" />
+ <argument index="3" name="offset" type="PackedInt32Array" />
+ <description>
+ Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty.
+ </description>
+ </method>
+ <method name="font_set_underline_position">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="underline_position" type="float" />
+ <description>
+ Sets pixel offset of the underline below the baseline.
+ </description>
+ </method>
+ <method name="font_set_underline_thickness">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="size" type="int" />
+ <argument index="2" name="underline_thickness" type="float" />
+ <description>
+ Sets thickness of the underline in pixels.
+ </description>
+ </method>
+ <method name="font_set_variation_coordinates">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="variation_coordinates" type="Dictionary" />
+ <description>
+ Sets variation coordinates for the specified font cache entry. See [method font_supported_variation_list] for more info.
+ </description>
+ </method>
+ <method name="font_supported_feature_list" qualifiers="const">
+ <return type="Dictionary" />
+ <argument index="0" name="font_rid" type="RID" />
+ <description>
+ </description>
+ </method>
+ <method name="font_supported_variation_list" qualifiers="const">
+ <return type="Dictionary" />
+ <argument index="0" name="font_rid" type="RID" />
<description>
- Sets variation coordinate [code]name[/code]. Unsupported coordinates will be silently ignored.
</description>
</method>
<method name="format_number" qualifiers="const">
@@ -478,13 +750,6 @@
Returns the name of the server interface.
</description>
</method>
- <method name="get_system_fonts" qualifiers="const">
- <return type="PackedStringArray" />
- <description>
- Returns list of available system fonts.
- Note: This method is supported by servers with the [code]FEATURE_FONT_SYSTEM[/code] feature.
- </description>
- </method>
<method name="has">
<return type="bool" />
<argument index="0" name="rid" type="RID" />
@@ -514,7 +779,7 @@
Note: This function should be called before any other TextServer functions used, otherwise it won't have any effect.
</description>
</method>
- <method name="name_to_tag">
+ <method name="name_to_tag" qualifiers="const">
<return type="int" />
<argument index="0" name="name" type="String" />
<description>
@@ -890,7 +1155,7 @@
Aligns shaped text to the given tab-stops.
</description>
</method>
- <method name="tag_to_name">
+ <method name="tag_to_name" qualifiers="const">
<return type="String" />
<argument index="0" name="tag" type="int" />
<description>
@@ -1023,5 +1288,17 @@
<constant name="CONTOUR_CURVE_TAG_OFF_CUBIC" value="2" enum="ContourPointTag">
Contour point isn't on the curve, but serves as a control point for a cubic Bézier arc.
</constant>
+ <constant name="SPACING_GLYPH" value="0" enum="SpacingType">
+ Spacing for each glyph.
+ </constant>
+ <constant name="SPACING_SPACE" value="1" enum="SpacingType">
+ Spacing for the space character.
+ </constant>
+ <constant name="SPACING_TOP" value="2" enum="SpacingType">
+ Spacing at the top of the line.
+ </constant>
+ <constant name="SPACING_BOTTOM" value="3" enum="SpacingType">
+ Spacing at the bottom of the line.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index 50a573d30f..ed24905254 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -552,6 +552,9 @@
<theme_item name="hseparation" data_type="constant" type="int" default="4">
The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled.
</theme_item>
+ <theme_item name="indeterminate" data_type="icon" type="Texture2D">
+ The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is indeterminate.
+ </theme_item>
<theme_item name="item_margin" data_type="constant" type="int" default="12">
The horizontal margin at the start of an item. This is used when folding is enabled for the item.
</theme_item>
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index 944b9fdc06..b997d87ac0 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -140,6 +140,14 @@
<return type="Font" />
<argument index="0" name="column" type="int" />
<description>
+ Returns custom font used to draw text in the column [code]column[/code].
+ </description>
+ </method>
+ <method name="get_custom_font_size" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="column" type="int" />
+ <description>
+ Returns custom font size used to draw text in the column [code]column[/code].
</description>
</method>
<method name="get_expand_right" qualifiers="const">
@@ -340,6 +348,13 @@
Returns [code]true[/code] if column [code]column[/code] is editable.
</description>
</method>
+ <method name="is_indeterminate" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="column" type="int" />
+ <description>
+ Returns [code]true[/code] if the given column is indeterminate.
+ </description>
+ </method>
<method name="is_selectable" qualifiers="const">
<return type="bool" />
<argument index="0" name="column" type="int" />
@@ -415,7 +430,7 @@
<argument index="0" name="column" type="int" />
<argument index="1" name="checked" type="bool" />
<description>
- If [code]true[/code], the column [code]column[/code] is checked.
+ If [code]true[/code], the column [code]column[/code] is checked. Clears column's indeterminate status.
</description>
</method>
<method name="set_custom_as_button">
@@ -457,6 +472,15 @@
<argument index="0" name="column" type="int" />
<argument index="1" name="font" type="Font" />
<description>
+ Sets custom font used to draw text in the column [code]column[/code].
+ </description>
+ </method>
+ <method name="set_custom_font_size">
+ <return type="void" />
+ <argument index="0" name="column" type="int" />
+ <argument index="1" name="font_size" type="int" />
+ <description>
+ Sets custom font size used to draw text in the column [code]column[/code].
</description>
</method>
<method name="set_editable">
@@ -507,6 +531,15 @@
Sets the given column's icon's texture region.
</description>
</method>
+ <method name="set_indeterminate">
+ <return type="void" />
+ <argument index="0" name="column" type="int" />
+ <argument index="1" name="indeterminate" type="bool" />
+ <description>
+ If [code]true[/code], the column [code]column[/code] is marked indeterminate.
+ [b]Note:[/b] If set [code]true[/code] from [code]false[/code], then column is cleared of checked status.
+ </description>
+ </method>
<method name="set_language">
<return type="void" />
<argument index="0" name="column" type="int" />
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 4a62d3ec7b..46f38e91f7 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -113,26 +113,33 @@
Returns [code]true[/code] if the viewport is currently performing a drag operation.
</description>
</method>
- <method name="input">
+ <method name="is_embedding_subwindows" qualifiers="const">
+ <return type="bool" />
+ <description>
+ </description>
+ </method>
+ <method name="is_input_handled" qualifiers="const">
+ <return type="bool" />
+ <description>
+ </description>
+ </method>
+ <method name="push_input">
<return type="void" />
<argument index="0" name="event" type="InputEvent" />
<argument index="1" name="in_local_coords" type="bool" default="false" />
<description>
</description>
</method>
- <method name="input_text">
+ <method name="push_text_input">
<return type="void" />
<argument index="0" name="text" type="String" />
<description>
</description>
</method>
- <method name="is_embedding_subwindows" qualifiers="const">
- <return type="bool" />
- <description>
- </description>
- </method>
- <method name="is_input_handled" qualifiers="const">
- <return type="bool" />
+ <method name="push_unhandled_input">
+ <return type="void" />
+ <argument index="0" name="event" type="InputEvent" />
+ <argument index="1" name="in_local_coords" type="bool" default="false" />
<description>
</description>
</method>
@@ -150,13 +157,6 @@
Sets the number of subdivisions to use in the specified quadrant. A higher number of subdivisions allows you to have more shadows in the scene at once, but reduces the quality of the shadows. A good practice is to have quadrants with a varying number of subdivisions and to have as few subdivisions as possible.
</description>
</method>
- <method name="unhandled_input">
- <return type="void" />
- <argument index="0" name="event" type="InputEvent" />
- <argument index="1" name="in_local_coords" type="bool" default="false" />
- <description>
- </description>
- </method>
<method name="warp_mouse">
<return type="void" />
<argument index="0" name="to_position" type="Vector2" />
@@ -211,6 +211,9 @@
<member name="physics_object_picking" type="bool" setter="set_physics_object_picking" getter="get_physics_object_picking" default="false">
If [code]true[/code], the objects rendered by viewport become subjects of mouse picking process.
</member>
+ <member name="scale_3d" type="int" setter="set_scale_3d" getter="get_scale_3d" enum="Viewport.Scale3D" default="0">
+ The scale at which 3D content is rendered.
+ </member>
<member name="screen_space_aa" type="int" setter="set_screen_space_aa" getter="get_screen_space_aa" enum="Viewport.ScreenSpaceAA" default="0">
Sets the screen-space antialiasing method used. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry.
</member>
@@ -271,6 +274,16 @@
</signal>
</signals>
<constants>
+ <constant name="SCALE_3D_DISABLED" value="0" enum="Scale3D">
+ </constant>
+ <constant name="SCALE_3D_75_PERCENT" value="1" enum="Scale3D">
+ </constant>
+ <constant name="SCALE_3D_50_PERCENT" value="2" enum="Scale3D">
+ </constant>
+ <constant name="SCALE_3D_33_PERCENT" value="3" enum="Scale3D">
+ </constant>
+ <constant name="SCALE_3D_25_PERCENT" value="4" enum="Scale3D">
+ </constant>
<constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED" value="0" enum="ShadowAtlasQuadrantSubdiv">
This quadrant will not be used.
</constant>
diff --git a/doc/classes/VisualScriptCustomNodes.xml b/doc/classes/VisualScriptCustomNodes.xml
new file mode 100644
index 0000000000..3ef8022f5e
--- /dev/null
+++ b/doc/classes/VisualScriptCustomNodes.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="VisualScriptCustomNodes" inherits="Object" version="4.0">
+ <brief_description>
+ Manages custom nodes for the Visual Script editor.
+ </brief_description>
+ <description>
+ This singleton can be used to manage (i.e., add or remove) custom nodes for the Visual Script editor.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_custom_node">
+ <return type="void" />
+ <argument index="0" name="name" type="String" />
+ <argument index="1" name="category" type="String" />
+ <argument index="2" name="script" type="Script" />
+ <description>
+ Add a custom Visual Script node to the editor. It'll be placed under "Custom Nodes" with the [code]category[/code] as the parameter.
+ </description>
+ </method>
+ <method name="remove_custom_node">
+ <return type="void" />
+ <argument index="0" name="name" type="String" />
+ <argument index="1" name="category" type="String" />
+ <description>
+ Remove a custom Visual Script node from the editor. Custom nodes already placed on scripts won't be removed.
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="custom_nodes_updated">
+ <description>
+ Emitted when a custom Visual Script node is added or removed.
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml
index f6dbd2ad43..3a489419c1 100644
--- a/doc/classes/VisualShaderNodeCustom.xml
+++ b/doc/classes/VisualShaderNodeCustom.xml
@@ -16,17 +16,17 @@
<link title="Visual Shader plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/visual_shader_plugins.html</link>
</tutorials>
<methods>
- <method name="_get_category" qualifiers="virtual">
+ <method name="_get_category" qualifiers="virtual const">
<return type="String" />
<description>
Override this method to define the path to the associated custom node in the Visual Shader Editor's members dialog. The path may look like [code]"MyGame/MyFunctions/Noise"[/code].
Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the "Addons" category.
</description>
</method>
- <method name="_get_code" qualifiers="virtual">
+ <method name="_get_code" qualifiers="virtual const">
<return type="String" />
- <argument index="0" name="input_vars" type="Array" />
- <argument index="1" name="output_vars" type="Array" />
+ <argument index="0" name="input_vars" type="PackedStringArray" />
+ <argument index="1" name="output_vars" type="String[]" />
<argument index="2" name="mode" type="int" />
<argument index="3" name="type" type="int" />
<description>
@@ -37,14 +37,14 @@
Defining this method is [b]required[/b].
</description>
</method>
- <method name="_get_description" qualifiers="virtual">
+ <method name="_get_description" qualifiers="virtual const">
<return type="String" />
<description>
Override this method to define the description of the associated custom node in the Visual Shader Editor's members dialog.
Defining this method is [b]optional[/b].
</description>
</method>
- <method name="_get_global_code" qualifiers="virtual">
+ <method name="_get_global_code" qualifiers="virtual const">
<return type="String" />
<argument index="0" name="mode" type="int" />
<description>
@@ -54,22 +54,22 @@
Defining this method is [b]optional[/b].
</description>
</method>
- <method name="_get_input_port_count" qualifiers="virtual">
+ <method name="_get_input_port_count" qualifiers="virtual const">
<return type="int" />
<description>
Override this method to define the amount of input ports of the associated custom node.
Defining this method is [b]required[/b]. If not overridden, the node has no input ports.
</description>
</method>
- <method name="_get_input_port_name" qualifiers="virtual">
- <return type="StringName" />
+ <method name="_get_input_port_name" qualifiers="virtual const">
+ <return type="String" />
<argument index="0" name="port" type="int" />
<description>
Override this method to define the names of input ports of the associated custom node. The names are used both for the input slots in the editor and as identifiers in the shader code, and are passed in the [code]input_vars[/code] array in [method _get_code].
Defining this method is [b]optional[/b], but recommended. If not overridden, input ports are named as [code]"in" + str(port)[/code].
</description>
</method>
- <method name="_get_input_port_type" qualifiers="virtual">
+ <method name="_get_input_port_type" qualifiers="virtual const">
<return type="int" />
<argument index="0" name="port" type="int" />
<description>
@@ -77,29 +77,29 @@
Defining this method is [b]optional[/b], but recommended. If not overridden, input ports will return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type.
</description>
</method>
- <method name="_get_name" qualifiers="virtual">
+ <method name="_get_name" qualifiers="virtual const">
<return type="String" />
<description>
Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph.
Defining this method is [b]optional[/b], but recommended. If not overridden, the node will be named as "Unnamed".
</description>
</method>
- <method name="_get_output_port_count" qualifiers="virtual">
+ <method name="_get_output_port_count" qualifiers="virtual const">
<return type="int" />
<description>
Override this method to define the amount of output ports of the associated custom node.
Defining this method is [b]required[/b]. If not overridden, the node has no output ports.
</description>
</method>
- <method name="_get_output_port_name" qualifiers="virtual">
- <return type="StringName" />
+ <method name="_get_output_port_name" qualifiers="virtual const">
+ <return type="String" />
<argument index="0" name="port" type="int" />
<description>
Override this method to define the names of output ports of the associated custom node. The names are used both for the output slots in the editor and as identifiers in the shader code, and are passed in the [code]output_vars[/code] array in [method _get_code].
Defining this method is [b]optional[/b], but recommended. If not overridden, output ports are named as [code]"out" + str(port)[/code].
</description>
</method>
- <method name="_get_output_port_type" qualifiers="virtual">
+ <method name="_get_output_port_type" qualifiers="virtual const">
<return type="int" />
<argument index="0" name="port" type="int" />
<description>
@@ -107,14 +107,14 @@
Defining this method is [b]optional[/b], but recommended. If not overridden, output ports will return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type.
</description>
</method>
- <method name="_get_return_icon_type" qualifiers="virtual">
+ <method name="_get_return_icon_type" qualifiers="virtual const">
<return type="int" />
<description>
Override this method to define the return icon of the associated custom node in the Visual Shader Editor's members dialog.
Defining this method is [b]optional[/b]. If not overridden, no return icon is shown.
</description>
</method>
- <method name="_is_highend" qualifiers="virtual">
+ <method name="_is_highend" qualifiers="virtual const">
<return type="bool" />
<description>
Override this method to enable high-end mark in the Visual Shader Editor's members dialog.
diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml
index 1fb73e59b4..2a740ab1e8 100644
--- a/doc/classes/XRInterface.xml
+++ b/doc/classes/XRInterface.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="XRInterface" inherits="RefCounted" version="4.0">
<brief_description>
- Base class for an AR/VR interface implementation.
+ Base class for an XR interface implementation.
</brief_description>
<description>
This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDNative modules (note that for GDNative the subclass XRScriptInterface should be used). Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform.
@@ -26,17 +26,17 @@
<method name="get_name" qualifiers="const">
<return type="StringName" />
<description>
- Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc).
+ Returns the name of this interface (OpenXR, OpenVR, OpenHMD, ARKit, etc).
</description>
</method>
- <method name="get_render_targetsize">
+ <method name="get_render_target_size">
<return type="Vector2" />
<description>
Returns the resolution at which we should render our intermediate results before things like lens distortion are applied by the VR platform.
</description>
</method>
<method name="get_tracking_status" qualifiers="const">
- <return type="int" enum="XRInterface.Tracking_status" />
+ <return type="int" enum="XRInterface.TrackingStatus" />
<description>
If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking.
</description>
@@ -52,11 +52,17 @@
<description>
Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output.
After initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence.
- [b]Note:[/b] You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR.
+ [b]Note:[/b] You must enable the XR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR.
If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to do anything you like in the main window, such as using a separate camera as a spectator camera or rendering something completely different.
While currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD.
</description>
</method>
+ <method name="is_initialized" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Is [code]true[/code] if this interface has been initialised.
+ </description>
+ </method>
<method name="uninitialize">
<return type="void" />
<description>
@@ -68,10 +74,7 @@
<member name="ar_is_anchor_detection_enabled" type="bool" setter="set_anchor_detection_is_enabled" getter="get_anchor_detection_is_enabled" default="false">
On an AR interface, [code]true[/code] if anchor detection is enabled.
</member>
- <member name="interface_is_initialized" type="bool" setter="set_is_initialized" getter="is_initialized" default="false">
- [code]true[/code] if this interface been initialized.
- </member>
- <member name="interface_is_primary" type="bool" setter="set_is_primary" getter="is_primary" default="false">
+ <member name="interface_is_primary" type="bool" setter="set_primary" getter="is_primary" default="false">
[code]true[/code] if this is the primary interface.
</member>
</members>
@@ -89,7 +92,7 @@
This interface supports AR (video background and real world tracking).
</constant>
<constant name="XR_EXTERNAL" value="8" enum="Capabilities">
- This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of [method get_render_targetsize]). Using a separate viewport node frees up the main viewport for other purposes.
+ This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of [method get_render_target_size]). Using a separate viewport node frees up the main viewport for other purposes.
</constant>
<constant name="EYE_MONO" value="0" enum="Eyes">
Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported.
@@ -100,19 +103,19 @@
<constant name="EYE_RIGHT" value="2" enum="Eyes">
Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information.
</constant>
- <constant name="XR_NORMAL_TRACKING" value="0" enum="Tracking_status">
+ <constant name="XR_NORMAL_TRACKING" value="0" enum="TrackingStatus">
Tracking is behaving as expected.
</constant>
- <constant name="XR_EXCESSIVE_MOTION" value="1" enum="Tracking_status">
+ <constant name="XR_EXCESSIVE_MOTION" value="1" enum="TrackingStatus">
Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up).
</constant>
- <constant name="XR_INSUFFICIENT_FEATURES" value="2" enum="Tracking_status">
+ <constant name="XR_INSUFFICIENT_FEATURES" value="2" enum="TrackingStatus">
Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc.
</constant>
- <constant name="XR_UNKNOWN_TRACKING" value="3" enum="Tracking_status">
+ <constant name="XR_UNKNOWN_TRACKING" value="3" enum="TrackingStatus">
We don't know the status of the tracking or this interface does not provide feedback.
</constant>
- <constant name="XR_NOT_TRACKING" value="4" enum="Tracking_status">
+ <constant name="XR_NOT_TRACKING" value="4" enum="TrackingStatus">
Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.).
</constant>
</constants>
diff --git a/doc/classes/XRInterfaceExtension.xml b/doc/classes/XRInterfaceExtension.xml
new file mode 100644
index 0000000000..46d8d7e4e8
--- /dev/null
+++ b/doc/classes/XRInterfaceExtension.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="XRInterfaceExtension" inherits="XRInterface" version="4.0">
+ <brief_description>
+ Base class for XR interface extensions (plugins).
+ </brief_description>
+ <description>
+ External XR interface plugins should inherit from this class.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="_commit_views" qualifiers="virtual">
+ <return type="void" />
+ <argument index="0" name="" type="RID" />
+ <argument index="1" name="" type="Rect2" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_anchor_detection_is_enabled" qualifiers="virtual const">
+ <return type="bool" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_camera_feed_id" qualifiers="virtual const">
+ <return type="int" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_camera_transform" qualifiers="virtual">
+ <return type="Transform3D" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_capabilities" qualifiers="virtual const">
+ <return type="int" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_name" qualifiers="virtual const">
+ <return type="StringName" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_projection_for_view" qualifiers="virtual">
+ <return type="PackedFloat64Array" />
+ <argument index="0" name="view" type="int" />
+ <argument index="1" name="aspect" type="float" />
+ <argument index="2" name="z_near" type="float" />
+ <argument index="3" name="z_far" type="float" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_render_target_size" qualifiers="virtual">
+ <return type="Vector2" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_tracking_status" qualifiers="virtual const">
+ <return type="int" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_transform_for_view" qualifiers="virtual">
+ <return type="Transform3D" />
+ <argument index="0" name="view" type="int" />
+ <argument index="1" name="cam_transform" type="Transform3D" />
+ <description>
+ </description>
+ </method>
+ <method name="_get_view_count" qualifiers="virtual">
+ <return type="int" />
+ <description>
+ </description>
+ </method>
+ <method name="_initialize" qualifiers="virtual">
+ <return type="bool" />
+ <description>
+ </description>
+ </method>
+ <method name="_is_initialized" qualifiers="virtual const">
+ <return type="bool" />
+ <description>
+ </description>
+ </method>
+ <method name="_notification" qualifiers="virtual">
+ <return type="void" />
+ <argument index="0" name="what" type="int" />
+ <description>
+ </description>
+ </method>
+ <method name="_process" qualifiers="virtual">
+ <return type="void" />
+ <description>
+ </description>
+ </method>
+ <method name="_set_anchor_detection_is_enabled" qualifiers="virtual">
+ <return type="void" />
+ <argument index="0" name="enabled" type="bool" />
+ <description>
+ </description>
+ </method>
+ <method name="_uninitialize" qualifiers="virtual">
+ <return type="void" />
+ <description>
+ </description>
+ </method>
+ <method name="add_blit">
+ <return type="void" />
+ <argument index="0" name="render_target" type="RID" />
+ <argument index="1" name="rect" type="Rect2i" />
+ <argument index="2" name="use_layer" type="bool" />
+ <argument index="3" name="layer" type="int" />
+ <argument index="4" name="apply_lens_distortion" type="bool" />
+ <argument index="5" name="eye_center" type="Vector2" />
+ <argument index="6" name="k1" type="float" />
+ <argument index="7" name="k2" type="float" />
+ <argument index="8" name="upscale" type="float" />
+ <argument index="9" name="aspect_ratio" type="float" />
+ <description>
+ Blits our render results to screen optionally applying lens distortion. This can only be called while processing [code]_commit_views[/code].
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/XRServer.xml b/doc/classes/XRServer.xml
index 5dd9b75ad2..85170804cc 100644
--- a/doc/classes/XRServer.xml
+++ b/doc/classes/XRServer.xml
@@ -37,13 +37,6 @@
You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism.
</description>
</method>
- <method name="clear_primary_interface_if">
- <return type="void" />
- <argument index="0" name="interface" type="XRInterface" />
- <description>
- Clears our current primary interface if it is set to the provided interface.
- </description>
- </method>
<method name="find_interface" qualifiers="const">
<return type="XRInterface" />
<argument index="0" name="name" type="String" />
diff --git a/doc/classes/float.xml b/doc/classes/float.xml
index 60878eb0bd..4bf04fe25f 100644
--- a/doc/classes/float.xml
+++ b/doc/classes/float.xml
@@ -4,9 +4,13 @@
Float built-in type.
</brief_description>
<description>
- Float built-in type.
+ The [float] built-in type is a 64-bit double-precision floating-point number, equivalent to [code]double[/code] in C++. This type has 14 reliable decimal digits of precision. The [float] type can be stored in [Variant], which is the generic type used by the engine. The maximum value of [float] is approximately [code]1.79769e308[/code], and the minimum is approximately [code]-1.79769e308[/code].
+ Many methods and properties in the engine use 32-bit single-precision floating-point numbers instead, equivalent to [code]float[/code] in C++, which have 6 reliable decimal digits of precision. For data structures such as [Vector2] and [Vector3], Godot uses 32-bit floating-point numbers by default, but it can be changed to use 64-bit doubles if Godot is compiled with the [code]float=64[/code] option.
+ Math done using the [float] type is not guaranteed to be exact or deterministic, and will often result in small errors. You should usually use the [method @GlobalScope.is_equal_approx] and [method @GlobalScope.is_zero_approx] methods instead of [code]==[/code] to compare [float] values for equality.
</description>
<tutorials>
+ <link title="Wikipedia: Double-precision floating-point format">https://en.wikipedia.org/wiki/Double-precision_floating-point_format</link>
+ <link title="Wikipedia: Single-precision floating-point format">https://en.wikipedia.org/wiki/Single-precision_floating-point_format</link>
</tutorials>
<methods>
<method name="float" qualifiers="constructor">
@@ -231,11 +235,13 @@
<method name="operator unary+" qualifiers="operator">
<return type="float" />
<description>
+ Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable.
</description>
</method>
<method name="operator unary-" qualifiers="operator">
<return type="float" />
<description>
+ Returns the negative value of the [float]. If positive, turns the number negative. If negative, turns the number positive. With floats, the number zero can be either positive or negative.
</description>
</method>
</methods>
diff --git a/doc/classes/int.xml b/doc/classes/int.xml
index 84a01aa0d0..32b5fe1012 100644
--- a/doc/classes/int.xml
+++ b/doc/classes/int.xml
@@ -327,11 +327,13 @@
<method name="operator unary+" qualifiers="operator">
<return type="int" />
<description>
+ Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable.
</description>
</method>
<method name="operator unary-" qualifiers="operator">
<return type="int" />
<description>
+ Returns the negated value of the [int]. If positive, turns the number negative. If negative, turns the number positive. If zero, does nothing.
</description>
</method>
<method name="operator |" qualifiers="operator">