summaryrefslogtreecommitdiffstats
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/@GlobalScope.xml26
-rw-r--r--doc/classes/AABB.xml2
-rw-r--r--doc/classes/BaseButton.xml1
-rw-r--r--doc/classes/BaseMaterial3D.xml2
-rw-r--r--doc/classes/Button.xml5
-rw-r--r--doc/classes/ButtonGroup.xml2
-rw-r--r--doc/classes/CPUParticles3D.xml2
-rw-r--r--doc/classes/CanvasItem.xml7
-rw-r--r--doc/classes/CharacterBody2D.xml4
-rw-r--r--doc/classes/CheckBox.xml1
-rw-r--r--doc/classes/CollisionPolygon2D.xml12
-rw-r--r--doc/classes/CollisionPolygon3D.xml10
-rw-r--r--doc/classes/CollisionShape2D.xml2
-rw-r--r--doc/classes/CollisionShape3D.xml2
-rw-r--r--doc/classes/ConcavePolygonShape2D.xml11
-rw-r--r--doc/classes/ConcavePolygonShape3D.xml13
-rw-r--r--doc/classes/Control.xml19
-rw-r--r--doc/classes/ConvexPolygonShape2D.xml13
-rw-r--r--doc/classes/ConvexPolygonShape3D.xml8
-rw-r--r--doc/classes/DisplayServer.xml10
-rw-r--r--doc/classes/EditorVCSInterface.xml2
-rw-r--r--doc/classes/FontFile.xml8
-rw-r--r--doc/classes/MultiplayerPeerExtension.xml20
-rw-r--r--doc/classes/NavigationAgent2D.xml6
-rw-r--r--doc/classes/NavigationAgent3D.xml6
-rw-r--r--doc/classes/Node.xml18
-rw-r--r--doc/classes/NodePath.xml2
-rw-r--r--doc/classes/OS.xml2
-rw-r--r--doc/classes/PackedByteArray.xml6
-rw-r--r--doc/classes/PhysicsDirectSpaceState2D.xml2
-rw-r--r--doc/classes/PhysicsDirectSpaceState3D.xml2
-rw-r--r--doc/classes/PhysicsDirectSpaceState3DExtension.xml3
-rw-r--r--doc/classes/PhysicsServer3D.xml20
-rw-r--r--doc/classes/PhysicsServer3DExtension.xml3
-rw-r--r--doc/classes/PopupMenu.xml18
-rw-r--r--doc/classes/ProjectSettings.xml46
-rw-r--r--doc/classes/Quaternion.xml1
-rw-r--r--doc/classes/RenderingServer.xml2
-rw-r--r--doc/classes/RichTextLabel.xml1
-rw-r--r--doc/classes/SceneTree.xml4
-rw-r--r--doc/classes/Shape3D.xml2
-rw-r--r--doc/classes/SkeletonModification2DLookAt.xml2
-rw-r--r--doc/classes/String.xml6
-rw-r--r--doc/classes/StringName.xml6
-rw-r--r--doc/classes/TabBar.xml22
-rw-r--r--doc/classes/TabContainer.xml3
-rw-r--r--doc/classes/TextServer.xml13
-rw-r--r--doc/classes/TextServerExtension.xml8
-rw-r--r--doc/classes/TileSet.xml6
-rw-r--r--doc/classes/Transform2D.xml22
-rw-r--r--doc/classes/Transform3D.xml20
-rw-r--r--doc/classes/TranslationServer.xml2
-rw-r--r--doc/classes/Tree.xml3
-rw-r--r--doc/classes/TreeItem.xml4
-rw-r--r--doc/classes/Tween.xml6
-rw-r--r--doc/classes/Vector2.xml11
-rw-r--r--doc/classes/Vector2i.xml2
-rw-r--r--doc/classes/Vector3.xml7
-rw-r--r--doc/classes/Vector3i.xml2
-rw-r--r--doc/classes/Vector4.xml5
-rw-r--r--doc/classes/Vector4i.xml2
-rw-r--r--doc/classes/VehicleWheel3D.xml2
-rw-r--r--doc/classes/Window.xml2
-rw-r--r--doc/classes/XRInterface.xml7
-rw-r--r--doc/classes/XRInterfaceExtension.xml6
-rw-r--r--doc/classes/int.xml183
66 files changed, 441 insertions, 237 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index cdaf9bd1be..9575d2a5a1 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -622,7 +622,7 @@
<description>
Linearly interpolates between two values by the factor defined in [param weight]. To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method clampf] on the result of this function.
[codeblock]
- lerp(0, 4, 0.75) # Returns 3.0
+ lerpf(0, 4, 0.75) # Returns 3.0
[/codeblock]
See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep].
</description>
@@ -645,8 +645,8 @@
<return type="float" />
<param index="0" name="x" type="float" />
<description>
- Returns the natural logarithm of [param x]. This is the amount of time needed to reach a certain level of continuous growth.
- [b]Note:[/b] This is not the same as the "log" function on most calculators, which uses a base 10 logarithm.
+ Returns the [url=https://en.wikipedia.org/wiki/Natural_logarithm]natural logarithm[/url] of [param x] (base [url=https://en.wikipedia.org/wiki/E_(mathematical_constant)][i]e[/i][/url], with [i]e[/i] being approximately 2.71828). This is the amount of time needed to reach a certain level of continuous growth.
+ [b]Note:[/b] This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. To use base 10 logarithm, use [code]log(x) / log(10)[/code].
[codeblock]
log(10) # Returns 2.302585
[/codeblock]
@@ -1142,9 +1142,9 @@
<description>
Returns [code]-1.0[/code] if [param x] is negative, [code]1.0[/code] if [param x] is positive, and [code]0.0[/code] if [param x] is zero.
[codeblock]
- sign(-6.5) # Returns -1.0
- sign(0.0) # Returns 0.0
- sign(6.5) # Returns 1.0
+ signf(-6.5) # Returns -1.0
+ signf(0.0) # Returns 0.0
+ signf(6.5) # Returns 1.0
[/codeblock]
</description>
</method>
@@ -1154,9 +1154,9 @@
<description>
Returns [code]-1[/code] if [param x] is negative, [code]1[/code] if [param x] is positive, and [code]0[/code] if if [param x] is zero.
[codeblock]
- sign(-6) # Returns -1
- sign(0) # Returns 0
- sign(6) # Returns 1
+ signi(-6) # Returns -1
+ signi(0) # Returns 0
+ signi(6) # Returns 1
[/codeblock]
</description>
</method>
@@ -1226,8 +1226,8 @@
Returns the multiple of [param step] that is the closest to [param x]. This can also be used to round a floating point number to an arbitrary number of decimals.
A type-safe version of [method snapped], returning a [float].
[codeblock]
- snapped(32.0, 2.5) # Returns 32.5
- snapped(3.14159, 0.01) # Returns 3.14
+ snappedf(32.0, 2.5) # Returns 32.5
+ snappedf(3.14159, 0.01) # Returns 3.14
[/codeblock]
</description>
</method>
@@ -1239,8 +1239,8 @@
Returns the multiple of [param step] that is the closest to [param x].
A type-safe version of [method snapped], returning an [int].
[codeblock]
- snapped(53, 16) # Returns 48
- snapped(4096, 100) # Returns 4100
+ snappedi(53, 16) # Returns 48
+ snappedi(4096, 100) # Returns 4100
[/codeblock]
</description>
</method>
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index f85a055db5..34fe3cd1bb 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -237,7 +237,7 @@
<return type="bool" />
<param index="0" name="right" type="AABB" />
<description>
- Returns [code]true[/code] if the vectors are not equal.
+ Returns [code]true[/code] if the AABBs are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
</description>
</operator>
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml
index d7f559498d..a934e1544a 100644
--- a/doc/classes/BaseButton.xml
+++ b/doc/classes/BaseButton.xml
@@ -49,6 +49,7 @@
</member>
<member name="button_group" type="ButtonGroup" setter="set_button_group" getter="get_button_group">
The [ButtonGroup] associated with the button. Not to be confused with node groups.
+ [b]Note:[/b] The button will be configured as a radio button if a [ButtonGroup] is assigned to it.
</member>
<member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" enum="MouseButtonMask" default="1">
Binary mask to choose which mouse buttons this button will respond to.
diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml
index 6f361d6af9..989c76d5da 100644
--- a/doc/classes/BaseMaterial3D.xml
+++ b/doc/classes/BaseMaterial3D.xml
@@ -390,7 +390,7 @@
Repeat flags for the texture. See [enum TextureFilter] for options.
</member>
<member name="transparency" type="int" setter="set_transparency" getter="get_transparency" enum="BaseMaterial3D.Transparency" default="0">
- If [code]true[/code], transparency is enabled on the body. Some transparency modes will disable shadow casting. Any transparency mode other than Disabled has a greater performance impact compared to opaque rendering. See also [member blend_mode].
+ The material's transparency mode. Some transparency modes will disable shadow casting. Any transparency mode other than [constant TRANSPARENCY_DISABLED] has a greater performance impact compared to opaque rendering. See also [member blend_mode].
</member>
<member name="use_particle_trails" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], enables parts of the shader required for [GPUParticles3D] trails to function. This also requires using a mesh with appropriate skinning, such as [RibbonTrailMesh] or [TubeTrailMesh]. Enabling this feature outside of materials used in [GPUParticles3D] meshes will break material rendering.
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml
index 9fce014125..ec2447dbbc 100644
--- a/doc/classes/Button.xml
+++ b/doc/classes/Button.xml
@@ -48,7 +48,7 @@
When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text.
</member>
<member name="expand_icon" type="bool" setter="set_expand_icon" getter="is_expand_icon" default="false">
- When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect.
+ When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. See also [theme_item icon_max_width].
</member>
<member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false">
Flat buttons don't display decoration.
@@ -116,6 +116,9 @@
<theme_item name="h_separation" data_type="constant" type="int" default="2">
The horizontal space between [Button]'s icon and text. Negative values will be treated as [code]0[/code] when used.
</theme_item>
+ <theme_item name="icon_max_width" data_type="constant" type="int" default="0">
+ The maximum allowed width of the [Button]'s icon. This limit is applied on top of the default size of the icon, or its expanded size if [member expand_icon] is [code]true[/code]. The height is adjusted according to the icon's ratio.
+ </theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
[b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
diff --git a/doc/classes/ButtonGroup.xml b/doc/classes/ButtonGroup.xml
index 670296fd45..3e153ea1aa 100644
--- a/doc/classes/ButtonGroup.xml
+++ b/doc/classes/ButtonGroup.xml
@@ -4,7 +4,7 @@
Group of Buttons.
</brief_description>
<description>
- Group of [BaseButton]. The members of this group are treated like radio buttons in the sense that only one button can be pressed at the same time.
+ Group of [BaseButton]. The members of this group are treated like radio buttons in the sense that only one button can be pressed at the same time. Some types of buttons (such as [CheckBox]) may have a special appearance for this state.
Every member of the ButtonGroup should have [member BaseButton.toggle_mode] set to [code]true[/code].
</description>
<tutorials>
diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml
index 6c6239819e..f02b7578f8 100644
--- a/doc/classes/CPUParticles3D.xml
+++ b/doc/classes/CPUParticles3D.xml
@@ -294,7 +294,7 @@
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.
+ If set to [code]true[/code], 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.
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 11fe595daf..af1f2be76d 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -569,13 +569,14 @@
The rendering layers in which this [CanvasItem] responds to [Light2D] nodes.
</member>
<member name="material" type="Material" setter="set_material" getter="get_material">
- The material applied to textures on this [CanvasItem].
+ The material applied to this [CanvasItem].
</member>
<member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)">
- The color applied to textures on this [CanvasItem].
+ The color applied to this [CanvasItem]. This property does affect child [CanvasItem]s, unlike [member self_modulate] which only affects the node itself.
</member>
<member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate" default="Color(1, 1, 1, 1)">
- The color applied to textures on this [CanvasItem]. This is not inherited by children [CanvasItem]s.
+ The color applied to this [CanvasItem]. This property does [b]not[/b] affect child [CanvasItem]s, unlike [member modulate] which affects both the node itself and its children.
+ [b]Note:[/b] Internal children (e.g. sliders in [ColorPicker] or tab bar in [TabContainer]) are also not affected by this property (see [code]include_internal[/code] parameter of [method Node.get_child] and other similar methods).
</member>
<member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled" default="false">
If [code]true[/code], the object draws behind its parent.
diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml
index 40e777ca26..c3bca0a585 100644
--- a/doc/classes/CharacterBody2D.xml
+++ b/doc/classes/CharacterBody2D.xml
@@ -73,8 +73,8 @@
[codeblocks]
[gdscript]
for i in get_slide_collision_count():
- var collision = get_slide_collision(i)
- print("Collided with: ", collision.collider.name)
+ var collision = get_slide_collision(i)
+ print("Collided with: ", collision.get_collider().name)
[/gdscript]
[csharp]
for (int i = 0; i &lt; GetSlideCollisionCount(); i++)
diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml
index 9d98a1c1ed..699073f9d3 100644
--- a/doc/classes/CheckBox.xml
+++ b/doc/classes/CheckBox.xml
@@ -6,6 +6,7 @@
<description>
A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to [CheckButton] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has [b]no[/b] immediate effect on something. For example, it could be used when toggling it will only do something once a confirmation button is pressed.
See also [BaseButton] which contains common properties and methods associated with this node.
+ [b]Note:[/b] CheckBox changes its appearance when it's configured as a radio button. See various [code]radio_*[/code] theme properties. To configure CheckBox to act as a radio button, use [member BaseButton.button_group] and [ButtonGroup].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml
index f6f92ec2ae..68c370820e 100644
--- a/doc/classes/CollisionPolygon2D.xml
+++ b/doc/classes/CollisionPolygon2D.xml
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CollisionPolygon2D" inherits="Node2D" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Defines a 2D collision polygon.
+ Node that represents a 2D collision polygon.
</brief_description>
<description>
- Provides a concave or convex 2D collision polygon to a [CollisionObject2D] parent. Polygons can be drawn in the editor or specified by a list of vertices. See also [ConvexPolygonShape2D].
+ Provides a 2D collision polygon to a [CollisionObject2D] parent. Polygons can be drawn in the editor or specified by a list of vertices.
+ Depending on the build mode, this node effectively provides several convex shapes (by convex decomposition of the polygon) or a single concave shape made of the polygon's segments.
In the editor, a [CollisionPolygon2D] can be generated from a [Sprite2D]'s outline by selecting a [Sprite2D] node, going to the [b]Sprite2D[/b] menu at the top of the 2D editor viewport then choosing [b]Create CollisionPolygon2D Sibling[/b].
</description>
<tutorials>
@@ -24,15 +25,16 @@
The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity.
</member>
<member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()">
- The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the [PackedVector2Array], not a reference.
+ The polygon's list of vertices. Each point will be connected to the next, and the final point will be connected to the first.
+ [b]Warning:[/b] The returned value is a clone of the [PackedVector2Array], not a reference.
</member>
</members>
<constants>
<constant name="BUILD_SOLIDS" value="0" enum="BuildMode">
- Collisions will include the polygon and its contained area.
+ Collisions will include the polygon and its contained area. In this mode the node has the same effect as several [ConvexPolygonShape2D] nodes, one for each convex shape in the convex decomposition of the polygon (but without the overhead of multiple nodes).
</constant>
<constant name="BUILD_SEGMENTS" value="1" enum="BuildMode">
- Collisions will only include the polygon edges.
+ Collisions will only include the polygon edges. In this mode the node has the same effect as a single [ConcavePolygonShape2D] made of segments, with the restriction that each segment (after the first one) starts where the previous one ends, and the last one ends where the first one starts (forming a closed but hollow polygon).
</constant>
</constants>
</class>
diff --git a/doc/classes/CollisionPolygon3D.xml b/doc/classes/CollisionPolygon3D.xml
index 2540972dab..b6bf0ce141 100644
--- a/doc/classes/CollisionPolygon3D.xml
+++ b/doc/classes/CollisionPolygon3D.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CollisionPolygon3D" inherits="Node3D" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Editor-only node for defining a collision polygon in 3D space.
+ Node that represents a 3D collision polygon, given by the thickening of a 2D polygon in the local XY plane along the local Z axis.
</brief_description>
<description>
- Allows editing a concave or convex collision polygon's vertices on a selected plane. Can also set a depth perpendicular to that plane. This class is only available in the editor. It will not appear in the scene tree at run-time. Creates several [ConvexPolygonShape3D]s at run-time to represent the original polygon using convex decomposition.
- [b]Note:[/b] Since this is an editor-only helper, properties modified during gameplay will have no effect.
+ Provides a 3D collision polygon to a [CollisionObject3D] parent, by thickening a 2D (convex or concave) polygon in the local XY plane along the local Z axis. The 2D polygon in the local XY plane can be drawn in the editor or specified by a list of vertices. That 2D polygon is thickened evenly in the local Z and -Z directions.
+ This node has the same effect as several [ConvexPolygonShape3D] nodes, created by thickening the 2D convex polygons in the convex decomposition of the given 2D polygon (but without the overhead of multiple nodes).
[b]Warning:[/b] A non-uniformly scaled CollisionPolygon3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change its [member polygon]'s vertices instead.
</description>
<tutorials>
</tutorials>
<members>
<member name="depth" type="float" setter="set_depth" getter="get_depth" default="1.0">
- Length that the resulting collision extends in either direction perpendicular to its polygon.
+ Length that the resulting collision extends in either direction perpendicular to its 2D polygon.
</member>
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false">
If [code]true[/code], no collision will be produced.
@@ -21,7 +21,7 @@
The collision margin for the generated [Shape3D]. See [member Shape3D.margin] for more details.
</member>
<member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()">
- Array of vertices which define the polygon.
+ Array of vertices which define the 2D polygon in the local XY plane.
[b]Note:[/b] The returned value is a copy of the original. Methods which mutate the size or properties of the return value will not impact the original polygon. To change properties of the polygon, assign it to a temporary variable and make changes before reassigning the [code]polygon[/code] member.
</member>
</members>
diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml
index f139455e5f..895d87929d 100644
--- a/doc/classes/CollisionShape2D.xml
+++ b/doc/classes/CollisionShape2D.xml
@@ -4,7 +4,7 @@
Node that represents collision shape data in 2D space.
</brief_description>
<description>
- Editor facility for creating and editing collision shapes in 2D space. Set the [member shape] property to configure the shape. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject2D.shape_owner_get_shape] to get the actual shape.
+ Editor facility for creating and editing collision shapes in 2D space. Set the [member shape] property to configure the shape.
You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D] to give it a detection shape, or add it to a [PhysicsBody2D] to create a solid object.
</description>
<tutorials>
diff --git a/doc/classes/CollisionShape3D.xml b/doc/classes/CollisionShape3D.xml
index 4793debefd..f79f9a8803 100644
--- a/doc/classes/CollisionShape3D.xml
+++ b/doc/classes/CollisionShape3D.xml
@@ -4,7 +4,7 @@
Node that represents collision shape data in 3D space.
</brief_description>
<description>
- Editor facility for creating and editing collision shapes in 3D space. Set the [member shape] property to configure the shape. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject3D.shape_owner_get_shape] to get the actual shape.
+ Editor facility for creating and editing collision shapes in 3D space. Set the [member shape] property to configure the shape.
You can use this node to represent all sorts of collision shapes, for example, add this to an [Area3D] to give it a detection shape, or add it to a [PhysicsBody3D] to create a solid object.
[b]Warning:[/b] A non-uniformly scaled CollisionShape3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size of its [member shape] resource instead.
</description>
diff --git a/doc/classes/ConcavePolygonShape2D.xml b/doc/classes/ConcavePolygonShape2D.xml
index 01bc508f43..591b73a8c7 100644
--- a/doc/classes/ConcavePolygonShape2D.xml
+++ b/doc/classes/ConcavePolygonShape2D.xml
@@ -4,16 +4,19 @@
Concave polygon shape resource for 2D physics.
</brief_description>
<description>
- 2D concave polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for [RigidBody2D] nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions.
- The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex to speed up collision detection.
- [b]Performance:[/b] Due to its complexity, [ConcavePolygonShape2D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape2D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape2D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape2D]'s documentation for instructions. However, consider using primitive collision shapes such as [CircleShape2D] or [RectangleShape2D] first.
+ 2D concave polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node.
+ The shape consists of a collection of line segments, and as such it does not include any "inside" that the segments might be enclosing. If the segments do enclose anything, then the shape is [i]hollow[/i], as opposed to a [ConvexPolygonShape2D] which is solid. See also [CollisionPolygon2D].
+ Being made out of line segments, this shape is the most freely configurable single 2D shape. It can be used to form (hollow) polygons of any nature, convex or concave.
+ [b]Note:[/b] When used for collision, [b]ConcavePolygonShape2D[/b] is intended to work with static [PhysicsBody2D] nodes like [StaticBody2D] and is not recommended to use with [RigidBody2D] nodes in a mode other than Static. A [CollisionPolygon2D] in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better suited for static bodies.
+ [b]Warning:[/b] The nature of this shape makes it extra prone to being tunneled through by (small) fast physics bodies. For example, consider a (small) rigid body [i]Ball[/i] traveling toward a static body [i]Box[/i] at high speed. If the box uses a [b]ConcavePolygonShape2D[/b] consisting of four segments, then the ball might end up inside the box or tunnel all the way through the box, if it goes fast enough. This is (partly) because the ball can only collide against the individual segments of the hollow box. In interactions with rigid bodies tunneling can be avoided by enabling continuous collision detection on the rigid body.
[b]Warning:[/b] Using this shape for an [Area2D] (via a [CollisionShape2D] node) may give unexpected results: the area will only detect collisions with the segments in the [ConcavePolygonShape2D] (and not with any "inside" of the shape, for example).
+ [b]Performance:[/b] Due to its complexity, [ConcavePolygonShape2D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape2D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape2D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape2D]'s documentation for instructions. However, consider using primitive collision shapes such as [CircleShape2D] or [RectangleShape2D] first.
</description>
<tutorials>
</tutorials>
<members>
<member name="segments" type="PackedVector2Array" setter="set_segments" getter="get_segments" default="PackedVector2Array()">
- The array of points that make up the [ConcavePolygonShape2D]'s line segments.
+ The array of points that make up the [ConcavePolygonShape2D]'s line segments. The array (of length divisible by two) is naturally divided into pairs (one pair for each segment); each pair consists of the starting point of a segment and the endpoint of a segment.
</member>
</members>
</class>
diff --git a/doc/classes/ConcavePolygonShape3D.xml b/doc/classes/ConcavePolygonShape3D.xml
index 4e7f10bc3e..8141be7972 100644
--- a/doc/classes/ConcavePolygonShape3D.xml
+++ b/doc/classes/ConcavePolygonShape3D.xml
@@ -4,10 +4,13 @@
Concave polygon shape resource (also called "trimesh") for 3D physics.
</brief_description>
<description>
- 3D concave polygon shape resource (also called "trimesh") to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. This shape is created by feeding a list of triangles. Despite its name, [ConcavePolygonShape3D] can also store convex polygon shapes. However, unlike [ConvexPolygonShape3D], [ConcavePolygonShape3D] is [i]not[/i] limited to storing convex shapes exclusively.
- [b]Note:[/b] When used for collision, [ConcavePolygonShape3D] is intended to work with static [PhysicsBody3D] nodes like [StaticBody3D] and will not work with [CharacterBody3D] or [RigidBody3D] with a mode other than Static.
- [b]Performance:[/b] Due to its complexity, [ConcavePolygonShape3D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape3D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape3D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape3D]'s documentation for instructions. However, consider using primitive collision shapes such as [SphereShape3D] or [BoxShape3D] first.
+ 3D concave polygon shape resource (also called "trimesh") to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node.
+ The shape consists of a collection of triangle faces, and as such it does not include any "inside" that the faces might be enclosing. If the faces enclose anything, then the shape is [i]hollow[/i], as opposed to a [ConvexPolygonShape3D] which is solid. See also [CollisionPolygon3D].
+ Being made out of triangle faces, this shape is the most freely configurable single 3D shape. Despite its name, it can be used to form (hollow) polyhedra of any nature, convex or concave.
+ [b]Note:[/b] When used for collision, [b]ConcavePolygonShape3D[/b] is intended to work with static [PhysicsBody3D] nodes like [StaticBody3D] and will not work with [CharacterBody3D] or [RigidBody3D] in a mode other than Static.
+ [b]Warning:[/b] The nature of this shape makes it extra prone to being tunneled through by (small) fast physics bodies. For example, consider a (small) rigid body [i]Ball[/i] traveling toward a static body [i]Box[/i] at high speed. If the box uses a [b]ConcavePolygonShape3D[/b] consisting of twelve triangle faces (two triangle faces for each of the six sides of the box), then the ball might end up inside the box or tunnel all the way through the box, if it goes fast enough. This is (partly) because the ball can only collide against the individual faces of the hollow box. In interactions with rigid bodies tunneling can be avoided by enabling continuous collision detection on the rigid body.
[b]Warning:[/b] Using this shape for an [Area3D] (via a [CollisionShape3D] node, created e.g. by using the [i]Create Trimesh Collision Sibling[/i] option in the [i]Mesh[/i] menu that appears when selecting a [MeshInstance3D] node) may give unexpected results: the area will only detect collisions with the triangle faces in the [ConcavePolygonShape3D] (and not with any "inside" of the shape, for example); moreover it will only detect all such collisions if [member backface_collision] is [code]true[/code].
+ [b]Performance:[/b] Due to its complexity, [ConcavePolygonShape3D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape3D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape3D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape3D]'s documentation for instructions. However, consider using primitive collision shapes such as [SphereShape3D] or [BoxShape3D] first.
</description>
<tutorials>
<link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
@@ -16,14 +19,14 @@
<method name="get_faces" qualifiers="const">
<return type="PackedVector3Array" />
<description>
- Returns the faces (an array of triangles).
+ Returns the faces of the trimesh shape as an array of vertices. The array (of length divisible by three) is naturally divided into triples; each triple of vertices defines a triangle.
</description>
</method>
<method name="set_faces">
<return type="void" />
<param index="0" name="faces" type="PackedVector3Array" />
<description>
- Sets the faces (an array of triangles).
+ Sets the faces of the trimesh shape from an array of vertices. The [param faces] array should be composed of triples such that each triple of vertices defines a triangle.
</description>
</method>
</methods>
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index c9a59dfd60..b26c4029be 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -107,6 +107,14 @@
[b]Note:[/b] This method will not be called when the script is attached to a [Control] node that already overrides its minimum size (e.g. [Label], [Button], [PanelContainer] etc.). It can only be used with most basic GUI nodes, like [Control], [Container], [Panel] etc.
</description>
</method>
+ <method name="_get_tooltip" qualifiers="virtual const">
+ <return type="String" />
+ <param index="0" name="at_position" type="Vector2" />
+ <description>
+ Virtual method to be implemented by the user. Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. See [method get_tooltip].
+ [b]Note:[/b] If this method returns an empty [String], no tooltip is displayed.
+ </description>
+ </method>
<method name="_gui_input" qualifiers="virtual">
<return type="void" />
<param index="0" name="event" type="InputEvent" />
@@ -399,7 +407,7 @@
<return type="float" />
<param index="0" name="offset" type="int" enum="Side" />
<description>
- Returns the anchor for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
+ Returns the offset for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
</description>
</method>
<method name="get_parent_area_size" qualifiers="const">
@@ -532,8 +540,9 @@
<return type="String" />
<param index="0" name="at_position" type="Vector2" default="Vector2(0, 0)" />
<description>
- Returns the tooltip text [param at_position] in local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns [member tooltip_text].
- [b]Note:[/b] This method can be overridden to customize its behavior. If this method returns an empty [String], no tooltip is displayed.
+ Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns [member tooltip_text].
+ This method can be overridden to customize its behavior. See [method _get_tooltip].
+ [b]Note:[/b] If this method returns an empty [String], no tooltip is displayed.
</description>
</method>
<method name="grab_click_focus">
@@ -840,7 +849,7 @@
<param index="0" name="side" type="int" enum="Side" />
<param index="1" name="neighbor" type="NodePath" />
<description>
- Sets the anchor for the specified [enum Side] to the [Control] at [param neighbor] node path. A setter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
+ Sets the focus neighbor for the specified [enum Side] to the [Control] at [param neighbor] node path. A setter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
</description>
</method>
<method name="set_global_position">
@@ -918,7 +927,7 @@
Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience.
</member>
<member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" default="true">
- Toggles if any text should automatically change to its translated version depending on the current locale. Note that this will not affect any internal nodes (e.g. the popup of a [MenuButton]).
+ Toggles if any text should automatically change to its translated version depending on the current locale.
Also decides if the node's strings should be parsed for POT generation.
</member>
<member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" default="false">
diff --git a/doc/classes/ConvexPolygonShape2D.xml b/doc/classes/ConvexPolygonShape2D.xml
index b9bc940929..886a62eafa 100644
--- a/doc/classes/ConvexPolygonShape2D.xml
+++ b/doc/classes/ConvexPolygonShape2D.xml
@@ -4,9 +4,11 @@
Convex polygon shape resource for 2D physics.
</brief_description>
<description>
- 2D convex polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. A convex polygon, whatever its shape, is internally decomposed into as many convex polygons as needed to ensure all collision checks against it are always done on convex polygons (which are faster to check). See also [CollisionPolygon2D].
- The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex to speed up collision detection.
- [b]Performance:[/b] [ConvexPolygonShape2D] is faster to check collisions against compared to [ConcavePolygonShape2D], but it is slower than primitive collision shapes such as [CircleShape2D] or [RectangleShape2D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by a primitive shape.
+ 2D convex polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node.
+ The shape is a [i]solid[/i] that includes all the points that it encloses, as opposed to [ConcavePolygonShape2D] which is hollow if it encloses anything. See also [CollisionPolygon2D].
+ The solid nature of the shape makes it well-suited for both detection and physics; in physics body interactions this allows depenetrating even those shapes which end up (e.g. due to high speed) fully inside the convex shape (similarly to primitive shapes, but unlike [ConcavePolygonShape2D]). The convexity limits the possible geometric shape of a single [ConvexPolygonShape2D]: it cannot be concave.
+ [b]Convex decomposition:[/b] Concave objects' collisions can be represented accurately using [i]several[/i] convex shapes. This allows dynamic physics bodies to have complex concave collisions (at a performance cost). It can be achieved using several [ConvexPolygonShape2D] nodes or by using the [CollisionPolygon2D] node in Solids build mode. To generate a collision polygon from a sprite, select the [Sprite2D] node, go to the [b]Sprite2D[/b] menu that appears above the viewport, and choose [b]Create Polygon2D Sibling[/b].
+ [b]Performance:[/b] [ConvexPolygonShape2D] is faster to check collisions against compared to [ConcavePolygonShape2D], but it is slower than primitive collision shapes such as [CircleShape2D] or [RectangleShape2D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes.
</description>
<tutorials>
</tutorials>
@@ -15,13 +17,14 @@
<return type="void" />
<param index="0" name="point_cloud" type="PackedVector2Array" />
<description>
- Based on the set of points provided, this creates and assigns the [member points] property using the convex hull algorithm. Removing all unneeded points. See [method Geometry2D.convex_hull] for details.
+ Based on the set of points provided, this assigns the [member points] property using the convex hull algorithm, removing all unneeded points. See [method Geometry2D.convex_hull] for details.
</description>
</method>
</methods>
<members>
<member name="points" type="PackedVector2Array" setter="set_points" getter="get_points" default="PackedVector2Array()">
- The polygon's list of vertices. Can be in either clockwise or counterclockwise order. Only set this property with convex hull points, use [method set_point_cloud] to generate a convex hull shape from concave shape points.
+ The polygon's list of vertices that form a convex hull. Can be in either clockwise or counterclockwise order.
+ [b]Warning:[/b] Only set this property to a list of points that actually form a convex hull. Use [method set_point_cloud] to generate the convex hull of an arbitrary set of points.
</member>
</members>
</class>
diff --git a/doc/classes/ConvexPolygonShape3D.xml b/doc/classes/ConvexPolygonShape3D.xml
index af365c90b4..69c45f9504 100644
--- a/doc/classes/ConvexPolygonShape3D.xml
+++ b/doc/classes/ConvexPolygonShape3D.xml
@@ -4,9 +4,11 @@
Convex polygon shape resource for 3D physics.
</brief_description>
<description>
- 3D convex polygon shape resource to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. Unlike [ConcavePolygonShape3D], [ConvexPolygonShape3D] cannot store concave polygon shapes. [ConvexPolygonShape3D]s can be manually drawn in the editor using the [CollisionPolygon3D] node.
- [b]Convex decomposition:[/b] Concave objects' collisions can be represented accurately using [i]several[/i] [ConvexPolygonShape3D]s. This allows dynamic physics bodies to have complex concave collisions (at a performance cost). This is available in the editor by selecting the [MeshInstance3D], going to the [b]Mesh[/b] menu and choosing [b]Create Multiple Convex Collision Siblings[/b]. Alternatively, [method MeshInstance3D.create_multiple_convex_collisions] can be called in a script to perform this decomposition at run-time.
- [b]Performance:[/b] [ConvexPolygonShape3D] is faster to check collisions against compared to [ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [SphereShape3D] or [BoxShape3D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by a primitive shape.
+ 3D convex polygon shape resource to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node.
+ The shape is a [i]solid[/i] that includes all the points that it encloses, as opposed to [ConcavePolygonShape3D] which is hollow if it encloses anything. See also [CollisionPolygon3D].
+ The solid nature of the shape makes it well-suited for both detection and physics; in physics body interactions this allows depenetrating even those shapes which end up (e.g. due to high speed) fully inside the convex shape (similarly to primitive shapes, but unlike [ConcavePolygonShape3D] and [HeightMapShape3D]). The convexity restricts the possible geometric shape of a single [ConvexPolygonShape3D]: it cannot be concave.
+ [b]Convex decomposition:[/b] Concave objects' collisions can be represented accurately using [i]several[/i] convex shapes. This allows dynamic physics bodies to have complex concave collisions (at a performance cost). It can be achieved by using several [ConvexPolygonShape3D] nodes or by using the [CollisionPolygon3D] node. To generate a collision polygon from a mesh, select the [MeshInstance3D] node, go to the [b]Mesh[/b] menu that appears above the viewport and choose [b]Create Multiple Convex Collision Siblings[/b]. Alternatively, [method MeshInstance3D.create_multiple_convex_collisions] can be called in a script to perform this decomposition at run-time.
+ [b]Performance:[/b] [ConvexPolygonShape3D] is faster to check collisions against compared to [ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [SphereShape3D] or [BoxShape3D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes.
</description>
<tutorials>
<link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 8bf038c134..d0da097476 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -952,7 +952,7 @@
<return type="void" />
<param index="0" name="image" type="Image" />
<description>
- Sets the window icon (usually displayed in the top-left corner) in the operating system's [i]native[/i] format. To use icons in the operating system's native format, use [method set_native_icon] instead.
+ Sets the window icon (usually displayed in the top-left corner) with an [Image]. To use icons in the operating system's native format, use [method set_native_icon] instead.
</description>
</method>
<method name="set_native_icon">
@@ -1000,7 +1000,7 @@
- [code]name[/code] is voice name.
- [code]id[/code] is voice identifier.
- [code]language[/code] is language code in [code]lang_Variant[/code] format. [code]lang[/code] part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. And [code]Variant[/code] part is an engine dependent string describing country, region or/and dialect.
- Note that Godot depends on system libraries for text-to-speech functionality. These libraries are installed by default on Windows and MacOS, but not on all Linux distributions. If they are not present, this method will return an empty list. This applies to both Godot users on Linux, as well as end-users on Linux running Godot games that use text-to-speech.
+ Note that Godot depends on system libraries for text-to-speech functionality. These libraries are installed by default on Windows and macOS, but not on all Linux distributions. If they are not present, this method will return an empty list. This applies to both Godot users on Linux, as well as end-users on Linux running Godot games that use text-to-speech.
[b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
</description>
</method>
@@ -1046,8 +1046,8 @@
<param index="1" name="callable" type="Callable" />
<description>
Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
- - [constant TTS_UTTERANCE_STARTED], [constant TTS_UTTERANCE_ENDED], and [constant TTS_UTTERANCE_CANCELED] callable's method should take one [int] parameter, the utterance id.
- - [constant TTS_UTTERANCE_BOUNDARY] callable's method should take two [int] parameters, the index of the character and the utterance id.
+ - [constant TTS_UTTERANCE_STARTED], [constant TTS_UTTERANCE_ENDED], and [constant TTS_UTTERANCE_CANCELED] callable's method should take one [int] parameter, the utterance ID.
+ - [constant TTS_UTTERANCE_BOUNDARY] callable's method should take two [int] parameters, the index of the character and the utterance ID.
[b]Note:[/b] The granularity of the boundary callbacks is engine dependent.
[b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
</description>
@@ -1800,7 +1800,7 @@
OpenGL context (only with the GL Compatibility renderer):
- Windows: [code]HGLRC[/code] for the window.
- Linux: [code]GLXContext*[/code] for the window.
- - MacOS: [code]NSOpenGLContext*[/code] for the window.
+ - macOS: [code]NSOpenGLContext*[/code] for the window.
- Android: [code]EGLContext[/code] for the window.
</constant>
<constant name="TTS_UTTERANCE_STARTED" value="0" enum="TTSUtteranceEvent">
diff --git a/doc/classes/EditorVCSInterface.xml b/doc/classes/EditorVCSInterface.xml
index 07ab02cbf7..d5dc6abe81 100644
--- a/doc/classes/EditorVCSInterface.xml
+++ b/doc/classes/EditorVCSInterface.xml
@@ -124,7 +124,7 @@
<param index="0" name="remote" type="String" />
<param index="1" name="force" type="bool" />
<description>
- Pushes changes to the [code]remote[/code]. Optionally, if [code]force[/code] is set to true, a force push will override the change history already present on the remote.
+ Pushes changes to the [param remote]. If [param force] is [code]true[/code], a force push will override the change history already present on the remote.
</description>
</method>
<method name="_remove_branch" qualifiers="virtual">
diff --git a/doc/classes/FontFile.xml b/doc/classes/FontFile.xml
index 776603e85e..ed9906186c 100644
--- a/doc/classes/FontFile.xml
+++ b/doc/classes/FontFile.xml
@@ -115,6 +115,14 @@
Returns thickness of the underline in pixels.
</description>
</method>
+ <method name="get_char_from_glyph_index" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="size" type="int" />
+ <param index="1" name="glyph_index" type="int" />
+ <description>
+ Returns character code associated with [param glyph_index], or [code]0[/code] if [param glyph_index] is invalid. See [method get_glyph_index].
+ </description>
+ </method>
<method name="get_embolden" qualifiers="const">
<return type="float" />
<param index="0" name="cache_index" type="int" />
diff --git a/doc/classes/MultiplayerPeerExtension.xml b/doc/classes/MultiplayerPeerExtension.xml
index efd26496ea..7c712a2d1e 100644
--- a/doc/classes/MultiplayerPeerExtension.xml
+++ b/doc/classes/MultiplayerPeerExtension.xml
@@ -49,6 +49,18 @@
Called when a packet needs to be received by the [MultiplayerAPI], with [param r_buffer_size] being the size of the binary [param r_buffer] in bytes.
</description>
</method>
+ <method name="_get_packet_channel" qualifiers="virtual const">
+ <return type="int" />
+ <description>
+ Called to get the channel over which the next available packet was received. See [method MultiplayerPeer.get_packet_channel].
+ </description>
+ </method>
+ <method name="_get_packet_mode" qualifiers="virtual const">
+ <return type="int" enum="MultiplayerPeer.TransferMode" />
+ <description>
+ Called to get the [enum MultiplayerPeer.TransferMode] the remote peer used to send the next available packet. See [method MultiplayerPeer.get_packet_mode].
+ </description>
+ </method>
<method name="_get_packet_peer" qualifiers="virtual const">
<return type="int" />
<description>
@@ -76,7 +88,7 @@
<method name="_get_unique_id" qualifiers="virtual const">
<return type="int" />
<description>
- Called when the unique ID of this [MultiplayerPeer] is requested (see [method MultiplayerPeer.get_unique_id]).
+ Called when the unique ID of this [MultiplayerPeer] is requested (see [method MultiplayerPeer.get_unique_id]). The value must be between [code]1[/code] and [code]2147483647[/code].
</description>
</method>
<method name="_is_refusing_new_connections" qualifiers="virtual const">
@@ -91,6 +103,12 @@
Called when the "is server" status is requested on the [MultiplayerAPI]. See [method MultiplayerAPI.is_server].
</description>
</method>
+ <method name="_is_server_relay_supported" qualifiers="virtual const">
+ <return type="bool" />
+ <description>
+ Called to check if the server can act as a relay in the current configuration. See [method MultiplayerPeer.is_server_relay_supported].
+ </description>
+ </method>
<method name="_poll" qualifiers="virtual">
<return type="void" />
<description>
diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml
index 944b803866..83e2767b6e 100644
--- a/doc/classes/NavigationAgent2D.xml
+++ b/doc/classes/NavigationAgent2D.xml
@@ -109,7 +109,7 @@
</methods>
<members>
<member name="avoidance_enabled" type="bool" setter="set_avoidance_enabled" getter="get_avoidance_enabled" default="false">
- If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer2D]. When [method NavigationAgent2D.set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector2 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
+ If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer2D]. When [method set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector2 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
</member>
<member name="debug_enabled" type="bool" setter="set_debug_enabled" getter="get_debug_enabled" default="false">
If [code]true[/code] shows debug visuals for this agent.
@@ -117,7 +117,7 @@
<member name="debug_path_custom_color" type="Color" setter="set_debug_path_custom_color" getter="get_debug_path_custom_color" default="Color(1, 1, 1, 1)">
If [member debug_use_custom] is [code]true[/code] uses this color for this agent instead of global color.
</member>
- <member name="debug_path_custom_line_width" type="float" setter="set_debug_path_custom_line_width" getter="get_debug_path_custom_line_width" default="1.0">
+ <member name="debug_path_custom_line_width" type="float" setter="set_debug_path_custom_line_width" getter="get_debug_path_custom_line_width" default="-1.0">
If [member debug_use_custom] is [code]true[/code] uses this line width for rendering paths for this agent instead of global line width.
</member>
<member name="debug_path_custom_point_size" type="float" setter="set_debug_path_custom_point_size" getter="get_debug_path_custom_point_size" default="4.0">
@@ -193,7 +193,7 @@
<signal name="velocity_computed">
<param index="0" name="safe_velocity" type="Vector2" />
<description>
- Notifies when the collision avoidance velocity is calculated. Emitted by [method set_velocity]. Only emitted when [member avoidance_enabled] is true.
+ Notifies when the collision avoidance velocity is calculated. Emitted at the end of the physics frame in which [method set_velocity] is called. Only emitted when [member avoidance_enabled] is true.
</description>
</signal>
<signal name="waypoint_reached">
diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml
index 7d0ca1c160..8630801f3e 100644
--- a/doc/classes/NavigationAgent3D.xml
+++ b/doc/classes/NavigationAgent3D.xml
@@ -112,7 +112,7 @@
The NavigationAgent height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents.
</member>
<member name="avoidance_enabled" type="bool" setter="set_avoidance_enabled" getter="get_avoidance_enabled" default="false">
- If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer3D]. When [method NavigationAgent3D.set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector3 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
+ If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer3D]. When [method set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector3 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
</member>
<member name="debug_enabled" type="bool" setter="set_debug_enabled" getter="get_debug_enabled" default="false">
If [code]true[/code] shows debug visuals for this agent.
@@ -136,7 +136,7 @@
The maximum speed that an agent can move.
</member>
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
- A bitfield determining what navigation layers of navigation regions this NavigationAgent will use to calculate path. Changing it runtime will clear current navigation path and generate new one, according to new navigation layers.
+ A bitfield determining what navigation layers of navigation regions this agent will use to calculate path. Changing it runtime will clear current navigation path and generate new one, according to new navigation layers.
</member>
<member name="neighbor_distance" type="float" setter="set_neighbor_distance" getter="get_neighbor_distance" default="50.0">
The distance to search for other agents.
@@ -196,7 +196,7 @@
<signal name="velocity_computed">
<param index="0" name="safe_velocity" type="Vector3" />
<description>
- Notifies when the collision avoidance velocity is calculated. Emitted by [method set_velocity]. Only emitted when [member avoidance_enabled] is true.
+ Notifies when the collision avoidance velocity is calculated. Emitted at the end of the physics frame in which [method set_velocity] is called. Only emitted when [member avoidance_enabled] is true.
</description>
</signal>
<signal name="waypoint_reached">
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 3146b9d3af..5817c45f41 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -42,6 +42,18 @@
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.
Call [method update_configuration_warnings] when the warnings need to be updated for this node.
+ [codeblock]
+ @export var energy = 0:
+ set(value):
+ energy = value
+ update_configuration_warnings()
+
+ func _get_configuration_warnings():
+ if energy &lt; 0:
+ return ["Energy must be 0 or greater."]
+ else:
+ return []
+ [/codeblock]
</description>
</method>
<method name="_input" qualifiers="virtual">
@@ -127,7 +139,7 @@
<description>
Adds a child [param 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 [param force_readable_name] is [code]true[/code], improves the readability of the added [param node]. If not named, the [param node] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to [code]false[/code], which assigns a dummy name featuring [code]@[/code] in both situations.
- If [param internal] 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.
+ If [param internal] 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]
@@ -206,7 +218,7 @@
<param index="1" name="recursive" type="bool" default="true" />
<param index="2" name="owned" type="bool" default="true" />
<description>
- Finds the first descendant of this node whose name matches [param pattern] as in [method String.match].
+ Finds the first descendant of this node whose name matches [param pattern] as in [method String.match]. Internal children are also searched over (see [code]internal[/code] parameter in [method add_child]).
[param pattern] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]).
If [param recursive] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [param recursive] is [code]false[/code], only this node's direct children are matched.
If [param owned] is [code]true[/code], this method only finds nodes who have an assigned [member Node.owner]. This is especially important for scenes instantiated through a script, because those scenes don't have an owner.
@@ -222,7 +234,7 @@
<param index="2" name="recursive" type="bool" default="true" />
<param index="3" name="owned" type="bool" default="true" />
<description>
- Finds descendants of this node whose name matches [param pattern] as in [method String.match], and/or type matches [param type] as in [method Object.is_class].
+ Finds descendants of this node whose name matches [param pattern] as in [method String.match], and/or type matches [param type] as in [method Object.is_class]. Internal children are also searched over (see [code]internal[/code] parameter in [method add_child]).
[param pattern] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]).
[param type] will check equality or inheritance, and is case-sensitive. [code]"Object"[/code] will match a node whose type is [code]"Node"[/code] but not the other way around.
If [param recursive] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [param recursive] is [code]false[/code], only this node's direct children are matched.
diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml
index 5881d5de34..ee34a0c405 100644
--- a/doc/classes/NodePath.xml
+++ b/doc/classes/NodePath.xml
@@ -141,7 +141,7 @@
<return type="StringName" />
<param index="0" name="idx" type="int" />
<description>
- Gets the resource or property name indicated by [param idx] (0 to [method get_subname_count]).
+ Gets the resource or property name indicated by [param idx] (0 to [method get_subname_count] - 1).
[codeblocks]
[gdscript]
var node_path = NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path")
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 1dce0b1632..1b98d357ae 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -4,7 +4,7 @@
Operating System functions.
</brief_description>
<description>
- Operating System functions. [OS] wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, delays, environment variables, execution of binaries, command line, etc.
+ Operating System functions. [OS] wraps the most common functionality to communicate with the host operating system, such as the video driver, delays, environment variables, execution of binaries, command line, etc.
[b]Note:[/b] In Godot 4, [OS] functions related to window management were moved to the [DisplayServer] singleton.
</description>
<tutorials>
diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml
index 081215f6b7..a3f23fa7ae 100644
--- a/doc/classes/PackedByteArray.xml
+++ b/doc/classes/PackedByteArray.xml
@@ -328,6 +328,12 @@
Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string.
</description>
</method>
+ <method name="get_string_from_wchar" qualifiers="const">
+ <return type="String" />
+ <description>
+ Converts wide character ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded array to [String]. Returns empty string if source array is not valid wide string.
+ </description>
+ </method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="int" />
diff --git a/doc/classes/PhysicsDirectSpaceState2D.xml b/doc/classes/PhysicsDirectSpaceState2D.xml
index 6ac7175e57..ecc01d0c5c 100644
--- a/doc/classes/PhysicsDirectSpaceState2D.xml
+++ b/doc/classes/PhysicsDirectSpaceState2D.xml
@@ -21,7 +21,7 @@
</description>
</method>
<method name="collide_shape">
- <return type="PackedVector2Array[]" />
+ <return type="Vector2[]" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters2D" />
<param index="1" name="max_results" type="int" default="32" />
<description>
diff --git a/doc/classes/PhysicsDirectSpaceState3D.xml b/doc/classes/PhysicsDirectSpaceState3D.xml
index a009155d64..ee347c04b1 100644
--- a/doc/classes/PhysicsDirectSpaceState3D.xml
+++ b/doc/classes/PhysicsDirectSpaceState3D.xml
@@ -21,7 +21,7 @@
</description>
</method>
<method name="collide_shape">
- <return type="PackedVector3Array[]" />
+ <return type="Vector3[]" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters3D" />
<param index="1" name="max_results" type="int" default="32" />
<description>
diff --git a/doc/classes/PhysicsDirectSpaceState3DExtension.xml b/doc/classes/PhysicsDirectSpaceState3DExtension.xml
index 8c21cd5145..64089489c0 100644
--- a/doc/classes/PhysicsDirectSpaceState3DExtension.xml
+++ b/doc/classes/PhysicsDirectSpaceState3DExtension.xml
@@ -64,7 +64,8 @@
<param index="4" name="collide_with_areas" type="bool" />
<param index="5" name="hit_from_inside" type="bool" />
<param index="6" name="hit_back_faces" type="bool" />
- <param index="7" name="result" type="PhysicsServer3DExtensionRayResult*" />
+ <param index="7" name="pick_ray" type="bool" />
+ <param index="8" name="result" type="PhysicsServer3DExtensionRayResult*" />
<description>
</description>
</method>
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index e1db3dd7b5..492d738639 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -119,6 +119,13 @@
<param index="0" name="area" type="RID" />
<param index="1" name="callback" type="Callable" />
<description>
+ Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters:
+ 1. an integer [code]status[/code]: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area,
+ 2. an [RID] [code]area_rid[/code]: the [RID] of the other area that entered or exited the area,
+ 3. an integer [code]instance_id[/code]: the [code]ObjectID[/code] attached to the other area,
+ 4. an integer [code]area_shape_idx[/code]: the index of the shape of the other area that entered or exited the area,
+ 5. an integer [code]self_shape_idx[/code]: the index of the shape of the area where the other area entered or exited.
+ By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time.
</description>
</method>
<method name="area_set_collision_layer">
@@ -142,12 +149,13 @@
<param index="0" name="area" type="RID" />
<param index="1" name="callback" type="Callable" />
<description>
- Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters:
- 1: [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED], depending on whether the object entered or exited the area.
- 2: [RID] of the object that entered/exited the area.
- 3: Instance ID of the object that entered/exited the area.
- 4: The shape index of the object that entered/exited the area.
- 5: The shape index of the area where the object entered/exited.
+ Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters:
+ 1. an integer [code]status[/code]: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area,
+ 2. an [RID] [code]body_rid[/code]: the [RID] of the body that entered or exited the area,
+ 3. an integer [code]instance_id[/code]: the [code]ObjectID[/code] attached to the body,
+ 4. an integer [code]body_shape_idx[/code]: the index of the shape of the body that entered or exited the area,
+ 5. an integer [code]self_shape_idx[/code]: the index of the shape of the area where the body entered or exited.
+ By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time.
</description>
</method>
<method name="area_set_monitorable">
diff --git a/doc/classes/PhysicsServer3DExtension.xml b/doc/classes/PhysicsServer3DExtension.xml
index 07c748b4a0..e6cce53594 100644
--- a/doc/classes/PhysicsServer3DExtension.xml
+++ b/doc/classes/PhysicsServer3DExtension.xml
@@ -606,7 +606,8 @@
<param index="3" name="margin" type="float" />
<param index="4" name="max_collisions" type="int" />
<param index="5" name="collide_separation_ray" type="bool" />
- <param index="6" name="result" type="PhysicsServer3DExtensionMotionResult*" />
+ <param index="6" name="recovery_as_collision" type="bool" />
+ <param index="7" name="result" type="PhysicsServer3DExtensionMotionResult*" />
<description>
</description>
</method>
diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml
index 6787b5d20a..6996061bd8 100644
--- a/doc/classes/PopupMenu.xml
+++ b/doc/classes/PopupMenu.xml
@@ -202,6 +202,13 @@
Returns the icon of the item at the given [param index].
</description>
</method>
+ <method name="get_item_icon_max_width" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="index" type="int" />
+ <description>
+ Returns the maximum allowed width of the icon for the item at the given [param index].
+ </description>
+ </method>
<method name="get_item_id" qualifiers="const">
<return type="int" />
<param index="0" name="index" type="int" />
@@ -397,6 +404,14 @@
Replaces the [Texture2D] icon of the item at the given [param index].
</description>
</method>
+ <method name="set_item_icon_max_width">
+ <return type="void" />
+ <param index="0" name="index" type="int" />
+ <param index="1" name="width" type="int" />
+ <description>
+ Sets the maximum allowed width of the icon for the item at the given [param index]. This limit is applied on top of the default size of the icon and on top of [theme_item icon_max_width]. The height is adjusted according to the icon's ratio.
+ </description>
+ </method>
<method name="set_item_id">
<return type="void" />
<param index="0" name="index" type="int" />
@@ -573,6 +588,9 @@
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The horizontal space between the item's elements.
</theme_item>
+ <theme_item name="icon_max_width" data_type="constant" type="int" default="0">
+ The maximum allowed width of the item's icon. This limit is applied on top of the default size of the icon, but before the value set with [method set_item_icon_max_width]. The height is adjusted according to the icon's ratio.
+ </theme_item>
<theme_item name="indent" data_type="constant" type="int" default="10">
Width of the single indentation level.
</theme_item>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index ad4635d9a5..3024be924e 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -241,6 +241,9 @@
<member name="application/boot_splash/use_filter" type="bool" setter="" getter="" default="true">
If [code]true[/code], applies linear filtering when scaling the image (recommended for high-resolution artwork). If [code]false[/code], uses nearest-neighbor interpolation (recommended for pixel art).
</member>
+ <member name="application/config/auto_accept_quit" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], the application automatically accepts quitting requests.
+ </member>
<member name="application/config/custom_user_dir_name" type="String" setter="" getter="" default="&quot;&quot;">
This user directory is used for storing persistent data ([code]user://[/code] filesystem). If a custom directory name is defined, this name will be appended to the system-specific user data directory (same parent folder as the Godot configuration folder documented in [method OS.get_user_data_dir]).
The [member application/config/use_custom_user_dir] setting must be enabled for this to take effect.
@@ -265,6 +268,9 @@
Specifies a file to override project settings. For example: [code]user://custom_settings.cfg[/code]. See "Overriding" in the [ProjectSettings] class description at the top for more information.
[b]Note:[/b] Regardless of this setting's value, [code]res://override.cfg[/code] will still be read to override the project settings.
</member>
+ <member name="application/config/quit_on_go_back" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android).
+ </member>
<member name="application/config/use_custom_user_dir" type="bool" setter="" getter="" default="false">
If [code]true[/code], the project will save user data to its own user directory. If [member application/config/custom_user_dir_name] is empty, [code]&lt;OS user data directory&gt;/&lt;project name&gt;[/code] directory will be used. If [code]false[/code], the project will save user data to [code]&lt;OS user data directory&gt;/Godot/app_userdata/&lt;project name&gt;[/code].
See also [url=$DOCS_URL/tutorials/io/data_paths.html#accessing-persistent-user-data-user]File paths in Godot projects[/url]. This setting is only effective on desktop platforms.
@@ -305,6 +311,9 @@
<member name="application/run/low_processor_mode_sleep_usec" type="int" setter="" getter="" default="6900">
Amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage.
</member>
+ <member name="application/run/main_loop_type" type="String" setter="" getter="" default="&quot;SceneTree&quot;">
+ The name of the type implementing the engine's main loop.
+ </member>
<member name="application/run/main_scene" type="String" setter="" getter="" default="&quot;&quot;">
Path to the main scene file that will be loaded when the project runs.
</member>
@@ -698,6 +707,15 @@
On desktop platforms, overrides the game's initial window width. See also [member display/window/size/window_height_override], [member display/window/size/viewport_width] and [member display/window/size/viewport_height].
[b]Note:[/b] By default, or when set to [code]0[/code], the initial window width is the viewport [member display/window/size/viewport_width]. This setting is ignored on iOS, Android, and Web.
</member>
+ <member name="display/window/stretch/aspect" type="String" setter="" getter="" default="&quot;keep&quot;">
+ </member>
+ <member name="display/window/stretch/mode" type="String" setter="" getter="" default="&quot;disabled&quot;">
+ </member>
+ <member name="display/window/stretch/scale" type="float" setter="" getter="" default="1.0">
+ </member>
+ <member name="display/window/subwindows/embed_subwindows" type="bool" setter="" getter="" default="true">
+ If [code]true[/code] subwindows are embedded in the main window.
+ </member>
<member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1">
Sets the V-Sync mode for the main game window.
See [enum DisplayServer.VSyncMode] for possible values and how they affect the behavior of your application.
@@ -712,6 +730,14 @@
Directory that contains the [code].sln[/code] file. By default, the [code].sln[/code] files is in the root of the project directory, next to the [code]project.godot[/code] and [code].csproj[/code] files.
Changing this value allows setting up a multi-project scenario where there are multiple [code].csproj[/code]. Keep in mind that the Godot project is considered one of the C# projects in the workspace and it's root directory should contain the [code]project.godot[/code] and [code].csproj[/code] next to each other.
</member>
+ <member name="editor/export/convert_text_resources_to_binary" type="bool" setter="" getter="" default="true">
+ If [code]true[/code] text resources are converted to binary format on export.
+ </member>
+ <member name="editor/import/reimport_missing_imported_files" type="bool" setter="" getter="" default="true">
+ </member>
+ <member name="editor/import/use_multiple_threads" type="bool" setter="" getter="" default="true">
+ If [code]true[/code] importing of resources is run on multiple threads.
+ </member>
<member name="editor/movie_writer/disable_vsync" type="bool" setter="" getter="" default="false">
If [code]true[/code], requests V-Sync to be disabled when writing a movie (similar to setting [member display/window/vsync/vsync_mode] to [b]Disabled[/b]). This can speed up video writing if the hardware is fast enough to render, encode and save the video at a framerate higher than the monitor's refresh rate.
[b]Note:[/b] [member editor/movie_writer/disable_vsync] has no effect if the operating system or graphics driver forces V-Sync with no way for applications to disable it.
@@ -750,6 +776,9 @@
<member name="editor/naming/node_name_num_separator" type="int" setter="" getter="" default="0">
What to use to separate node name from number. This is mostly an editor setting.
</member>
+ <member name="editor/naming/scene_name_casing" type="int" setter="" getter="" default="2">
+ When generating file names from scene root node, set the type of casing in this project. This is mostly an editor setting.
+ </member>
<member name="editor/run/main_run_args" type="String" setter="" getter="" default="&quot;&quot;">
The command-line arguments to append to Godot's own command line when running the project. This doesn't affect the editor itself.
It is possible to make another executable run Godot by using the [code]%command%[/code] placeholder. The placeholder will be replaced with Godot's own command line. Program-specific arguments should be placed [i]before[/i] the placeholder, whereas Godot-specific arguments should be placed [i]after[/i] the placeholder.
@@ -764,6 +793,10 @@
<member name="editor/script/templates_search_path" type="String" setter="" getter="" default="&quot;res://script_templates&quot;">
Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path.
</member>
+ <member name="editor/version_control/autoload_on_startup" type="bool" setter="" getter="" default="false">
+ </member>
+ <member name="editor/version_control/plugin_name" type="String" setter="" getter="" default="&quot;&quot;">
+ </member>
<member name="filesystem/import/blender/enabled" type="bool" setter="" getter="" default="true">
If [code]true[/code], Blender 3D scene files with the [code].blend[/code] extension will be imported by converting them to glTF 2.0.
This requires configuring a path to a Blender executable in the editor settings at [code]filesystem/import/blender/blender3_path[/code]. Blender 3.0 or later is required.
@@ -787,6 +820,8 @@
<member name="gui/common/default_scroll_deadzone" type="int" setter="" getter="" default="0">
Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden.
</member>
+ <member name="gui/common/snap_controls_to_pixels" type="bool" setter="" getter="" default="true">
+ </member>
<member name="gui/common/swap_cancel_ok" type="bool" setter="" getter="">
If [code]true[/code], swaps [b]Cancel[/b] and [b]OK[/b] buttons in dialogs on Windows and UWP to follow interface conventions. [method DisplayServer.get_swap_cancel_ok] can be used to query whether buttons are swapped at run-time.
[b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by [method DisplayServer.dialog_show].
@@ -794,6 +829,8 @@
<member name="gui/common/text_edit_undo_stack_max_size" type="int" setter="" getter="" default="1024">
Maximum undo/redo history size for [TextEdit] fields.
</member>
+ <member name="gui/fonts/dynamic_fonts/use_oversampling" type="bool" setter="" getter="" default="true">
+ </member>
<member name="gui/theme/custom" type="String" setter="" getter="" default="&quot;&quot;">
Path to a custom [Theme] resource file to use for the project ([code].theme[/code] or generic [code].tres[/code]/[code].res[/code] extension).
</member>
@@ -2309,6 +2346,12 @@
Lower-end override for [member rendering/shading/overrides/force_vertex_shading] on mobile devices, due to performance concerns or driver support.
[b]Note:[/b] This setting currently has no effect, as vertex shading is not implemented yet.
</member>
+ <member name="rendering/textures/canvas_textures/default_texture_filter" type="int" setter="" getter="" default="1">
+ The default texture filtering mode to use on [CanvasItem]s.
+ </member>
+ <member name="rendering/textures/canvas_textures/default_texture_repeat" type="int" setter="" getter="" default="0">
+ The default texture repeating mode to use on [CanvasItem]s.
+ </member>
<member name="rendering/textures/decals/filter" type="int" setter="" getter="" default="3">
The filtering quality to use for [Decal] nodes. When using one of the anisotropic filtering modes, the anisotropic filtering level is controlled by [member rendering/textures/default_filters/anisotropic_filtering_level].
</member>
@@ -2388,6 +2431,9 @@
<member name="xr/openxr/reference_space" type="int" setter="" getter="" default="&quot;1&quot;">
Specify the default reference space.
</member>
+ <member name="xr/openxr/startup_alert" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], Godot will display an alert modal when OpenXR initialization fails on startup.
+ </member>
<member name="xr/openxr/submit_depth_buffer" type="bool" setter="" getter="" default="false">
If [code]true[/code], OpenXR will manage the depth buffer and use the depth buffer for advanced reprojection provided this is supported by the XR runtime. Note that some rendering features in Godot can't be used with this feature.
</member>
diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml
index 5199039ce4..60552c58a1 100644
--- a/doc/classes/Quaternion.xml
+++ b/doc/classes/Quaternion.xml
@@ -31,6 +31,7 @@
<param index="0" name="arc_from" type="Vector3" />
<param index="1" name="arc_to" type="Vector3" />
<description>
+ Constructs a quaternion representing the shortest arc between two points on the surface of a sphere with a radius of [code]1.0[/code].
</description>
</constructor>
<constructor name="Quaternion">
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 03248b7dcb..fd4172f88a 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -587,7 +587,7 @@
<method name="canvas_light_occluder_create">
<return type="RID" />
<description>
- Creates a light occluder and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_ocluder_*[/code] RenderingServer functions.
+ Creates a light occluder and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_occluder_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
</description>
</method>
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index 9a44c2c289..7f840ee49e 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -365,6 +365,7 @@
<param index="0" name="level" type="int" />
<param index="1" name="type" type="int" enum="RichTextLabel.ListType" />
<param index="2" name="capitalize" type="bool" />
+ <param index="3" name="bullet" type="String" default="&quot;•&quot;" />
<description>
Adds [code][ol][/code] or [code][ul][/code] tag to the tag stack. Multiplies [param level] by current [member tab_size] to determine new margin length.
</description>
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index c88acd8950..2921117b8b 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -218,7 +218,7 @@
</methods>
<members>
<member name="auto_accept_quit" type="bool" setter="set_auto_accept_quit" getter="is_auto_accept_quit" default="true">
- If [code]true[/code], the application automatically accepts quitting.
+ If [code]true[/code], the application automatically accepts quitting requests.
For mobile platforms, see [member quit_on_go_back].
</member>
<member name="current_scene" type="Node" setter="set_current_scene" getter="get_current_scene">
@@ -249,7 +249,7 @@
- [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes.
</member>
<member name="quit_on_go_back" type="bool" setter="set_quit_on_go_back" getter="is_quit_on_go_back" default="true">
- If [code]true[/code], the application quits automatically on going back (e.g. on Android).
+ If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android).
To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST].
</member>
<member name="root" type="Window" setter="" getter="get_root">
diff --git a/doc/classes/Shape3D.xml b/doc/classes/Shape3D.xml
index dd75729ae9..dee428ccad 100644
--- a/doc/classes/Shape3D.xml
+++ b/doc/classes/Shape3D.xml
@@ -23,7 +23,7 @@
When set to [code]0[/code], the default value from [member ProjectSettings.physics/3d/solver/default_contact_bias] is used.
</member>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.04">
- The collision margin for the shape. Used in Bullet Physics only.
+ The collision margin for the shape. This is not used in Godot Physics.
Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp.
</member>
</members>
diff --git a/doc/classes/SkeletonModification2DLookAt.xml b/doc/classes/SkeletonModification2DLookAt.xml
index f209db7797..190ba7b432 100644
--- a/doc/classes/SkeletonModification2DLookAt.xml
+++ b/doc/classes/SkeletonModification2DLookAt.xml
@@ -81,7 +81,7 @@
The [Bone2D] node that the modification will operate on.
</member>
<member name="bone_index" type="int" setter="set_bone_index" getter="get_bone_index" default="-1">
- The index of the [Bone2D] node that the modification will oeprate on.
+ The index of the [Bone2D] node that the modification will operate on.
</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 LookAt modification. This node is what the modification will rotate the [Bone2D] to.
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index d629a31bca..1f4ffa417d 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -946,6 +946,12 @@
Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-8]UTF-8[/url] encoded [PackedByteArray]. This method is slightly slower than [method to_ascii_buffer], but supports all UTF-8 characters. For most cases, prefer using this method.
</description>
</method>
+ <method name="to_wchar_buffer" qualifiers="const">
+ <return type="PackedByteArray" />
+ <description>
+ Converts the string to a [url=https://en.wikipedia.org/wiki/Wide_character]wide character[/url] ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded [PackedByteArray].
+ </description>
+ </method>
<method name="trim_prefix" qualifiers="const">
<return type="String" />
<param index="0" name="prefix" type="String" />
diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml
index 192cb1a6c2..2140c53e20 100644
--- a/doc/classes/StringName.xml
+++ b/doc/classes/StringName.xml
@@ -853,6 +853,12 @@
Converts the string to a [url=https://en.wikipedia.org/wiki/UTF-8]UTF-8[/url] encoded [PackedByteArray]. This method is slightly slower than [method to_ascii_buffer], but supports all UTF-8 characters. For most cases, prefer using this method.
</description>
</method>
+ <method name="to_wchar_buffer" qualifiers="const">
+ <return type="PackedByteArray" />
+ <description>
+ Converts the string to a [url=https://en.wikipedia.org/wiki/Wide_character]wide character[/url] ([code]wchar_t[/code], UTF-16 on Windows, UTF-32 on other platforms) encoded [PackedByteArray].
+ </description>
+ </method>
<method name="trim_prefix" qualifiers="const">
<return type="String" />
<param index="0" name="prefix" type="String" />
diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml
index ae6d589339..7211fc2137 100644
--- a/doc/classes/TabBar.xml
+++ b/doc/classes/TabBar.xml
@@ -46,14 +46,21 @@
<return type="Texture2D" />
<param index="0" name="tab_idx" type="int" />
<description>
- Returns the [Texture2D] for the right button of the tab at index [param tab_idx] or [code]null[/code] if the button has no [Texture2D].
+ Returns the icon for the right button of the tab at index [param tab_idx] or [code]null[/code] if the right button has no icon.
</description>
</method>
<method name="get_tab_icon" qualifiers="const">
<return type="Texture2D" />
<param index="0" name="tab_idx" type="int" />
<description>
- Returns the [Texture2D] for the tab at index [param tab_idx] or [code]null[/code] if the tab has no [Texture2D].
+ Returns the icon for the tab at index [param tab_idx] or [code]null[/code] if the tab has no icon.
+ </description>
+ </method>
+ <method name="get_tab_icon_max_width" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="tab_idx" type="int" />
+ <description>
+ Returns the maximum allowed width of the icon for the tab at index [param tab_idx].
</description>
</method>
<method name="get_tab_idx_at_point" qualifiers="const">
@@ -158,6 +165,14 @@
Sets an [param icon] for the tab at index [param tab_idx].
</description>
</method>
+ <method name="set_tab_icon_max_width">
+ <return type="void" />
+ <param index="0" name="tab_idx" type="int" />
+ <param index="1" name="width" type="int" />
+ <description>
+ Sets the maximum allowed width of the icon for the tab at index [param tab_idx]. This limit is applied on top of the default size of the icon and on top of [theme_item icon_max_width]. The height is adjusted according to the icon's ratio.
+ </description>
+ </method>
<method name="set_tab_language">
<return type="void" />
<param index="0" name="tab_idx" type="int" />
@@ -323,6 +338,9 @@
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The horizontal separation between the elements inside tabs.
</theme_item>
+ <theme_item name="icon_max_width" data_type="constant" type="int" default="0">
+ The maximum allowed width of the tab's icon. This limit is applied on top of the default size of the icon, but before the value set with [method set_tab_icon_max_width]. The height is adjusted according to the icon's ratio.
+ </theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the tab text outline.
[b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml
index c34336353f..b0dcb932dc 100644
--- a/doc/classes/TabContainer.xml
+++ b/doc/classes/TabContainer.xml
@@ -209,6 +209,9 @@
<theme_item name="font_unselected_color" data_type="color" type="Color" default="Color(0.7, 0.7, 0.7, 1)">
Font color of the other, unselected tabs.
</theme_item>
+ <theme_item name="icon_max_width" data_type="constant" type="int" default="0">
+ The maximum allowed width of the tab's icon. This limit is applied on top of the default size of the icon, but before the value set with [method TabBar.set_tab_icon_max_width]. The height is adjusted according to the icon's ratio.
+ </theme_item>
<theme_item name="icon_separation" data_type="constant" type="int" default="4">
Space between tab's name and its icon.
</theme_item>
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index 439514aa62..4f38785369 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -113,6 +113,15 @@
Returns the font ascent (number of pixels above the baseline).
</description>
</method>
+ <method name="font_get_char_from_glyph_index" qualifiers="const">
+ <return type="int" />
+ <param index="0" name="font_rid" type="RID" />
+ <param index="1" name="size" type="int" />
+ <param index="2" name="glyph_index" type="int" />
+ <description>
+ Returns character code associated with [param glyph_index], or [code]0[/code] if [param glyph_index] is invalid. See [method font_get_glyph_index].
+ </description>
+ </method>
<method name="font_get_descent" qualifiers="const">
<return type="float" />
<param index="0" name="font_rid" type="RID" />
@@ -191,7 +200,7 @@
<param index="2" name="char" type="int" />
<param index="3" name="variation_selector" type="int" />
<description>
- Returns the glyph index of a [param char], optionally modified by the [param variation_selector].
+ Returns the glyph index of a [param char], optionally modified by the [param variation_selector]. See [method font_get_char_from_glyph_index].
</description>
</method>
<method name="font_get_glyph_list" qualifiers="const">
@@ -1154,7 +1163,7 @@
<param index="1" name="width" type="float" />
<param index="2" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<description>
- Adjusts text with to fit to specified width, returns new text width.
+ Adjusts text width to fit to specified width, returns new text width.
</description>
</method>
<method name="shaped_text_get_ascent" qualifiers="const">
diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml
index a57a95bf9b..a3891442b7 100644
--- a/doc/classes/TextServerExtension.xml
+++ b/doc/classes/TextServerExtension.xml
@@ -99,6 +99,14 @@
<description>
</description>
</method>
+ <method name="_font_get_char_from_glyph_index" qualifiers="virtual const">
+ <return type="int" />
+ <param index="0" name="font_rid" type="RID" />
+ <param index="1" name="size" type="int" />
+ <param index="2" name="glyph_index" type="int" />
+ <description>
+ </description>
+ </method>
<method name="_font_get_descent" qualifiers="virtual const">
<return type="float" />
<param index="0" name="font_rid" type="RID" />
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index 4877974a3c..dc501d482d 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -155,7 +155,7 @@
<return type="int" />
<param index="0" name="layer_index" type="int" />
<description>
- Returns the navigation layers (as in the Navigation server) of the gives TileSet navigation layer.
+ Returns the navigation layers (as in the Navigation server) of the given TileSet navigation layer.
</description>
</method>
<method name="get_navigation_layers_count" qualifiers="const">
@@ -522,7 +522,7 @@
<param index="0" name="layer_index" type="int" />
<param index="1" name="layers" type="int" />
<description>
- Sets the navigation layers (as in the navigation server) for navigation regions is the given TileSet navigation layer.
+ Sets the navigation layers (as in the navigation server) for navigation regions in the given TileSet navigation layer.
</description>
</method>
<method name="set_occlusion_layer_light_mask">
@@ -538,7 +538,7 @@
<param index="0" name="layer_index" type="int" />
<param index="1" name="sdf_collision" type="bool" />
<description>
- Enables or disables sdf collision for occluders in the given TileSet occlusion layer.
+ Enables or disables SDF collision for occluders in the given TileSet occlusion layer.
</description>
</method>
<method name="set_physics_layer_collision_layer">
diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml
index 7b33be64a1..4c775cdc4c 100644
--- a/doc/classes/Transform2D.xml
+++ b/doc/classes/Transform2D.xml
@@ -120,7 +120,7 @@
<return type="bool" />
<param index="0" name="xform" type="Transform2D" />
<description>
- Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
+ Returns [code]true[/code] if this transform and [param xform] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
<method name="is_finite" qualifiers="const">
@@ -133,7 +133,7 @@
<return type="Transform2D" />
<param index="0" name="target" type="Vector2" default="Vector2(0, 0)" />
<description>
- Returns a copy of the transform rotated such that it's rotation on the X-axis points towards the [param target] position.
+ Returns a copy of the transform rotated such that the rotated X-axis points towards the [param target] position.
Operations take place in global space.
</description>
</method>
@@ -148,8 +148,7 @@
<param index="0" name="angle" type="float" />
<description>
Returns a copy of the transform rotated by the given [param angle] (in radians).
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -158,8 +157,7 @@
<param index="0" name="angle" type="float" />
<description>
Returns a copy of the transform rotated by the given [param angle] (in radians).
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
@@ -168,8 +166,7 @@
<param index="0" name="scale" type="Vector2" />
<description>
Returns a copy of the transform scaled by the given [param scale] factor.
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -178,8 +175,7 @@
<param index="0" name="scale" type="Vector2" />
<description>
Returns a copy of the transform scaled by the given [param scale] factor.
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
@@ -188,8 +184,7 @@
<param index="0" name="offset" type="Vector2" />
<description>
Returns a copy of the transform translated by the given [param offset].
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -198,8 +193,7 @@
<param index="0" name="offset" type="Vector2" />
<description>
Returns a copy of the transform translated by the given [param offset].
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml
index 505d213cdb..fb5c8559b6 100644
--- a/doc/classes/Transform3D.xml
+++ b/doc/classes/Transform3D.xml
@@ -80,7 +80,7 @@
<return type="bool" />
<param index="0" name="xform" type="Transform3D" />
<description>
- Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
+ Returns [code]true[/code] if this transform and [param xform] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
<method name="is_finite" qualifiers="const">
@@ -111,8 +111,7 @@
<description>
Returns a copy of the transform rotated around the given [param axis] by the given [param angle] (in radians).
The [param axis] must be a normalized vector.
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -123,8 +122,7 @@
<description>
Returns a copy of the transform rotated around the given [param axis] by the given [param angle] (in radians).
The [param axis] must be a normalized vector.
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
@@ -133,8 +131,7 @@
<param index="0" name="scale" type="Vector3" />
<description>
Returns a copy of the transform scaled by the given [param scale] factor.
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -143,8 +140,7 @@
<param index="0" name="scale" type="Vector3" />
<description>
Returns a copy of the transform scaled by the given [param scale] factor.
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
@@ -153,8 +149,7 @@
<param index="0" name="offset" type="Vector3" />
<description>
Returns a copy of the transform translated by the given [param offset].
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -163,8 +158,7 @@
<param index="0" name="offset" type="Vector3" />
<description>
Returns a copy of the transform translated by the given [param offset].
- This method is an optimized version of multiplying the given transform [code]X[/code]
- with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code].
+ This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml
index acbb77e63a..155a7d4bdd 100644
--- a/doc/classes/TranslationServer.xml
+++ b/doc/classes/TranslationServer.xml
@@ -156,7 +156,7 @@
<param index="2" name="n" type="int" />
<param index="3" name="context" type="StringName" default="&quot;&quot;" />
<description>
- Returns the current locale's translation for the given message (key), plural_message and context.
+ Returns the current locale's translation for the given message (key), plural message and context.
The number [param n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language.
</description>
</method>
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index 95778f86c4..d09f61b8c8 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -518,6 +518,9 @@
<theme_item name="h_separation" 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="icon_max_width" data_type="constant" type="int" default="0">
+ The maximum allowed width of the icon in item's cells. This limit is applied on top of the default size of the icon, but before the value set with [method TreeItem.set_icon_max_width]. The height is adjusted according to the icon's ratio.
+ </theme_item>
<theme_item name="item_margin" data_type="constant" type="int" default="16">
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 3ce434e069..49b4622aed 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -183,7 +183,7 @@
<return type="int" />
<param index="0" name="column" type="int" />
<description>
- Returns the column's icon's maximum width.
+ Returns the maximum allowed width of the icon in the given [param column].
</description>
</method>
<method name="get_icon_modulate" qualifiers="const">
@@ -545,7 +545,7 @@
<param index="0" name="column" type="int" />
<param index="1" name="width" type="int" />
<description>
- Sets the given column's icon's maximum width.
+ Sets the maximum allowed width of the icon in the given [param column]. This limit is applied on top of the default size of the icon and on top of [theme_item Tree.icon_max_width]. The height is adjusted according to the icon's ratio.
</description>
</method>
<method name="set_icon_modulate">
diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml
index f091ce66f8..7e313c3d4c 100644
--- a/doc/classes/Tween.xml
+++ b/doc/classes/Tween.xml
@@ -131,6 +131,12 @@
Returns [code]true[/code] if the [Tween] still has [Tweener]s that haven't finished.
</description>
</method>
+ <method name="get_loops_left" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the number of remaining loops for this [Tween] (see [method set_loops]). A return value of [code]-1[/code] indicates an infinitely looping [Tween], and a return value of [code]0[/code] indicates that the [Tween] has already finished.
+ </description>
+ </method>
<method name="get_total_elapsed_time" qualifiers="const">
<return type="float" />
<description>
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index ada853f752..35ccac120f 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -143,7 +143,7 @@
<param index="2" name="post_b" type="Vector2" />
<param index="3" name="weight" type="float" />
<description>
- Cubically interpolates between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
+ Performs a cubic interpolation between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="cubic_interpolate_in_time" qualifiers="const">
@@ -156,7 +156,7 @@
<param index="5" name="pre_a_t" type="float" />
<param index="6" name="post_b_t" type="float" />
<description>
- Cubically interpolates between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
+ Performs a cubic interpolation between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
It can perform smoother interpolation than [code]cubic_interpolate()[/code] by the time values.
</description>
</method>
@@ -226,7 +226,7 @@
<method name="is_normalized" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the vector is normalized, [code]false[/code] otherwise.
+ Returns [code]true[/code] if the vector is normalized, i.e. its length is approximately equal to 1.
</description>
</method>
<method name="is_zero_approx" qualifiers="const">
@@ -254,7 +254,7 @@
<param index="0" name="to" type="Vector2" />
<param index="1" name="weight" type="float" />
<description>
- Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
+ Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation.
</description>
</method>
<method name="limit_length" qualifiers="const">
@@ -287,7 +287,8 @@
<method name="normalized" qualifiers="const">
<return type="Vector2" />
<description>
- Returns a new vector scaled to unit length. Equivalent to [code]v / v.length()[/code].
+ Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized].
+ [b]Note:[/b] This function may return incorrect values if the initial vector length is near zero.
</description>
</method>
<method name="orthogonal" qualifiers="const">
diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml
index 8c977dbc67..8db6bcc1b9 100644
--- a/doc/classes/Vector2i.xml
+++ b/doc/classes/Vector2i.xml
@@ -31,7 +31,7 @@
<return type="Vector2i" />
<param index="0" name="from" type="Vector2" />
<description>
- Constructs a new [Vector2i] from [Vector2]. The floating point coordinates will be truncated.
+ Constructs a new [Vector2i] from the given [Vector2] by truncating components' fractional parts (rounding towards zero). For a different behavior consider passing the result of [method Vector2.ceil], [method Vector2.floor] or [method Vector2.round] to this constructor instead.
</description>
</constructor>
<constructor name="Vector2i">
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index 3957be5f1d..d55e31f7b7 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -194,7 +194,7 @@
<method name="is_normalized" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the vector is [method normalized], [code]false[/code] otherwise.
+ Returns [code]true[/code] if the vector is normalized, i.e. its length is approximately equal to 1.
</description>
</method>
<method name="is_zero_approx" qualifiers="const">
@@ -222,7 +222,7 @@
<param index="0" name="to" type="Vector3" />
<param index="1" name="weight" type="float" />
<description>
- Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
+ Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation.
</description>
</method>
<method name="limit_length" qualifiers="const">
@@ -255,7 +255,8 @@
<method name="normalized" qualifiers="const">
<return type="Vector3" />
<description>
- Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized].
+ Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized].
+ [b]Note:[/b] This function may return incorrect values if the input vector length is near zero.
</description>
</method>
<method name="octahedron_decode" qualifiers="static">
diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml
index 91ccfb6d81..248b47db92 100644
--- a/doc/classes/Vector3i.xml
+++ b/doc/classes/Vector3i.xml
@@ -31,7 +31,7 @@
<return type="Vector3i" />
<param index="0" name="from" type="Vector3" />
<description>
- Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated.
+ Constructs a new [Vector3i] from the given [Vector3] by truncating components' fractional parts (rounding towards zero). For a different behavior consider passing the result of [method Vector3.ceil], [method Vector3.floor] or [method Vector3.round] to this constructor instead.
</description>
</constructor>
<constructor name="Vector3i">
diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml
index 14a30a2eb7..ea00ddaae1 100644
--- a/doc/classes/Vector4.xml
+++ b/doc/classes/Vector4.xml
@@ -145,7 +145,7 @@
<method name="is_normalized" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the vector is normalized, i.e. its length is equal to 1.
+ Returns [code]true[/code] if the vector is normalized, i.e. its length is approximately equal to 1.
</description>
</method>
<method name="is_zero_approx" qualifiers="const">
@@ -190,7 +190,8 @@
<method name="normalized" qualifiers="const">
<return type="Vector4" />
<description>
- Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code].
+ Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized].
+ [b]Note:[/b] This function may return incorrect values if the input vector length is near zero.
</description>
</method>
<method name="posmod" qualifiers="const">
diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml
index 93377c9599..e2de7a28dc 100644
--- a/doc/classes/Vector4i.xml
+++ b/doc/classes/Vector4i.xml
@@ -27,7 +27,7 @@
<return type="Vector4i" />
<param index="0" name="from" type="Vector4" />
<description>
- Constructs a new [Vector4i] from the given [Vector4].
+ Constructs a new [Vector4i] from the given [Vector4] by truncating components' fractional parts (rounding towards zero). For a different behavior consider passing the result of [method Vector4.ceil], [method Vector4.floor] or [method Vector4.round] to this constructor instead.
</description>
</constructor>
<constructor name="Vector4i">
diff --git a/doc/classes/VehicleWheel3D.xml b/doc/classes/VehicleWheel3D.xml
index 9f69f0b0e6..1695cc6bea 100644
--- a/doc/classes/VehicleWheel3D.xml
+++ b/doc/classes/VehicleWheel3D.xml
@@ -61,7 +61,7 @@
<member name="suspension_stiffness" type="float" setter="set_suspension_stiffness" getter="get_suspension_stiffness" default="5.88">
This value defines the stiffness of the suspension. Use a value lower than 50 for an off-road car, a value between 50 and 100 for a race car and try something around 200 for something like a Formula 1 car.
</member>
- <member name="suspension_travel" type="float" setter="set_suspension_travel" getter="get_suspension_travel" default="5.0">
+ <member name="suspension_travel" type="float" setter="set_suspension_travel" getter="get_suspension_travel" default="0.2">
This is the distance the suspension can travel. As Godot units are equivalent to meters, keep this setting relatively low. Try a value between 0.1 and 0.3 depending on the type of car.
</member>
<member name="use_as_steering" type="bool" setter="set_use_as_steering" getter="is_used_as_steering" default="false">
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index 85ff536945..d194f7dd6c 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -530,7 +530,7 @@
[b]Note:[/b] Fullscreen mode is not exclusive full screen on Windows and Linux.
</member>
<member name="mouse_passthrough" type="bool" setter="set_flag" getter="get_flag" default="false">
- If [code]true[/code], all mouse event as passed to the underlying window of the same application. See also [member mouse_passthrough_polygon].
+ If [code]true[/code], all mouse events will be passed to the underlying window of the same application. See also [member mouse_passthrough_polygon].
[b]Note:[/b] This property is implemented on Linux (X11), macOS and Windows.
</member>
<member name="mouse_passthrough_polygon" type="PackedVector2Array" setter="set_mouse_passthrough_polygon" getter="get_mouse_passthrough_polygon" default="PackedVector2Array()">
diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml
index d8776fee39..911e0f6bf6 100644
--- a/doc/classes/XRInterface.xml
+++ b/doc/classes/XRInterface.xml
@@ -57,6 +57,13 @@
Returns the an array of supported environment blend modes, see [enum XRInterface.EnvironmentBlendMode].
</description>
</method>
+ <method name="get_system_info">
+ <return type="Dictionary" />
+ <description>
+ Returns a [Dictionary] with extra system info. Interfaces are expected to return [code]XRRuntimeName[/code] and [code]XRRuntimeVersion[/code] providing info about the used XR runtime. Additional entries may be provided specific to an interface.
+ [b]Note:[/b]This information may only be available after [method initialize] was successfully called.
+ </description>
+ </method>
<method name="get_tracking_status" qualifiers="const">
<return type="int" enum="XRInterface.TrackingStatus" />
<description>
diff --git a/doc/classes/XRInterfaceExtension.xml b/doc/classes/XRInterfaceExtension.xml
index 217cde269e..129465c2ad 100644
--- a/doc/classes/XRInterfaceExtension.xml
+++ b/doc/classes/XRInterfaceExtension.xml
@@ -98,6 +98,12 @@
Returns a [PackedStringArray] with tracker names configured by this interface. Note that user configuration can override this list.
</description>
</method>
+ <method name="_get_system_info" qualifiers="virtual const">
+ <return type="Dictionary" />
+ <description>
+ Returns a [Dictionary] with system informationr elated to this interface.
+ </description>
+ </method>
<method name="_get_tracking_status" qualifiers="virtual const">
<return type="int" enum="XRInterface.TrackingStatus" />
<description>
diff --git a/doc/classes/int.xml b/doc/classes/int.xml
index 7887fc1980..ab624bb8a3 100644
--- a/doc/classes/int.xml
+++ b/doc/classes/int.xml
@@ -1,40 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="int" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Integer built-in type.
+ Built-in integer Variant type.
</brief_description>
<description>
- Signed 64-bit integer type.
- It can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around.
- [int] is a [Variant] type, and will thus be used when assigning an integer value to a [Variant]. It can also be enforced with the [code]: int[/code] type hint.
+ Signed 64-bit integer type. This means that it can take values from [code]-2^63[/code] to [code]2^63 - 1[/code], i.e. from [code]-9223372036854775808[/code] to [code]9223372036854775807[/code]. When it exceeds these bounds, it will wrap around.
+ [int]s can be automatically converted to [float]s when necessary, for example when passing them as arguments in functions. The [float] will be as close to the original integer as possible.
+ Likewise, [float]s can be automatically converted into [int]s. This will truncate the [float], discarding anything after the floating point.
+ [b]Note:[/b] In a boolean context, an [int] will evaluate to [code]false[/code] if it equals [code]0[/code], and to [code]true[/code] otherwise.
[codeblocks]
[gdscript]
- var my_variant = 0 # int, value 0.
- my_variant += 4.2 # float, value 4.2.
- var my_int: int = 1 # int, value 1.
- my_int = 4.2 # int, value 4, the right value is implicitly cast to int.
- my_int = int("6.7") # int, value 6, the String is explicitly cast with int.
- var max_int = 9223372036854775807
- print(max_int) # 9223372036854775807, OK.
- max_int += 1
- print(max_int) # -9223372036854775808, we overflowed and wrapped around.
+ var x: int = 1 # x is 1
+ x = 4.2 # x is 4, because 4.2 gets truncated
+ var max_int = 9223372036854775807 # Biggest value an int can store
+ max_int += 1 # max_int is -9223372036854775808, because it wrapped around
[/gdscript]
[csharp]
- int myInt = (int)"6.7".ToFloat(); // int, value 6, the String is explicitly cast with int.
- // We have to use `long` here, because GDSript's `int`
- // is 64 bits long while C#'s `int` is only 32 bits.
- long maxInt = 9223372036854775807;
- GD.Print(maxInt); // 9223372036854775807, OK.
- maxInt++;
- GD.Print(maxInt); // -9223372036854775808, we overflowed and wrapped around.
+ int x = 1; // x is 1
+ x = 4.2; // x is 4, because 4.2 gets truncated
+ // We use long below, because GDScript's int is 64-bit while C#'s int is 32-bit.
+ long maxLong = 9223372036854775807; // Biggest value a long can store
+ maxLong++; // maxLong is now -9223372036854775808, because it wrapped around.
- // Alternatively, if we used C#'s 32-bit `int` type, the maximum value is much smaller:
- int halfInt = 2147483647;
- GD.Print(halfInt); // 2147483647, OK.
- halfInt++;
- GD.Print(halfInt); // -2147483648, we overflowed and wrapped around.
+ // Alternatively with C#'s 32-bit int type, which has a smaller maximum value.
+ int maxInt = 2147483647; // Biggest value an int can store
+ maxInt++; // maxInt is now -2147483648, because it wrapped around
[/csharp]
[/codeblocks]
+ In GDScript, you can use the [code]0b[/code] literal for binary representation, the [code]0x[/code] literal for hexadecimal representation, and the [code]_[/code] symbol to separate long numbers and improve readability.
+ [codeblock]
+ var x = 0b1001 # x is 9
+ var y = 0xF5 # y is 245
+ var z = 10_000_000 # z is 10000000
+ [/codeblock]
</description>
<tutorials>
</tutorials>
@@ -42,7 +40,7 @@
<constructor name="int">
<return type="int" />
<description>
- Constructs a default-initialized [int] set to [code]0[/code].
+ Constructs an [int] set to [code]0[/code].
</description>
</constructor>
<constructor name="int">
@@ -56,21 +54,21 @@
<return type="int" />
<param index="0" name="from" type="String" />
<description>
- Converts a [String] to an [int], following the same rules as [method String.to_int].
+ Constructs a new [int] from a [String], following the same rules as [method String.to_int].
</description>
</constructor>
<constructor name="int">
<return type="int" />
<param index="0" name="from" type="bool" />
<description>
- Cast a [bool] value to an integer value, [code]int(true)[/code] will be equals to 1 and [code]int(false)[/code] will be equals to 0.
+ Constructs a new [int] from a [bool]. [code]true[/code] is converted to [code]1[/code] and [code]false[/code] is converted to [code]0[/code].
</description>
</constructor>
<constructor name="int">
<return type="int" />
<param index="0" name="from" type="float" />
<description>
- Cast a float value to an integer value, this method simply removes the number fractions (i.e. rounds [param from] towards zero), so for example [code]int(2.7)[/code] will be equals to 2, [code]int(0.1)[/code] will be equals to 0 and [code]int(-2.7)[/code] will be equals to -2. This operation is also called truncation.
+ Constructs a new [int] from a [float]. This will truncate the [float], discarding anything after the floating point.
</description>
</constructor>
</constructors>
@@ -79,25 +77,25 @@
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] if this [int] is not equivalent to the given [float].
+ Returns [code]true[/code] if the [int] is not equivalent to the [float].
</description>
</operator>
<operator name="operator !=">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
- Returns [code]true[/code] if the integers are not equal.
+ Returns [code]true[/code] if the [int]s are not equal.
</description>
</operator>
<operator name="operator %">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Returns the remainder after dividing two integers. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers.
+ Returns the remainder after dividing two [int]s. Uses truncated division, which returns a negative number if the dividend is negative. If this is not desired, consider using [method @GlobalScope.posmod].
[codeblock]
- print(5 % 2) # 1
- print(12 % 4) # 0
- print(-5 % 3) # -2
+ print(6 % 2) # Prints 0
+ print(11 % 4) # Prints 3
+ print(-5 % 3) # Prints -2
[/codeblock]
</description>
</operator>
@@ -105,17 +103,16 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Returns the result of bitwise [code]AND[/code] operation for two integers.
+ Performs the bitwise [code]AND[/code] operation.
[codeblock]
- print(3 &amp; 1) # 1
- print(11 &amp; 3) # 3
+ print(0b1100 &amp; 0b1010) # Prints 8 (binary 1000)
[/codeblock]
- It's useful to retrieve binary flags from a variable.
+ This is useful for retrieving binary flags from a variable.
[codeblock]
- var flags = 5
- # Do something if the first bit is enabled.
- if flags &amp; 1:
- do_stuff()
+ var flags = 0b101
+ # Check if the first or second bit are enabled.
+ if flags &amp; 0b011:
+ do_stuff() # This line will run.
[/codeblock]
</description>
</operator>
@@ -123,23 +120,23 @@
<return type="Color" />
<param index="0" name="right" type="Color" />
<description>
- Multiplies each component of the [Color] by the given [int].
+ Multiplies each component of the [Color] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Quaternion" />
<param index="0" name="right" type="Quaternion" />
<description>
- Multiplies each component of the [Quaternion] by the given [int]. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
+ Multiplies each component of the [Quaternion] by the [int]. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
</description>
</operator>
<operator name="operator *">
<return type="Vector2" />
<param index="0" name="right" type="Vector2" />
<description>
- Multiplies each component of the [Vector2] by the given [int].
+ Multiplies each component of the [Vector2] by the [int].
[codeblock]
- print(2 * Vector2(1, 1)) # Vector2(2, 2)
+ print(2 * Vector2(1, 4)) # Prints (2, 8)
[/codeblock]
</description>
</operator>
@@ -147,49 +144,49 @@
<return type="Vector2i" />
<param index="0" name="right" type="Vector2i" />
<description>
- Multiplies each component of the [Vector2i] by the given [int].
+ Multiplies each component of the [Vector2i] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Vector3" />
<param index="0" name="right" type="Vector3" />
<description>
- Multiplies each component of the [Vector3] by the given [int].
+ Multiplies each component of the [Vector3] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Vector3i" />
<param index="0" name="right" type="Vector3i" />
<description>
- Multiplies each component of the [Vector3i] by the given [int].
+ Multiplies each component of the [Vector3i] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Vector4" />
<param index="0" name="right" type="Vector4" />
<description>
- Multiplies each component of the [Vector4] by the given [int].
+ Multiplies each component of the [Vector4] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Vector4i" />
<param index="0" name="right" type="Vector4i" />
<description>
- Multiplies each component of the [Vector4i] by the given [int].
+ Multiplies each component of the [Vector4i] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="float" />
<param index="0" name="right" type="float" />
<description>
- Multiplies an [int] and a [float]. The result is a [float].
+ Multiplies the [float] by the [int]. The result is a [float].
</description>
</operator>
<operator name="operator *">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Multiplies two [int]s.
+ Multiplies the two [int]s.
</description>
</operator>
<operator name="operator **">
@@ -198,7 +195,7 @@
<description>
Raises an [int] to a power of a [float]. The result is a [float].
[codeblock]
- print(8**0.25) # 1.68179283050743
+ print(2 ** 0.5) # Prints 1.4142135623731
[/codeblock]
</description>
</operator>
@@ -206,9 +203,9 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Raises an [int] to a power of a [int].
+ Raises the left [int] to a power of the right [int].
[codeblock]
- print(5**5) # 3125
+ print(3 ** 4) # Prints 81
[/codeblock]
</description>
</operator>
@@ -216,37 +213,37 @@
<return type="float" />
<param index="0" name="right" type="float" />
<description>
- Adds an [int] and a [float]. The result is a [float].
+ Adds the [int] and the [float]. The result is a [float].
</description>
</operator>
<operator name="operator +">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Adds two integers.
+ Adds the two [int]s.
</description>
</operator>
<operator name="operator -">
<return type="float" />
<param index="0" name="right" type="float" />
<description>
- Subtracts a [float] from an [int]. The result is a [float].
+ Subtracts the [float] from the [int]. The result is a [float].
</description>
</operator>
<operator name="operator -">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Subtracts two integers.
+ Subtracts the two [int]s.
</description>
</operator>
<operator name="operator /">
<return type="float" />
<param index="0" name="right" type="float" />
<description>
- Divides an [int] by a [float]. The result is a [float].
+ Divides the [int] by the [float]. The result is a [float].
[codeblock]
- print(10 / 3.0) # 3.333...
+ print(10 / 3.0) # Prints 3.33333333333333
[/codeblock]
</description>
</operator>
@@ -254,10 +251,10 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Divides two integers. The decimal part of the result is discarded (truncated).
+ Divides the two [int]s. The result is an [int]. This will truncate the [float], discarding anything after the floating point.
[codeblock]
- print(10 / 2) # 5
- print(10 / 3) # 3
+ print(6 / 2) # Prints 3
+ print(5 / 3) # Prints 1
[/codeblock]
</description>
</operator>
@@ -265,24 +262,24 @@
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] if this [int] is less than the given [float].
+ Returns [code]true[/code] if the [int] is less than the [float].
</description>
</operator>
<operator name="operator &lt;">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
- Returns [code]true[/code] if the left integer is less than the right one.
+ Returns [code]true[/code] if the left [int] is less than the right [int].
</description>
</operator>
<operator name="operator &lt;&lt;">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Performs bitwise shift left operation on the integer. Effectively the same as multiplying by a power of 2.
+ Performs the bitwise shift left operation. Effectively the same as multiplying by a power of 2.
[codeblock]
- print(10 &lt;&lt; 1) # 20
- print(10 &lt;&lt; 4) # 160
+ print(0b1010 &lt;&lt; 1) # Prints 20 (binary 10100)
+ print(0b1010 &lt;&lt; 3) # Prints 80 (binary 1010000)
[/codeblock]
</description>
</operator>
@@ -290,66 +287,66 @@
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] if this [int] is less than or equal to the given [float].
+ Returns [code]true[/code] if the [int] is less than or equal to the [float].
</description>
</operator>
<operator name="operator &lt;=">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
- Returns [code]true[/code] if the left integer is less than or equal to the right one.
+ Returns [code]true[/code] if the left [int] is less than or equal to the right [int].
</description>
</operator>
<operator name="operator ==">
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] if the integer is equal to the given [float].
+ Returns [code]true[/code] if the [int] is equal to the [float].
</description>
</operator>
<operator name="operator ==">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
- Returns [code]true[/code] if both integers are equal.
+ Returns [code]true[/code] if the two [int]s are equal.
</description>
</operator>
<operator name="operator &gt;">
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] if this [int] is greater than the given [float].
+ Returns [code]true[/code] if the [int] is greater than the [float].
</description>
</operator>
<operator name="operator &gt;">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
- Returns [code]true[/code] if the left integer is greater than the right one.
+ Returns [code]true[/code] if the left [int] is greater than the right [int].
</description>
</operator>
<operator name="operator &gt;=">
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] if this [int] is greater than or equal to the given [float].
+ Returns [code]true[/code] if the [int] is greater than or equal to the [float].
</description>
</operator>
<operator name="operator &gt;=">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
- Returns [code]true[/code] if the left integer is greater than or equal to the right one.
+ Returns [code]true[/code] if the left [int] is greater than or equal to the right [int].
</description>
</operator>
<operator name="operator &gt;&gt;">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Performs bitwise shift right operation on the integer. Effectively the same as dividing by a power of 2.
+ Performs the bitwise shift right operation. Effectively the same as dividing by a power of 2.
[codeblock]
- print(10 &gt;&gt; 1) # 5
- print(10 &gt;&gt; 2) # 2
+ print(0b1010 &gt;&gt; 1) # Prints 5 (binary 101)
+ print(0b1010 &gt;&gt; 2) # Prints 2 (binary 10)
[/codeblock]
</description>
</operator>
@@ -357,10 +354,9 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Returns the result of bitwise [code]XOR[/code] operation for two integers.
+ Performs the bitwise [code]XOR[/code] operation.
[codeblock]
- print(5 ^ 1) # 4
- print(4 ^ 7) # 3
+ print(0b1100 ^ 0b1010) # Prints 6 (binary 110)
[/codeblock]
</description>
</operator>
@@ -380,27 +376,24 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
- Returns the result of bitwise [code]OR[/code] operation for two integers.
+ Performs the bitwise [code]OR[/code] operation.
[codeblock]
- print(2 | 4) # 6
- print(1 | 3) # 3
+ print(0b1100 | 0b1010) # Prints 14 (binary 1110)
[/codeblock]
- It's useful to store binary flags in a variable.
+ This is useful for storing binary flags in a variable.
[codeblock]
var flags = 0
- # Turn first and third bit on.
- flags |= 1
- flags |= 4
+ flags |= 0b101 # Turn the first and third bits on.
[/codeblock]
</description>
</operator>
<operator name="operator ~">
<return type="int" />
<description>
- Returns the result of bitwise [code]NOT[/code] operation for the integer. It's effectively equal to [code]-int + 1[/code].
+ Performs the bitwise [code]NOT[/code] operation on the [int]. Due to [url=https://en.wikipedia.org/wiki/Two%27s_complement/]2's complement[/url], it's effectively equal to [code]-(int + 1)[/code].
[codeblock]
- print(~4) # -3
- print(~7) # -6
+ print(~4) # Prints -5
+ print(~(-7)) # Prints 6
[/codeblock]
</description>
</operator>