summaryrefslogtreecommitdiffstats
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/@GlobalScope.xml24
-rw-r--r--doc/classes/AABB.xml2
-rw-r--r--doc/classes/AudioServer.xml10
-rw-r--r--doc/classes/CanvasTexture.xml1
-rw-r--r--doc/classes/CodeEdit.xml52
-rw-r--r--doc/classes/DisplayServer.xml14
-rw-r--r--doc/classes/EditorDebuggerPlugin.xml2
-rw-r--r--doc/classes/EditorExportPlatform.xml8
-rw-r--r--doc/classes/EditorInterface.xml7
-rw-r--r--doc/classes/EditorPlugin.xml11
-rw-r--r--doc/classes/EditorSettings.xml3
-rw-r--r--doc/classes/GraphEdit.xml18
-rw-r--r--doc/classes/GraphElement.xml69
-rw-r--r--doc/classes/GraphNode.xml251
-rw-r--r--doc/classes/Image.xml9
-rw-r--r--doc/classes/Input.xml4
-rw-r--r--doc/classes/ItemList.xml6
-rw-r--r--doc/classes/Joint2D.xml8
-rw-r--r--doc/classes/Joint3D.xml8
-rw-r--r--doc/classes/LightmapGI.xml3
-rw-r--r--doc/classes/Line2D.xml13
-rw-r--r--doc/classes/Node.xml13
-rw-r--r--doc/classes/OS.xml10
-rw-r--r--doc/classes/OccluderInstance3D.xml1
-rw-r--r--doc/classes/PhysicsServer3DRenderingServerHandler.xml32
-rw-r--r--doc/classes/PopupMenu.xml10
-rw-r--r--doc/classes/ProjectSettings.xml24
-rw-r--r--doc/classes/RDShaderSPIRV.xml2
-rw-r--r--doc/classes/Resource.xml16
-rw-r--r--doc/classes/ScrollContainer.xml8
-rw-r--r--doc/classes/SurfaceTool.xml2
-rw-r--r--doc/classes/TileMap.xml35
-rw-r--r--doc/classes/TileSetAtlasSource.xml15
-rw-r--r--doc/classes/Vector2i.xml6
-rw-r--r--doc/classes/Vector3i.xml6
-rw-r--r--doc/classes/Vector4i.xml6
-rw-r--r--doc/classes/Viewport.xml1
-rw-r--r--doc/classes/ViewportTexture.xml2
-rw-r--r--doc/classes/XRInterface.xml3
39 files changed, 455 insertions, 260 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index fa3f6e434e..1b43f13e37 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -1168,11 +1168,13 @@
<return type="Variant" />
<param index="0" name="x" type="Variant" />
<description>
- Returns the same type of [Variant] as [param x], with [code]-1[/code] for negative values, [code]1[/code] for positive values, and [code]0[/code] for zeros. Supported types: [int], [float], [Vector2], [Vector2i], [Vector3], [Vector3i], [Vector4], [Vector4i].
+ Returns the same type of [Variant] as [param x], with [code]-1[/code] for negative values, [code]1[/code] for positive values, and [code]0[/code] for zeros. For [code]nan[/code] values it returns 0.
+ Supported types: [int], [float], [Vector2], [Vector2i], [Vector3], [Vector3i], [Vector4], [Vector4i].
[codeblock]
sign(-6.0) # Returns -1
sign(0.0) # Returns 0
sign(6.0) # Returns 1
+ sign(NAN) # Returns 0
sign(Vector3(-6.0, 0.0, 6.0)) # Returns (-1, 0, 1)
[/codeblock]
@@ -1183,11 +1185,12 @@
<return type="float" />
<param index="0" name="x" type="float" />
<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.
+ 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. For [code]nan[/code] values of [param x] it returns 0.0.
[codeblock]
signf(-6.5) # Returns -1.0
signf(0.0) # Returns 0.0
signf(6.5) # Returns 1.0
+ signf(NAN) # Returns 0.0
[/codeblock]
</description>
</method>
@@ -1364,6 +1367,23 @@
[/codeblock]
</description>
</method>
+ <method name="type_convert">
+ <return type="Variant" />
+ <param index="0" name="variant" type="Variant" />
+ <param index="1" name="type" type="int" />
+ <description>
+ Converts the given [param variant] to the given [param type], using the [enum Variant.Type] values. This method is generous with how it handles types, it can automatically convert between array types, convert numeric [String]s to [int], and converting most things to [String].
+ If the type conversion cannot be done, this method will return the default value for that type, for example converting [Rect2] to [Vector2] will always return [code]Vector2.ZERO[/code]. This method will never show error messages as long as [param type] is a valid Variant type.
+ The returned value is a [Variant], but the data inside and the [enum Variant.Type] will be the same as the requested type.
+ [codeblock]
+ type_convert("Hi!", TYPE_INT) # Returns 0
+ type_convert("123", TYPE_INT) # Returns 123
+ type_convert(123.4, TYPE_INT) # Returns 123
+ type_convert(5, TYPE_VECTOR2) # Returns (0, 0)
+ type_convert("Hi!", TYPE_NIL) # Returns null
+ [/codeblock]
+ </description>
+ </method>
<method name="typeof">
<return type="int" />
<param index="0" name="variable" type="Variant" />
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index 0aa493361d..a803e4f106 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -126,7 +126,7 @@
<return type="Vector3" />
<param index="0" name="dir" type="Vector3" />
<description>
- Returns the support point in a given direction. This is useful for collision detection algorithms.
+ Returns the vertex of the AABB that's the farthest in a given direction. This point is commonly known as the support point in collision detection algorithms.
</description>
</method>
<method name="get_volume" qualifiers="const">
diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml
index 5d3d7a0591..21ad817c6c 100644
--- a/doc/classes/AudioServer.xml
+++ b/doc/classes/AudioServer.xml
@@ -317,7 +317,15 @@
<signals>
<signal name="bus_layout_changed">
<description>
- Emitted when the [AudioBusLayout] changes.
+ Emitted when an audio bus is added, deleted, or moved.
+ </description>
+ </signal>
+ <signal name="bus_renamed">
+ <param index="0" name="bus_index" type="int" />
+ <param index="1" name="old_name" type="StringName" />
+ <param index="2" name="new_name" type="StringName" />
+ <description>
+ Emitted when the audio bus at [param bus_index] is renamed from [param old_name] to [param new_name].
</description>
</signal>
</signals>
diff --git a/doc/classes/CanvasTexture.xml b/doc/classes/CanvasTexture.xml
index df3f8e8125..1b22adb723 100644
--- a/doc/classes/CanvasTexture.xml
+++ b/doc/classes/CanvasTexture.xml
@@ -8,6 +8,7 @@
[b]Note:[/b] [CanvasTexture] cannot be used in 3D rendering. For physically-based materials in 3D, use [BaseMaterial3D] instead.
</description>
<tutorials>
+ <link title="2D Lights and Shadows">$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html</link>
</tutorials>
<members>
<member name="diffuse_texture" type="Texture2D" setter="set_diffuse_texture" getter="get_diffuse_texture">
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml
index 0e829127f2..d9146cf604 100644
--- a/doc/classes/CodeEdit.xml
+++ b/doc/classes/CodeEdit.xml
@@ -137,6 +137,15 @@
Values of [code]-1[/code] convert the entire text.
</description>
</method>
+ <method name="create_code_region">
+ <return type="void" />
+ <description>
+ Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see [method add_comment_delimiter]).
+ A code region is a part of code that is highlighted when folded and can help organize your script.
+ Code region start and end tags can be customized (see [method set_code_region_tags]).
+ Code regions are delimited using start and end tags (respectively [code]region[/code] and [code]endregion[/code] by default) preceded by one line comment delimiter. (eg. [code]#region[/code] and [code]#endregion[/code])
+ </description>
+ </method>
<method name="do_indent">
<return type="void" />
<description>
@@ -200,6 +209,18 @@
Gets the index of the current selected completion option.
</description>
</method>
+ <method name="get_code_region_end_tag" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the code region end tag (without comment delimiter).
+ </description>
+ </method>
+ <method name="get_code_region_start_tag" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the code region start tag (without comment delimiter).
+ </description>
+ </method>
<method name="get_delimiter_end_key" qualifiers="const">
<return type="String" />
<param index="0" name="delimiter_index" type="int" />
@@ -326,6 +347,20 @@
Returns whether the line at the specified index is breakpointed or not.
</description>
</method>
+ <method name="is_line_code_region_end" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="line" type="int" />
+ <description>
+ Returns whether the line at the specified index is a code region end.
+ </description>
+ </method>
+ <method name="is_line_code_region_start" qualifiers="const">
+ <return type="bool" />
+ <param index="0" name="line" type="int" />
+ <description>
+ Returns whether the line at the specified index is a code region start.
+ </description>
+ </method>
<method name="is_line_executing" qualifiers="const">
<return type="bool" />
<param index="0" name="line" type="int" />
@@ -382,6 +417,14 @@
Sets if the code hint should draw below the text.
</description>
</method>
+ <method name="set_code_region_tags">
+ <return type="void" />
+ <param index="0" name="start" type="String" default="&quot;region&quot;" />
+ <param index="1" name="end" type="String" default="&quot;endregion&quot;" />
+ <description>
+ Sets the code region start and end tags (without comment delimiter).
+ </description>
+ </method>
<method name="set_line_as_bookmarked">
<return type="void" />
<param index="0" name="line" type="int" />
@@ -629,6 +672,9 @@
<theme_item name="executing_line_color" data_type="color" type="Color" default="Color(0.98, 0.89, 0.27, 1)">
[Color] of the executing icon for executing lines.
</theme_item>
+ <theme_item name="folded_code_region_color" data_type="color" type="Color" default="Color(0.68, 0.46, 0.77, 0.2)">
+ [Color] of background line highlight for folded code region.
+ </theme_item>
<theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
Sets the font [Color].
</theme_item>
@@ -693,12 +739,18 @@
<theme_item name="can_fold" data_type="icon" type="Texture2D">
Sets a custom [Texture2D] to draw in the line folding gutter when a line can be folded.
</theme_item>
+ <theme_item name="can_fold_code_region" data_type="icon" type="Texture2D">
+ Sets a custom [Texture2D] to draw in the line folding gutter when a code region can be folded.
+ </theme_item>
<theme_item name="executing_line" data_type="icon" type="Texture2D">
Icon to draw in the executing gutter for executing lines.
</theme_item>
<theme_item name="folded" data_type="icon" type="Texture2D">
Sets a custom [Texture2D] to draw in the line folding gutter when a line is folded and can be unfolded.
</theme_item>
+ <theme_item name="folded_code_region" data_type="icon" type="Texture2D">
+ Sets a custom [Texture2D] to draw in the line folding gutter when a code region is folded and can be unfolded.
+ </theme_item>
<theme_item name="folded_eol_icon" data_type="icon" type="Texture2D">
Sets a custom [Texture2D] to draw at the end of a folded line.
</theme_item>
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index c2f81ba109..579d38666d 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -190,7 +190,7 @@
<method name="get_swap_cancel_ok">
<return type="bool" />
<description>
- Returns [code]true[/code] if positions of [b]OK[/b] and [b]Cancel[/b] buttons are swapped in dialogs. This is enabled by default on Windows and UWP to follow interface conventions, and be toggled by changing [member ProjectSettings.gui/common/swap_cancel_ok].
+ Returns [code]true[/code] if positions of [b]OK[/b] and [b]Cancel[/b] buttons are swapped in dialogs. This is enabled by default on Windows to follow interface conventions, and be toggled by changing [member ProjectSettings.gui/common/swap_cancel_ok].
[b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by [method DisplayServer.dialog_show].
</description>
</method>
@@ -1858,16 +1858,16 @@
[b]Note:[/b] This flag is implemented only on macOS.
</constant>
<constant name="VSYNC_DISABLED" value="0" enum="VSyncMode">
- No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (nonwithstanding [member Engine.max_fps]).
+ No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (notwithstanding [member Engine.max_fps]).
</constant>
<constant name="VSYNC_ENABLED" value="1" enum="VSyncMode">
- Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (nonwithstanding [member Engine.max_fps]).
+ Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (notwithstanding [member Engine.max_fps]).
</constant>
<constant name="VSYNC_ADAPTIVE" value="2" enum="VSyncMode">
- Behaves like [constant VSYNC_DISABLED] when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (nonwithstanding [member Engine.max_fps]). Behaves like [constant VSYNC_ENABLED] when using the Compatibility rendering method.
+ Behaves like [constant VSYNC_DISABLED] when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (notwithstanding [member Engine.max_fps]). Behaves like [constant VSYNC_ENABLED] when using the Compatibility rendering method.
</constant>
<constant name="VSYNC_MAILBOX" value="3" enum="VSyncMode">
- Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (nonwithstanding [member Engine.max_fps]).
+ Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (notwithstanding [member Engine.max_fps]).
Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag (also called "Fast" V-Sync mode). [constant VSYNC_MAILBOX] works best when at least twice as many frames as the display refresh rate are rendered. Behaves like [constant VSYNC_ENABLED] when using the Compatibility rendering method.
</constant>
<constant name="DISPLAY_HANDLE" value="0" enum="HandleType">
@@ -1891,9 +1891,9 @@
</constant>
<constant name="OPENGL_CONTEXT" value="3" enum="HandleType">
OpenGL context (only with the GL Compatibility renderer):
- - Windows: [code]HGLRC[/code] for the window.
+ - Windows: [code]HGLRC[/code] for the window (native GL), or [code]EGLContext[/code] for the window (ANGLE).
- Linux: [code]GLXContext*[/code] for the window.
- - macOS: [code]NSOpenGLContext*[/code] for the window.
+ - macOS: [code]NSOpenGLContext*[/code] for the window (native GL), or [code]EGLContext[/code] for the window (ANGLE).
- Android: [code]EGLContext[/code] for the window.
</constant>
<constant name="TTS_UTTERANCE_STARTED" value="0" enum="TTSUtteranceEvent">
diff --git a/doc/classes/EditorDebuggerPlugin.xml b/doc/classes/EditorDebuggerPlugin.xml
index 6f6b4f69e4..4c602b8359 100644
--- a/doc/classes/EditorDebuggerPlugin.xml
+++ b/doc/classes/EditorDebuggerPlugin.xml
@@ -81,7 +81,7 @@
<return type="Array" />
<description>
Returns an array of [EditorDebuggerSession] currently available to this debugger plugin.
- [b]Note:[/b] Not sessions in the array may be inactive, check their state via [method EditorDebuggerSession.is_active]
+ [b]Note:[/b] Sessions in the array may be inactive, check their state via [method EditorDebuggerSession.is_active].
</description>
</method>
</methods>
diff --git a/doc/classes/EditorExportPlatform.xml b/doc/classes/EditorExportPlatform.xml
index ac921a0c80..6801ac672c 100644
--- a/doc/classes/EditorExportPlatform.xml
+++ b/doc/classes/EditorExportPlatform.xml
@@ -10,4 +10,12 @@
<tutorials>
<link title="$DOCS_URL/tutorials/platform/consoles.html">Console support in Godot</link>
</tutorials>
+ <methods>
+ <method name="get_os_name" qualifiers="const">
+ <return type="String" />
+ <description>
+ Returns the name of the export operating system handled by this [EditorExportPlatform] class, as a friendly string. Possible return values are [code]Windows[/code], [code]Linux[/code], [code]macOS[/code], [code]Android[/code], [code]iOS[/code], and [code]Web[/code].
+ </description>
+ </method>
+ </methods>
</class>
diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml
index 3ae4b7f812..64a311d857 100644
--- a/doc/classes/EditorInterface.xml
+++ b/doc/classes/EditorInterface.xml
@@ -109,6 +109,13 @@
Returns the editor's [EditorSettings] instance.
</description>
</method>
+ <method name="get_editor_theme" qualifiers="const">
+ <return type="Theme" />
+ <description>
+ Returns the editor's [Theme].
+ [b]Note:[/b] When creating custom editor UI, prefer accessing theme items directly from your GUI nodes using the [code]get_theme_*[/code] methods.
+ </description>
+ </method>
<method name="get_file_system_dock" qualifiers="const">
<return type="FileSystemDock" />
<description>
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 08f8cf70e9..6f858942aa 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. See also [EditorScript] to add functions to the editor.
+ [b]Note:[/b] Some names in this class contain "left" or "right" (e.g. [constant DOCK_SLOT_LEFT_UL]). These APIs assume left-to-right layout, and would be backwards when using right-to-left layout. These names are kept for compatibility reasons.
</description>
<tutorials>
<link title="Editor plugins documentation index">$DOCS_URL/tutorials/plugins/editor/index.html</link>
@@ -245,7 +246,7 @@
# You can use a custom icon:
return preload("res://addons/my_plugin/my_plugin_icon.svg")
# Or use a built-in icon:
- return EditorInterface.get_base_control().get_theme_icon("Node", "EditorIcons")
+ return EditorInterface.get_editor_theme().get_icon("Node", "EditorIcons")
[/gdscript]
[csharp]
public override Texture2D _GetPluginIcon()
@@ -253,7 +254,7 @@
// You can use a custom icon:
return ResourceLoader.Load&lt;Texture2D&gt;("res://addons/my_plugin/my_plugin_icon.svg");
// Or use a built-in icon:
- return EditorInterface.Singleton.GetBaseControl().GetThemeIcon("Node", "EditorIcons");
+ return EditorInterface.Singleton.GetEditorTheme().GetIcon("Node", "EditorIcons");
}
[/csharp]
[/codeblocks]
@@ -353,7 +354,7 @@
return "My Super Cool Plugin 3000"
func _get_plugin_icon():
- return EditorInterface.get_base_control().get_theme_icon("Node", "EditorIcons")
+ return EditorInterface.get_editor_theme().get_icon("Node", "EditorIcons")
[/codeblock]
</description>
</method>
@@ -824,13 +825,13 @@
Dock slot, left side, bottom-right (in default layout includes FileSystem dock).
</constant>
<constant name="DOCK_SLOT_RIGHT_UL" value="4" enum="DockSlot">
- Dock slot, right side, upper-left (empty in default layout).
+ Dock slot, right side, upper-left (in default layout includes Inspector, Node, and History docks).
</constant>
<constant name="DOCK_SLOT_RIGHT_BL" value="5" enum="DockSlot">
Dock slot, right side, bottom-left (empty in default layout).
</constant>
<constant name="DOCK_SLOT_RIGHT_UR" value="6" enum="DockSlot">
- Dock slot, right side, upper-right (in default layout includes Inspector, Node and History docks).
+ Dock slot, right side, upper-right (empty in default layout).
</constant>
<constant name="DOCK_SLOT_RIGHT_BR" value="7" enum="DockSlot">
Dock slot, right side, bottom-right (empty in default layout).
diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml
index aa3bf3c535..5a0cb9fc5e 100644
--- a/doc/classes/EditorSettings.xml
+++ b/doc/classes/EditorSettings.xml
@@ -959,6 +959,9 @@
<member name="text_editor/theme/highlighting/executing_line_color" type="Color" setter="" getter="">
The script editor's color for the debugger's executing line icon (displayed in the gutter).
</member>
+ <member name="text_editor/theme/highlighting/folded_code_region_color" type="Color" setter="" getter="">
+ The script editor's background line highlighting color for folded code region.
+ </member>
<member name="text_editor/theme/highlighting/function_color" type="Color" setter="" getter="">
The script editor's function call color.
[b]Note:[/b] When using the GDScript syntax highlighter, this is replaced by the function definition color configured in the syntax theme for function definitions (e.g. [code]func _ready():[/code]).
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml
index 0aea0c5727..baa591fd66 100644
--- a/doc/classes/GraphEdit.xml
+++ b/doc/classes/GraphEdit.xml
@@ -26,12 +26,12 @@
<param index="2" name="mouse_position" type="Vector2" />
<description>
Returns whether the [param mouse_position] is in the input hot zone.
- By default, a hot zone is a [Rect2] positioned such that its center is at [param in_node].[method GraphNode.get_connection_input_position]([param in_port]) (For output's case, call [method GraphNode.get_connection_output_position] instead). The hot zone's width is twice the Theme Property [code]port_grab_distance_horizontal[/code], and its height is twice the [code]port_grab_distance_vertical[/code].
+ By default, a hot zone is a [Rect2] positioned such that its center is at [param in_node].[method GraphNode.get_input_port_position]([param in_port]) (For output's case, call [method GraphNode.get_output_port_position] instead). The hot zone's width is twice the Theme Property [code]port_grab_distance_horizontal[/code], and its height is twice the [code]port_grab_distance_vertical[/code].
Below is a sample code to help get started:
[codeblock]
func _is_in_input_hotzone(in_node, in_port, mouse_position):
var port_size: Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
- var port_pos: Vector2 = in_node.get_position() + in_node.get_connection_input_position(in_port) - port_size / 2
+ var port_pos: Vector2 = in_node.get_position() + in_node.get_input_port_position(in_port) - port_size / 2
var rect = Rect2(port_pos, port_size)
return rect.has_point(mouse_position)
@@ -49,7 +49,7 @@
[codeblock]
func _is_in_output_hotzone(in_node, in_port, mouse_position):
var port_size: Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
- var port_pos: Vector2 = in_node.get_position() + in_node.get_connection_output_position(in_port) - port_size / 2
+ var port_pos: Vector2 = in_node.get_position() + in_node.get_output_port_position(in_port) - port_size / 2
var rect = Rect2(port_pos, port_size)
return rect.has_point(mouse_position)
@@ -289,6 +289,12 @@
Emitted at the beginning of a GraphNode movement.
</description>
</signal>
+ <signal name="close_nodes_request">
+ <param index="0" name="nodes" type="StringName[]" />
+ <description>
+ Emitted when attempting to remove a GraphNode from the GraphEdit. Provides a list of node names to be removed (all selected nodes, excluding nodes without closing button).
+ </description>
+ </signal>
<signal name="connection_drag_ended">
<description>
Emitted at the end of a connection drag.
@@ -332,12 +338,6 @@
Emitted when the user presses [kbd]Ctrl + C[/kbd].
</description>
</signal>
- <signal name="delete_nodes_request">
- <param index="0" name="nodes" type="StringName[]" />
- <description>
- Emitted when a GraphNode is attempted to be removed from the GraphEdit. Provides a list of node names to be removed (all selected nodes, excluding nodes without closing button).
- </description>
- </signal>
<signal name="disconnection_request">
<param index="0" name="from_node" type="StringName" />
<param index="1" name="from_port" type="int" />
diff --git a/doc/classes/GraphElement.xml b/doc/classes/GraphElement.xml
new file mode 100644
index 0000000000..6c3b6b727a
--- /dev/null
+++ b/doc/classes/GraphElement.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="GraphElement" inherits="Container" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+ <brief_description>
+ A container that represents a basic element that can be placed inside a [GraphEdit] control.
+ </brief_description>
+ <description>
+ [GraphElement] allows to create custom elements for a [GraphEdit] graph. By default such elements can be selected, resized, and repositioned, but they cannot be connected. For a graph element that allows for connections see [GraphNode].
+ </description>
+ <tutorials>
+ </tutorials>
+ <members>
+ <member name="draggable" type="bool" setter="set_draggable" getter="is_draggable" default="true">
+ If [code]true[/code], the user can drag the GraphElement.
+ </member>
+ <member name="position_offset" type="Vector2" setter="set_position_offset" getter="get_position_offset" default="Vector2(0, 0)">
+ The offset of the GraphElement, relative to the scroll offset of the [GraphEdit].
+ </member>
+ <member name="resizable" type="bool" setter="set_resizable" getter="is_resizable" default="false">
+ If [code]true[/code], the user can resize the GraphElement.
+ [b]Note:[/b] Dragging the handle will only emit the [signal resize_request] signal, the GraphElement needs to be resized manually.
+ </member>
+ <member name="selectable" type="bool" setter="set_selectable" getter="is_selectable" default="true">
+ If [code]true[/code], the user can select the GraphElement.
+ </member>
+ <member name="selected" type="bool" setter="set_selected" getter="is_selected" default="false">
+ If [code]true[/code], the GraphElement is selected.
+ </member>
+ </members>
+ <signals>
+ <signal name="close_request">
+ <description>
+ Emitted when closing the GraphElement is requested.
+ </description>
+ </signal>
+ <signal name="dragged">
+ <param index="0" name="from" type="Vector2" />
+ <param index="1" name="to" type="Vector2" />
+ <description>
+ Emitted when the GraphElement is dragged.
+ </description>
+ </signal>
+ <signal name="node_deselected">
+ <description>
+ Emitted when the GraphElement is deselected.
+ </description>
+ </signal>
+ <signal name="node_selected">
+ <description>
+ Emitted when the GraphElement is selected.
+ </description>
+ </signal>
+ <signal name="position_offset_changed">
+ <description>
+ Emitted when the GraphElement is moved.
+ </description>
+ </signal>
+ <signal name="raise_request">
+ <description>
+ Emitted when displaying the GraphElement over other ones is requested. Happens on focusing (clicking into) the GraphElement.
+ </description>
+ </signal>
+ <signal name="resize_request">
+ <param index="0" name="new_minsize" type="Vector2" />
+ <description>
+ Emitted when resizing the GraphElement is requested. Happens on dragging the resizer handle (see [member resizable]).
+ </description>
+ </signal>
+ </signals>
+</class>
diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml
index d160141842..5d52ea17e2 100644
--- a/doc/classes/GraphNode.xml
+++ b/doc/classes/GraphNode.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="GraphNode" inherits="Container" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="GraphNode" inherits="GraphElement" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A container with connection ports, representing a node in a [GraphEdit].
</brief_description>
@@ -7,153 +7,154 @@
[GraphNode] allows to create nodes for a [GraphEdit] graph with customizable content based on its child controls. [GraphNode] is derived from [Container] and it is responsible for placing its children on screen. This works similar to [VBoxContainer]. Children, in turn, provide [GraphNode] with so-called slots, each of which can have a connection port on either side.
Each [GraphNode] slot is defined by its index and can provide the node with up to two ports: one on the left, and one on the right. By convention the left port is also referred to as the [b]input port[/b] and the right port is referred to as the [b]output port[/b]. Each port can be enabled and configured individually, using different type and color. The type is an arbitrary value that you can define using your own considerations. The parent [GraphEdit] will receive this information on each connect and disconnect request.
Slots can be configured in the Inspector dock once you add at least one child [Control]. The properties are grouped by each slot's index in the "Slot" section.
- [b]Note:[/b] While GraphNode is set up using slots and slot indices, connections are made between the ports which are enabled. Because of that, [GraphEdit] uses the port's index and not the slot's index. You can use [method get_connection_input_slot] and [method get_connection_output_slot] to get the slot index from the port index.
+ [b]Note:[/b] While GraphNode is set up using slots and slot indices, connections are made between the ports which are enabled. Because of that [GraphEdit] uses the port's index and not the slot's index. You can use [method get_input_port_slot] and [method get_output_port_slot] to get the slot index from the port index.
</description>
<tutorials>
</tutorials>
<methods>
+ <method name="_draw_port" qualifiers="virtual">
+ <return type="void" />
+ <param index="0" name="slot_index" type="int" />
+ <param index="1" name="position" type="Vector2i" />
+ <param index="2" name="left" type="bool" />
+ <param index="3" name="color" type="Color" />
+ <description>
+ </description>
+ </method>
<method name="clear_all_slots">
<return type="void" />
<description>
- Disables all input and output slots of the GraphNode.
+ Disables all slots of the GraphNode. This will remove all input/output ports from the GraphNode.
</description>
</method>
<method name="clear_slot">
<return type="void" />
<param index="0" name="slot_index" type="int" />
<description>
- Disables input and output slot whose index is [param slot_index].
+ Disables the slot with the given [param slot_index]. This will remove the corresponding input and output port from the GraphNode.
</description>
</method>
- <method name="get_connection_input_color">
+ <method name="get_input_port_color">
<return type="Color" />
- <param index="0" name="port" type="int" />
+ <param index="0" name="port_idx" type="int" />
<description>
- Returns the [Color] of the input connection [param port].
+ Returns the [Color] of the input port with the given [param port_idx].
</description>
</method>
- <method name="get_connection_input_count">
+ <method name="get_input_port_count">
<return type="int" />
<description>
- Returns the number of enabled input slots (connections) to the GraphNode.
+ Returns the number of slots with an enabled input port.
</description>
</method>
- <method name="get_connection_input_height">
- <return type="int" />
- <param index="0" name="port" type="int" />
- <description>
- Returns the height of the input connection [param port].
- </description>
- </method>
- <method name="get_connection_input_position">
+ <method name="get_input_port_position">
<return type="Vector2" />
- <param index="0" name="port" type="int" />
+ <param index="0" name="port_idx" type="int" />
<description>
- Returns the position of the input connection [param port].
+ Returns the position of the input port with the given [param port_idx].
</description>
</method>
- <method name="get_connection_input_slot">
+ <method name="get_input_port_slot">
<return type="int" />
- <param index="0" name="port" type="int" />
+ <param index="0" name="port_idx" type="int" />
<description>
- Returns the corresponding slot index of the input connection [param port].
+ Returns the corresponding slot index of the input port with the given [param port_idx].
</description>
</method>
- <method name="get_connection_input_type">
+ <method name="get_input_port_type">
<return type="int" />
- <param index="0" name="port" type="int" />
+ <param index="0" name="port_idx" type="int" />
<description>
- Returns the type of the input connection [param port].
+ Returns the type of the input port with the given [param port_idx].
</description>
</method>
- <method name="get_connection_output_color">
+ <method name="get_output_port_color">
<return type="Color" />
- <param index="0" name="port" type="int" />
+ <param index="0" name="port_idx" type="int" />
<description>
- Returns the [Color] of the output connection [param port].
+ Returns the [Color] of the output port with the given [param port_idx].
</description>
</method>
- <method name="get_connection_output_count">
+ <method name="get_output_port_count">
<return type="int" />
<description>
- Returns the number of enabled output slots (connections) of the GraphNode.
+ Returns the number of slots with an enabled output port.
</description>
</method>
- <method name="get_connection_output_height">
- <return type="int" />
- <param index="0" name="port" type="int" />
- <description>
- Returns the height of the output connection [param port].
- </description>
- </method>
- <method name="get_connection_output_position">
+ <method name="get_output_port_position">
<return type="Vector2" />
- <param index="0" name="port" type="int" />
+ <param index="0" name="port_idx" type="int" />
<description>
- Returns the position of the output connection [param port].
+ Returns the position of the output port with the given [param port_idx].
</description>
</method>
- <method name="get_connection_output_slot">
+ <method name="get_output_port_slot">
<return type="int" />
- <param index="0" name="port" type="int" />
+ <param index="0" name="port_idx" type="int" />
<description>
- Returns the corresponding slot index of the output connection [param port].
+ Returns the corresponding slot index of the output port with the given [param port_idx].
</description>
</method>
- <method name="get_connection_output_type">
+ <method name="get_output_port_type">
<return type="int" />
- <param index="0" name="port" type="int" />
+ <param index="0" name="port_idx" type="int" />
<description>
- Returns the type of the output connection [param port].
+ Returns the type of the output port with the given [param port_idx].
</description>
</method>
<method name="get_slot_color_left" qualifiers="const">
<return type="Color" />
<param index="0" name="slot_index" type="int" />
<description>
- Returns the left (input) [Color] of the slot [param slot_index].
+ Returns the left (input) [Color] of the slot with the given [param slot_index].
</description>
</method>
<method name="get_slot_color_right" qualifiers="const">
<return type="Color" />
<param index="0" name="slot_index" type="int" />
<description>
- Returns the right (output) [Color] of the slot [param slot_index].
+ Returns the right (output) [Color] of the slot with the given [param slot_index].
</description>
</method>
<method name="get_slot_type_left" qualifiers="const">
<return type="int" />
<param index="0" name="slot_index" type="int" />
<description>
- Returns the left (input) type of the slot [param slot_index].
+ Returns the left (input) type of the slot with the given [param slot_index].
</description>
</method>
<method name="get_slot_type_right" qualifiers="const">
<return type="int" />
<param index="0" name="slot_index" type="int" />
<description>
- Returns the right (output) type of the slot [param slot_index].
+ Returns the right (output) type of the slot with the given [param slot_index].
+ </description>
+ </method>
+ <method name="get_titlebar_hbox">
+ <return type="HBoxContainer" />
+ <description>
+ Returns the [HBoxContainer] used for the title bar, only containing a [Label] for displaying the title by default. This can be used to add custom controls to the title bar such as option or close buttons.
</description>
</method>
<method name="is_slot_draw_stylebox" qualifiers="const">
<return type="bool" />
<param index="0" name="slot_index" type="int" />
<description>
- Returns true if the background [StyleBox] of the slot [param slot_index] is drawn.
+ Returns true if the background [StyleBox] of the slot with the given [param slot_index] is drawn.
</description>
</method>
<method name="is_slot_enabled_left" qualifiers="const">
<return type="bool" />
<param index="0" name="slot_index" type="int" />
<description>
- Returns [code]true[/code] if left (input) side of the slot [param slot_index] is enabled.
+ Returns [code]true[/code] if left (input) side of the slot with the given [param slot_index] is enabled.
</description>
</method>
<method name="is_slot_enabled_right" qualifiers="const">
<return type="bool" />
<param index="0" name="slot_index" type="int" />
<description>
- Returns [code]true[/code] if right (output) side of the slot [param slot_index] is enabled.
+ Returns [code]true[/code] if right (output) side of the slot with the given [param slot_index] is enabled.
</description>
</method>
<method name="set_slot">
@@ -169,7 +170,7 @@
<param index="8" name="custom_icon_right" type="Texture2D" default="null" />
<param index="9" name="draw_stylebox" type="bool" default="true" />
<description>
- Sets properties of the slot with the [param slot_index] index.
+ Sets properties of the slot with the given [param slot_index].
If [param enable_left_port]/[param enable_right_port] is [code]true[/code], a port will appear and the slot will be able to be connected from this side.
With [param type_left]/[param type_right] an arbitrary type can be assigned to each port. Two ports can be connected if they share the same type, or if the connection between their types is allowed in the parent [GraphEdit] (see [method GraphEdit.add_valid_connection_type]). Keep in mind that the [GraphEdit] has the final say in accepting the connection. Type compatibility simply allows the [signal GraphEdit.connection_request] signal to be emitted.
Ports can be further customized using [param color_left]/[param color_right] and [param custom_icon_left]/[param custom_icon_right]. The color parameter adds a tint to the icon. The custom icon can be used to override the default port dot.
@@ -183,7 +184,7 @@
<param index="0" name="slot_index" type="int" />
<param index="1" name="color" type="Color" />
<description>
- Sets the [Color] of the left (input) side of the slot [param slot_index] to [param color].
+ Sets the [Color] of the left (input) side of the slot with the given [param slot_index] to [param color].
</description>
</method>
<method name="set_slot_color_right">
@@ -191,7 +192,7 @@
<param index="0" name="slot_index" type="int" />
<param index="1" name="color" type="Color" />
<description>
- Sets the [Color] of the right (output) side of the slot [param slot_index] to [param color].
+ Sets the [Color] of the right (output) side of the slot with the given [param slot_index] to [param color].
</description>
</method>
<method name="set_slot_draw_stylebox">
@@ -199,7 +200,7 @@
<param index="0" name="slot_index" type="int" />
<param index="1" name="enable" type="bool" />
<description>
- Toggles the background [StyleBox] of the slot [param slot_index].
+ Toggles the background [StyleBox] of the slot with the given [param slot_index].
</description>
</method>
<method name="set_slot_enabled_left">
@@ -207,7 +208,7 @@
<param index="0" name="slot_index" type="int" />
<param index="1" name="enable" type="bool" />
<description>
- Toggles the left (input) side of the slot [param slot_index]. If [param enable] is [code]true[/code], a port will appear on the left side and the slot will be able to be connected from this side.
+ Toggles the left (input) side of the slot with the given [param slot_index]. If [param enable] is [code]true[/code], a port will appear on the left side and the slot will be able to be connected from this side.
</description>
</method>
<method name="set_slot_enabled_right">
@@ -215,7 +216,7 @@
<param index="0" name="slot_index" type="int" />
<param index="1" name="enable" type="bool" />
<description>
- Toggles the right (output) side of the slot [param slot_index]. If [param enable] is [code]true[/code], a port will appear on the right side and the slot will be able to be connected from this side.
+ Toggles the right (output) side of the slot with the given [param slot_index]. If [param enable] is [code]true[/code], a port will appear on the right side and the slot will be able to be connected from this side.
</description>
</method>
<method name="set_slot_type_left">
@@ -223,7 +224,7 @@
<param index="0" name="slot_index" type="int" />
<param index="1" name="type" type="int" />
<description>
- Sets the left (input) type of the slot [param slot_index] to [param type]. If the value is negative, all connections will be disallowed to be created via user inputs.
+ Sets the left (input) type of the slot with the given [param slot_index] to [param type]. If the value is negative, all connections will be disallowed to be created via user inputs.
</description>
</method>
<method name="set_slot_type_right">
@@ -231,156 +232,54 @@
<param index="0" name="slot_index" type="int" />
<param index="1" name="type" type="int" />
<description>
- Sets the right (output) type of the slot [param slot_index] to [param type]. If the value is negative, all connections will be disallowed to be created via user inputs.
+ Sets the right (output) type of the slot with the given [param slot_index] to [param type]. If the value is negative, all connections will be disallowed to be created via user inputs.
</description>
</method>
</methods>
<members>
- <member name="draggable" type="bool" setter="set_draggable" getter="is_draggable" default="true">
- If [code]true[/code], the user can drag the GraphNode.
- </member>
- <member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
- Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
- </member>
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="0" />
- <member name="overlay" type="int" setter="set_overlay" getter="get_overlay" enum="GraphNode.Overlay" default="0">
- Sets the overlay shown above the GraphNode. See [enum Overlay].
- </member>
- <member name="position_offset" type="Vector2" setter="set_position_offset" getter="get_position_offset" default="Vector2(0, 0)">
- The offset of the GraphNode, relative to the scroll offset of the [GraphEdit].
- [b]Note:[/b] You cannot use position offset directly, as [GraphEdit] is a [Container].
- </member>
- <member name="resizable" type="bool" setter="set_resizable" getter="is_resizable" default="false">
- If [code]true[/code], the user can resize the GraphNode.
- [b]Note:[/b] Dragging the handle will only emit the [signal resize_request] signal, the GraphNode needs to be resized manually.
- </member>
- <member name="selectable" type="bool" setter="set_selectable" getter="is_selectable" default="true">
- If [code]true[/code], the user can select the GraphNode.
- </member>
- <member name="selected" type="bool" setter="set_selected" getter="is_selected" default="false">
- If [code]true[/code], the GraphNode is selected.
- </member>
- <member name="show_close" type="bool" setter="set_show_close_button" getter="is_close_button_visible" default="false">
- If [code]true[/code], the close button will be visible.
- [b]Note:[/b] Pressing it will only emit the [signal close_request] signal, the GraphNode needs to be removed manually.
- </member>
- <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
- Base text writing direction.
- </member>
<member name="title" type="String" setter="set_title" getter="get_title" default="&quot;&quot;">
The text displayed in the GraphNode's title bar.
</member>
</members>
<signals>
- <signal name="close_request">
- <description>
- Emitted when the GraphNode is requested to be closed. Happens on clicking the close button (see [member show_close]).
- </description>
- </signal>
- <signal name="dragged">
- <param index="0" name="from" type="Vector2" />
- <param index="1" name="to" type="Vector2" />
- <description>
- Emitted when the GraphNode is dragged.
- </description>
- </signal>
- <signal name="node_deselected">
- <description>
- Emitted when the GraphNode is deselected.
- </description>
- </signal>
- <signal name="node_selected">
- <description>
- Emitted when the GraphNode is selected.
- </description>
- </signal>
- <signal name="position_offset_changed">
- <description>
- Emitted when the GraphNode is moved.
- </description>
- </signal>
- <signal name="raise_request">
- <description>
- Emitted when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode.
- </description>
- </signal>
- <signal name="resize_request">
- <param index="0" name="new_minsize" type="Vector2" />
- <description>
- Emitted when the GraphNode is requested to be resized. Happens on dragging the resizer handle (see [member resizable]).
- </description>
- </signal>
<signal name="slot_updated">
- <param index="0" name="idx" type="int" />
+ <param index="0" name="slot_index" type="int" />
<description>
Emitted when any GraphNode's slot is updated.
</description>
</signal>
</signals>
- <constants>
- <constant name="OVERLAY_DISABLED" value="0" enum="Overlay">
- No overlay is shown.
- </constant>
- <constant name="OVERLAY_BREAKPOINT" value="1" enum="Overlay">
- Show overlay set in the [theme_item breakpoint] theme property.
- </constant>
- <constant name="OVERLAY_POSITION" value="2" enum="Overlay">
- Show overlay set in the [theme_item position] theme property.
- </constant>
- </constants>
<theme_items>
- <theme_item name="close_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
- The color modulation applied to the close button icon.
- </theme_item>
<theme_item name="resizer_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
The color modulation applied to the resizer icon.
</theme_item>
- <theme_item name="title_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
- Color of the title text.
- </theme_item>
- <theme_item name="close_h_offset" data_type="constant" type="int" default="12">
- </theme_item>
- <theme_item name="close_offset" data_type="constant" type="int" default="22">
- The vertical offset of the close button.
- </theme_item>
- <theme_item name="port_offset" data_type="constant" type="int" default="0">
+ <theme_item name="port_h_offset" data_type="constant" type="int" default="0">
Horizontal offset for the ports.
</theme_item>
<theme_item name="separation" data_type="constant" type="int" default="2">
The vertical distance between ports.
</theme_item>
- <theme_item name="title_h_offset" data_type="constant" type="int" default="0">
- Horizontal offset of the title text.
- </theme_item>
- <theme_item name="title_offset" data_type="constant" type="int" default="26">
- Vertical offset of the title text.
- </theme_item>
- <theme_item name="title_font" data_type="font" type="Font">
- Font used for the title text.
- </theme_item>
- <theme_item name="close" data_type="icon" type="Texture2D">
- The icon for the close button, visible when [member show_close] is enabled.
- </theme_item>
<theme_item name="port" data_type="icon" type="Texture2D">
The icon used for representing ports.
</theme_item>
<theme_item name="resizer" data_type="icon" type="Texture2D">
- The icon used for resizer, visible when [member resizable] is enabled.
- </theme_item>
- <theme_item name="breakpoint" data_type="style" type="StyleBox">
- The background used when [member overlay] is set to [constant OVERLAY_BREAKPOINT].
+ The icon used for the resizer, visible when [member GraphElement.resizable] is enabled.
</theme_item>
- <theme_item name="frame" data_type="style" type="StyleBox">
- The default background for [GraphNode].
+ <theme_item name="panel" data_type="style" type="StyleBox">
+ The default background for the slot area of the [GraphNode].
</theme_item>
- <theme_item name="position" data_type="style" type="StyleBox">
- The background used when [member overlay] is set to [constant OVERLAY_POSITION].
- </theme_item>
- <theme_item name="selected_frame" data_type="style" type="StyleBox">
- The background used when the [GraphNode] is selected.
+ <theme_item name="panel_selected" data_type="style" type="StyleBox">
+ The [StyleBox] used for the slot area when selected.
</theme_item>
<theme_item name="slot" data_type="style" type="StyleBox">
The [StyleBox] used for each slot of the [GraphNode].
</theme_item>
+ <theme_item name="titlebar" data_type="style" type="StyleBox">
+ The [StyleBox] used for the title bar of the [GraphNode].
+ </theme_item>
+ <theme_item name="titlebar_selected" data_type="style" type="StyleBox">
+ The [StyleBox] used for the title bar of the [GraphNode] when it is selected.
+ </theme_item>
</theme_items>
</class>
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index 5f1f9e6c18..2782e877a9 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -201,7 +201,8 @@
<return type="int" enum="Error" />
<param index="0" name="renormalize" type="bool" default="false" />
<description>
- Generates mipmaps for the image. Mipmaps are precalculated lower-resolution copies of the image that are automatically used if the image needs to be scaled down when rendered. They help improve image quality and performance when rendering. This method returns an error if the image is compressed, in a custom format, or if the image's width/height is [code]0[/code].
+ Generates mipmaps for the image. Mipmaps are precalculated lower-resolution copies of the image that are automatically used if the image needs to be scaled down when rendered. They help improve image quality and performance when rendering. This method returns an error if the image is compressed, in a custom format, or if the image's width/height is [code]0[/code]. Enabling [param renormalize] when generating mipmaps for normal textures will make sure all resulting vector values are normalized.
+ It is possible to check if the image has mipmaps by calling [method has_mipmaps] or [method get_mipmap_count].
</description>
</method>
<method name="get_data" qualifiers="const">
@@ -222,6 +223,12 @@
Returns the image's height.
</description>
</method>
+ <method name="get_mipmap_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the number of mipmap levels or 0 if the image has no mipmaps. The largest main level image is not counted as a mipmap level by this method, so if you want to include it you can add 1 to this count.
+ </description>
+ </method>
<method name="get_mipmap_offset" qualifiers="const">
<return type="int" />
<param index="0" name="mipmap" type="int" />
diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml
index a8f0f19256..f39d8788ad 100644
--- a/doc/classes/Input.xml
+++ b/doc/classes/Input.xml
@@ -50,7 +50,7 @@
<description>
Returns the acceleration in m/s² of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
Note this method returns an empty [Vector3] when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer.
- [b]Note:[/b] This method only works on iOS, Android, and UWP. On other platforms, it always returns [constant Vector3.ZERO].
+ [b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_action_raw_strength" qualifiers="const">
@@ -166,7 +166,7 @@
<return type="Vector3" />
<description>
Returns the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
- [b]Note:[/b] This method only works on Android, iOS and UWP. On other platforms, it always returns [constant Vector3.ZERO].
+ [b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_mouse_button_mask" qualifiers="const">
diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml
index f6ad422234..593f41bc70 100644
--- a/doc/classes/ItemList.xml
+++ b/doc/classes/ItemList.xml
@@ -57,6 +57,12 @@
Ensure current selection is visible, adjusting the scroll position as necessary.
</description>
</method>
+ <method name="force_update_list_size">
+ <return type="void" />
+ <description>
+ Forces an update to the list size based on its items. This happens automatically whenever size of the items, or other relevant settings like [member auto_height], change. The method can be used to trigger the update ahead of next drawing pass.
+ </description>
+ </method>
<method name="get_item_at_position" qualifiers="const">
<return type="int" />
<param index="0" name="position" type="Vector2" />
diff --git a/doc/classes/Joint2D.xml b/doc/classes/Joint2D.xml
index 6a43180561..9fb9154827 100644
--- a/doc/classes/Joint2D.xml
+++ b/doc/classes/Joint2D.xml
@@ -8,6 +8,14 @@
</description>
<tutorials>
</tutorials>
+ <methods>
+ <method name="get_rid" qualifiers="const">
+ <return type="RID" />
+ <description>
+ Returns the joint's [RID].
+ </description>
+ </method>
+ </methods>
<members>
<member name="bias" type="float" setter="set_bias" getter="get_bias" default="0.0">
When [member node_a] and [member node_b] move in different directions the [code]bias[/code] controls how fast the joint pulls them back to their original position. The lower the [code]bias[/code] the more the two bodies can pull on the joint.
diff --git a/doc/classes/Joint3D.xml b/doc/classes/Joint3D.xml
index d848bdc0cd..9e0b753701 100644
--- a/doc/classes/Joint3D.xml
+++ b/doc/classes/Joint3D.xml
@@ -9,6 +9,14 @@
<tutorials>
<link title="3D Truck Town Demo">https://godotengine.org/asset-library/asset/524</link>
</tutorials>
+ <methods>
+ <method name="get_rid" qualifiers="const">
+ <return type="RID" />
+ <description>
+ Returns the joint's [RID].
+ </description>
+ </method>
+ </methods>
<members>
<member name="exclude_nodes_from_collision" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" default="true">
If [code]true[/code], the two bodies of the nodes are not able to collide with each other.
diff --git a/doc/classes/LightmapGI.xml b/doc/classes/LightmapGI.xml
index a626c71377..2b2fca7d35 100644
--- a/doc/classes/LightmapGI.xml
+++ b/doc/classes/LightmapGI.xml
@@ -118,6 +118,9 @@
<constant name="BAKE_ERROR_USER_ABORTED" value="8" enum="BakeError">
The user aborted the lightmap baking operation (typically by clicking the [b]Cancel[/b] button in the progress dialog).
</constant>
+ <constant name="BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL" value="9" enum="BakeError">
+ Lightmap baking failed as the maximum texture size is too small to fit some of the meshes marked for baking.
+ </constant>
<constant name="ENVIRONMENT_MODE_DISABLED" value="0" enum="EnvironmentMode">
Ignore environment lighting when baking lightmaps.
</constant>
diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml
index 7e02a520a0..4c444721f4 100644
--- a/doc/classes/Line2D.xml
+++ b/doc/classes/Line2D.xml
@@ -63,16 +63,21 @@
[b]Note:[/b] [Line2D] is not accelerated by batching when being anti-aliased.
</member>
<member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode" default="0">
- The style of the beginning of the polyline. Use [enum LineCapMode] constants.
+ The style of the beginning of the polyline, if [member closed] is [code]false[/code]. Use [enum LineCapMode] constants.
+ </member>
+ <member name="closed" type="bool" setter="set_closed" getter="is_closed" default="false">
+ If [code]true[/code] and the polyline has more than 2 points, the last point and the first one will be connected by a segment.
+ [b]Note:[/b] The shape of the closing segment is not guaranteed to be seamless if a [member width_curve] is provided.
+ [b]Note:[/b] The joint between the closing segment and the first segment is drawn first and it samples the [member gradient] and the [member width_curve] at the beginning. This is an implementation detail that might change in a future version.
</member>
<member name="default_color" type="Color" setter="set_default_color" getter="get_default_color" default="Color(1, 1, 1, 1)">
The color of the polyline. Will not be used if a gradient is set.
</member>
<member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode" default="0">
- The style of the end of the polyline. Use [enum LineCapMode] constants.
+ The style of the end of the polyline, if [member closed] is [code]false[/code]. Use [enum LineCapMode] constants.
</member>
<member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient">
- The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set.
+ The gradient is drawn through the whole line from start to finish. The [member default_color] will not be used if this property is set.
</member>
<member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" enum="Line2D.LineJointMode" default="0">
The style of the connections between segments of the polyline. Use [enum LineJointMode] constants.
@@ -93,7 +98,7 @@
The style to render the [member texture] of the polyline. Use [enum LineTextureMode] constants.
</member>
<member name="width" type="float" setter="set_width" getter="get_width" default="10.0">
- The polyline's width
+ The polyline's width.
</member>
<member name="width_curve" type="Curve" setter="set_curve" getter="get_curve">
The polyline's width curve. The width of the polyline over its length will be equivalent to the value of the width curve over its domain.
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 7510d6bb64..c9c94eff36 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -100,10 +100,10 @@
<return type="void" />
<param index="0" name="event" type="InputEvent" />
<description>
- Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed by [method _input] or any GUI [Control] item. The input event propagates up through the node tree until a node consumes it.
+ Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed by [method _input] or any GUI [Control] item. It is called before [method _unhandled_key_input] and [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it.
It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_shortcut_input].
To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called.
- This method can be used to handle shortcuts.
+ This method can be used to handle shortcuts. For generic GUI events, use [method _input] instead. Gameplay events should usually be handled with either [method _unhandled_input] or [method _unhandled_key_input].
[b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
</description>
</method>
@@ -111,10 +111,10 @@
<return type="void" />
<param index="0" name="event" type="InputEvent" />
<description>
- Called when an [InputEvent] hasn't been consumed by [method _input] or any GUI [Control] item. The input event propagates up through the node tree until a node consumes it.
+ Called when an [InputEvent] hasn't been consumed by [method _input] or any GUI [Control] item. It is called after [method _shortcut_input] and after [method _unhandled_key_input]. The input event propagates up through the node tree until a node consumes it.
It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_input].
To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called.
- For gameplay input, this and [method _unhandled_key_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first.
+ For gameplay input, this method is usually a better fit than [method _input], as GUI events need a higher priority. For keyboard shortcuts, consider using [method _shortcut_input] instead, as it is called before this method. Finally, to handle keyboard events, consider using [method _unhandled_key_input] for performance reasons.
[b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
</description>
</method>
@@ -122,12 +122,11 @@
<return type="void" />
<param index="0" name="event" type="InputEvent" />
<description>
- Called when an [InputEventKey] hasn't been consumed by [method _input] or any GUI [Control] item. The input event propagates up through the node tree until a node consumes it.
+ Called when an [InputEventKey] hasn't been consumed by [method _input] or any GUI [Control] item. It is called after [method _shortcut_input] but before [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it.
It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input].
To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called.
This method can be used to handle Unicode character input with [kbd]Alt[/kbd], [kbd]Alt + Ctrl[/kbd], and [kbd]Alt + Shift[/kbd] modifiers, after shortcuts were handled.
- For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first.
- This method also performs better than [method _unhandled_input], since unrelated events such as [InputEventMouseMotion] are automatically filtered.
+ For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input], as GUI events should be handled first. This method also performs better than [method _unhandled_input], since unrelated events such as [InputEventMouseMotion] are automatically filtered. For shortcuts, consider using [method _shortcut_input] instead.
[b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
</description>
</method>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index d4a6b57c58..2efe47a012 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -298,7 +298,7 @@
<return type="String" />
<description>
Returns the name of the host OS.
- On Windows, this is [code]"Windows"[/code] or [code]"UWP"[/code] if exported on Universal Windows Platform.
+ On Windows, this is [code]"Windows"[/code].
On macOS, this is [code]"macOS"[/code].
On Linux-based operating systems, this is [code]"Linux"[/code].
On BSD-based operating systems, this is [code]"FreeBSD"[/code], [code]"NetBSD"[/code], [code]"OpenBSD"[/code], or [code]"BSD"[/code] as a fallback.
@@ -309,7 +309,7 @@
[codeblocks]
[gdscript]
match OS.get_name():
- "Windows", "UWP":
+ "Windows":
print("Windows")
"macOS":
print("macOS")
@@ -326,7 +326,6 @@
switch (OS.GetName())
{
case "Windows":
- case "UWP":
GD.Print("Windows");
break;
case "macOS":
@@ -370,7 +369,7 @@
<return type="String" />
<description>
Returns the name of the CPU model on the host machine (e.g. "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz").
- [b]Note:[/b] This method is only implemented on Windows, macOS, Linux and iOS. On Android, Web and UWP, [method get_processor_name] returns an empty string.
+ [b]Note:[/b] This method is only implemented on Windows, macOS, Linux and iOS. On Android and Web, [method get_processor_name] returns an empty string.
</description>
</method>
<method name="get_restart_on_exit_arguments" qualifiers="const">
@@ -450,7 +449,7 @@
<description>
Returns a string that is unique to the device.
[b]Note:[/b] This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved before an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by [method get_unique_id] for security purposes.
- [b]Note:[/b] Returns an empty string on Web and UWP, as this method isn't implemented on those platforms yet.
+ [b]Note:[/b] Returns an empty string on Web, as this method isn't implemented on this platform yet.
</description>
</method>
<method name="get_user_data_dir" qualifiers="const">
@@ -473,7 +472,6 @@
For Windows, the major and minor version are returned, as well as the build number. For example, the returned string can look like [code]10.0.9926[/code] for a build of Windows 10, and it can look like [code]6.1.7601[/code] for a build of Windows 7 SP1.
For rolling distributions, such as Arch Linux, an empty string is returned.
For macOS and iOS, the major and minor version are returned, as well as the patch number.
- For UWP, the device family version is returned.
For Android, the SDK version and the incremental build number are returned. If it's a custom ROM, it attempts to return its version instead.
[b]Note:[/b] This method is not supported on the web platform. It returns an empty string.
</description>
diff --git a/doc/classes/OccluderInstance3D.xml b/doc/classes/OccluderInstance3D.xml
index 0dcc34f4d9..1c3477e4b2 100644
--- a/doc/classes/OccluderInstance3D.xml
+++ b/doc/classes/OccluderInstance3D.xml
@@ -9,6 +9,7 @@
The occlusion culling system works by rendering the occluders on the CPU in parallel using [url=https://www.embree.org/]Embree[/url], drawing the result to a low-resolution buffer then using this to cull 3D nodes individually. In the 3D editor, you can preview the occlusion culling buffer by choosing [b]Perspective &gt; Debug Advanced... &gt; Occlusion Culling Buffer[/b] in the top-left corner of the 3D viewport. The occlusion culling buffer quality can be adjusted in the Project Settings.
[b]Baking:[/b] Select an [OccluderInstance3D] node, then use the [b]Bake Occluders[/b] button at the top of the 3D editor. Only opaque materials will be taken into account; transparent materials (alpha-blended or alpha-tested) will be ignored by the occluder generation.
[b]Note:[/b] Occlusion culling is only effective if [member ProjectSettings.rendering/occlusion_culling/use_occlusion_culling] is [code]true[/code]. Enabling occlusion culling has a cost on the CPU. Only enable occlusion culling if you actually plan to use it. Large open scenes with few or no objects blocking the view will generally not benefit much from occlusion culling. Large open scenes generally benefit more from mesh LOD and visibility ranges ([member GeometryInstance3D.visibility_range_begin] and [member GeometryInstance3D.visibility_range_end]) compared to occlusion culling.
+ [b]Note:[/b] Due to memory constraints, occlusion culling is not supported by default in Web export templates. It can be enabled by compiling custom Web export templates with [code]module_raycast_enabled=yes[/code].
</description>
<tutorials>
<link title="Occlusion culling">$DOCS_URL/tutorials/3d/occlusion_culling.html</link>
diff --git a/doc/classes/PhysicsServer3DRenderingServerHandler.xml b/doc/classes/PhysicsServer3DRenderingServerHandler.xml
index da04cd918c..c04dbf2bd7 100644
--- a/doc/classes/PhysicsServer3DRenderingServerHandler.xml
+++ b/doc/classes/PhysicsServer3DRenderingServerHandler.xml
@@ -12,20 +12,48 @@
<return type="void" />
<param index="0" name="aabb" type="AABB" />
<description>
+ Called by the [PhysicsServer3D] to set the bounding box for the [SoftBody3D].
</description>
</method>
<method name="_set_normal" qualifiers="virtual">
<return type="void" />
<param index="0" name="vertex_id" type="int" />
- <param index="1" name="normals" type="const void*" />
+ <param index="1" name="normal" type="Vector3" />
<description>
+ Called by the [PhysicsServer3D] to set the normal for the [SoftBody3D] vertex at the index specified by [param vertex_id].
+ [b]Note:[/b] The [param normal] parameter used to be of type [code]const void*[/code] prior to Godot 4.2.
</description>
</method>
<method name="_set_vertex" qualifiers="virtual">
<return type="void" />
<param index="0" name="vertex_id" type="int" />
- <param index="1" name="vertices" type="const void*" />
+ <param index="1" name="vertex" type="Vector3" />
<description>
+ Called by the [PhysicsServer3D] to set the position for the [SoftBody3D] vertex at the index specified by [param vertex_id].
+ [b]Note:[/b] The [param vertex] parameter used to be of type [code]const void*[/code] prior to Godot 4.2.
+ </description>
+ </method>
+ <method name="set_aabb">
+ <return type="void" />
+ <param index="0" name="aabb" type="AABB" />
+ <description>
+ Sets the bounding box for the [SoftBody3D].
+ </description>
+ </method>
+ <method name="set_normal">
+ <return type="void" />
+ <param index="0" name="vertex_id" type="int" />
+ <param index="1" name="normal" type="Vector3" />
+ <description>
+ Sets the normal for the [SoftBody3D] vertex at the index specified by [param vertex_id].
+ </description>
+ </method>
+ <method name="set_vertex">
+ <return type="void" />
+ <param index="0" name="vertex_id" type="int" />
+ <param index="1" name="vertex" type="Vector3" />
+ <description>
+ Sets the position for the [SoftBody3D] vertex at the index specified by [param vertex_id].
</description>
</method>
</methods>
diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml
index b72e65e63a..c31416b823 100644
--- a/doc/classes/PopupMenu.xml
+++ b/doc/classes/PopupMenu.xml
@@ -13,6 +13,16 @@
<tutorials>
</tutorials>
<methods>
+ <method name="activate_item_by_event">
+ <return type="bool" />
+ <param index="0" name="event" type="InputEvent" />
+ <param index="1" name="for_global_only" type="bool" default="false" />
+ <description>
+ Checks the provided [param event] against the [PopupMenu]'s shortcuts and accelerators, and activates the first item with matching events. If [param for_global_only] is [code]true[/code], only shortcuts and accelerators with [code]global[/code] set to [code]true[/code] will be called.
+ Returns [code]true[/code] if an item was successfully activated.
+ [b]Note:[/b] Certain [Control]s, such as [MenuButton], will call this method automatically.
+ </description>
+ </method>
<method name="add_check_item">
<return type="void" />
<param index="0" name="label" type="String" />
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index d5495ff7dc..b1189eeada 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -247,6 +247,7 @@
<member name="application/boot_splash/image" type="String" setter="" getter="" default="&quot;&quot;">
Path to an image used as the boot splash. If left empty, the default Godot Engine splash will be displayed instead.
[b]Note:[/b] Only effective if [member application/boot_splash/show_image] is [code]true[/code].
+ [b]Note:[/b] The only supported format is PNG. Using another image format will result in an error.
</member>
<member name="application/boot_splash/minimum_display_time" type="int" setter="" getter="" default="0">
Minimum boot splash display time (in milliseconds). It is not recommended to set too high values for this setting.
@@ -399,6 +400,9 @@
<member name="audio/video/video_delay_compensation_ms" type="int" setter="" getter="" default="0">
Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing.
</member>
+ <member name="collada/use_ambient" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], ambient lights will be imported from COLLADA models as [DirectionalLight3D]. If [code]false[/code], ambient lights will be ignored.
+ </member>
<member name="compression/formats/gzip/compression_level" type="int" setter="" getter="" default="-1">
The default compression level for gzip. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. [code]-1[/code] uses the default gzip compression level, which is identical to [code]6[/code] but could change in the future due to underlying zlib updates.
</member>
@@ -492,9 +496,6 @@
<member name="debug/gdscript/warnings/redundant_await" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a function that is not a coroutine is called with await.
</member>
- <member name="debug/gdscript/warnings/redundant_for_variable_type" type="int" setter="" getter="" default="1">
- When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a [code]for[/code] variable type specifier is a supertype of the inferred type.
- </member>
<member name="debug/gdscript/warnings/redundant_static_unload" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when the [code]@static_unload[/code] annotation is used in a script without any static variables.
</member>
@@ -549,6 +550,9 @@
<member name="debug/gdscript/warnings/unsafe_void_return" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when returning a call from a [code]void[/code] function when such call cannot be guaranteed to be also [code]void[/code].
</member>
+ <member name="debug/gdscript/warnings/untyped_declaration" type="int" setter="" getter="" default="0">
+ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a variable or parameter has no static type, or if a function has no static return type.
+ </member>
<member name="debug/gdscript/warnings/unused_local_constant" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a local constant is never used.
</member>
@@ -938,7 +942,7 @@
If [code]true[/code], snaps [Control] node vertices to the nearest pixel to ensure they remain crisp even when the camera moves or zooms.
</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.
+ If [code]true[/code], swaps [b]Cancel[/b] and [b]OK[/b] buttons in dialogs on Windows 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].
</member>
<member name="gui/common/text_edit_undo_stack_max_size" type="int" setter="" getter="" default="1024">
@@ -2113,11 +2117,11 @@
[codeblocks]
[gdscript]
# Set the default gravity strength to 9.8.
- PhysicsServer3D.area_set_param(get_viewport().find_world().space, PhysicsServer3D.AREA_PARAM_GRAVITY, 9.8)
+ PhysicsServer3D.area_set_param(get_viewport().find_world_3d().space, PhysicsServer3D.AREA_PARAM_GRAVITY, 9.8)
[/gdscript]
[csharp]
// Set the default gravity strength to 9.8.
- PhysicsServer3D.AreaSetParam(GetViewport().FindWorld().Space, PhysicsServer3D.AreaParameter.Gravity, 9.8);
+ PhysicsServer3D.AreaSetParam(GetViewport().FindWorld3D().Space, PhysicsServer3D.AreaParameter.Gravity, 9.8);
[/csharp]
[/codeblocks]
</member>
@@ -2127,11 +2131,11 @@
[codeblocks]
[gdscript]
# Set the default gravity direction to `Vector3(0, -1, 0)`.
- PhysicsServer3D.area_set_param(get_viewport().find_world().get_space(), PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, Vector3.DOWN)
+ PhysicsServer3D.area_set_param(get_viewport().find_world_3d().space, PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, Vector3.DOWN)
[/gdscript]
[csharp]
// Set the default gravity direction to `Vector3(0, -1, 0)`.
- PhysicsServer3D.AreaSetParam(GetViewport().FindWorld().Space, PhysicsServer3D.AreaParameter.GravityVector, Vector3.Down)
+ PhysicsServer3D.AreaSetParam(GetViewport().FindWorld3D().Space, PhysicsServer3D.AreaParameter.GravityVector, Vector3.Down)
[/csharp]
[/codeblocks]
</member>
@@ -2517,6 +2521,7 @@
<member name="rendering/occlusion_culling/use_occlusion_culling" type="bool" setter="" getter="" default="false">
If [code]true[/code], [OccluderInstance3D] nodes will be usable for occlusion culling in 3D in the root viewport. In custom viewports, [member Viewport.use_occlusion_culling] must be set to [code]true[/code] instead.
[b]Note:[/b] Enabling occlusion culling has a cost on the CPU. Only enable occlusion culling if you actually plan to use it. Large open scenes with few or no objects blocking the view will generally not benefit much from occlusion culling. Large open scenes generally benefit more from mesh LOD and visibility ranges ([member GeometryInstance3D.visibility_range_begin] and [member GeometryInstance3D.visibility_range_end]) compared to occlusion culling.
+ [b]Note:[/b] Due to memory constraints, occlusion culling is not supported by default in Web export templates. It can be enabled by compiling custom Web export templates with [code]module_raycast_enabled=yes[/code].
</member>
<member name="rendering/reflections/reflection_atlas/reflection_count" type="int" setter="" getter="" default="64">
Number of cubemaps to store in the reflection atlas. The number of [ReflectionProbe]s in a scene will be limited by this amount. A higher number requires more VRAM.
@@ -2706,6 +2711,9 @@
<member name="xr/openxr/enabled" type="bool" setter="" getter="" default="false">
If [code]true[/code] Godot will setup and initialize OpenXR on startup.
</member>
+ <member name="xr/openxr/environment_blend_mode" type="int" setter="" getter="" default="&quot;0&quot;">
+ Specify how OpenXR should blend in the environment. This is specific to certain AR and passthrough devices where camera images are blended in by the XR compositor.
+ </member>
<member name="xr/openxr/form_factor" type="int" setter="" getter="" default="&quot;0&quot;">
Specify whether OpenXR should be configured for an HMD or a hand held device.
</member>
diff --git a/doc/classes/RDShaderSPIRV.xml b/doc/classes/RDShaderSPIRV.xml
index de7c1a4ca7..dd8a292c61 100644
--- a/doc/classes/RDShaderSPIRV.xml
+++ b/doc/classes/RDShaderSPIRV.xml
@@ -4,7 +4,7 @@
SPIR-V intermediate representation as part of a [RDShaderFile] (used by [RenderingDevice]).
</brief_description>
<description>
- [RDShaderSPIRV] represents a [RDShaderFile]'s [url=https://www.khronos.org/spir/]SPIR-V[/url] code for various shader stages, as well as possible compilation error messages. SPIR-V a low-level intermediate shader representation. This intermediate representation is not used directly by GPUs for rendering, but it can be compiled into binary shaders that GPUs can understand. Unlike compiled shaders, SPIR-V is portable across GPU models and driver versions.
+ [RDShaderSPIRV] represents a [RDShaderFile]'s [url=https://www.khronos.org/spir/]SPIR-V[/url] code for various shader stages, as well as possible compilation error messages. SPIR-V is a low-level intermediate shader representation. This intermediate representation is not used directly by GPUs for rendering, but it can be compiled into binary shaders that GPUs can understand. Unlike compiled shaders, SPIR-V is portable across GPU models and driver versions.
This object is used by [RenderingDevice].
</description>
<tutorials>
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index 2a2239f660..be04ebd893 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -55,23 +55,11 @@
Returns the [RID] of this resource (or an empty RID). Many resources (such as [Texture2D], [Mesh], and so on) are high-level abstractions of resources stored in a specialized server ([DisplayServer], [RenderingServer], etc.), so this function will return the original [RID].
</description>
</method>
- <method name="setup_local_to_scene">
+ <method name="setup_local_to_scene" is_deprecated="true">
<return type="void" />
<description>
Emits the [signal setup_local_to_scene_requested] signal. If [member resource_local_to_scene] is set to [code]true[/code], this method is called from [method PackedScene.instantiate] by the newly duplicated resource within the scene instance.
For most resources, this method performs no logic of its own. Custom behavior can be defined by connecting [signal setup_local_to_scene_requested] from a script, [b]not[/b] by overriding this method.
- [b]Example:[/b] Assign a random value to [code]health[/code] for every duplicated Resource from an instantiated scene, excluding the original.
- [codeblock]
- extends Resource
-
- var health = 0
-
- func _init():
- setup_local_to_scene_requested.connect(randomize_health)
-
- func randomize_health():
- health = randi_range(10, 40)
- [/codeblock]
</description>
</method>
<method name="take_over_path">
@@ -104,7 +92,7 @@
</signal>
<signal name="setup_local_to_scene_requested">
<description>
- Emitted when [method setup_local_to_scene] is called, usually by a newly duplicated resource with [member resource_local_to_scene] set to [code]true[/code]. Custom behavior can be defined by connecting this signal.
+ Emitted by the newly duplicated resource with [member resource_local_to_scene] set to [code]true[/code], when the scene is instantiated. Custom behavior can be defined by connecting this signal.
</description>
</signal>
</signals>
diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml
index 15a2f2cabf..2181194fd4 100644
--- a/doc/classes/ScrollContainer.xml
+++ b/doc/classes/ScrollContainer.xml
@@ -50,7 +50,7 @@
Deadzone for touch scrolling. Lower deadzone makes the scrolling more sensitive.
</member>
<member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0">
- The current horizontal scroll value.
+ The current horizontal scroll value.
[b]Note:[/b] If you are setting this value in the [method Node._ready] function or earlier, it needs to be wrapped with [method Object.set_deferred], since scroll bar's [member Range.max_value] is not initialized yet.
[codeblock]
func _ready():
@@ -78,12 +78,14 @@
<signals>
<signal name="scroll_ended">
<description>
- Emitted when scrolling stops.
+ Emitted when scrolling stops when dragging the scrollable area [i]with a touch event[/i]. This signal is [i]not[/i] emitted when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
+ [b]Note:[/b] This signal is only emitted on Android or iOS, or on desktop/web platforms when [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] is enabled.
</description>
</signal>
<signal name="scroll_started">
<description>
- Emitted when scrolling is started.
+ Emitted when scrolling starts when dragging the scrollable area w[i]ith a touch event[/i]. This signal is [i]not[/i] emitted when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
+ [b]Note:[/b] This signal is only emitted on Android or iOS, or on desktop/web platforms when [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] is enabled.
</description>
</signal>
</signals>
diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml
index 494f41422f..5562342eac 100644
--- a/doc/classes/SurfaceTool.xml
+++ b/doc/classes/SurfaceTool.xml
@@ -119,7 +119,7 @@
Removes the index array by expanding the vertex array.
</description>
</method>
- <method name="generate_lod">
+ <method name="generate_lod" is_deprecated="true">
<return type="PackedInt32Array" />
<param index="0" name="nd_threshold" type="float" />
<param index="1" name="target_index_count" type="int" default="3" />
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index 3eac11792f..d699121557 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -5,6 +5,8 @@
</brief_description>
<description>
Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles which are used to create grid-based maps. A TileMap may have several layers, layouting tiles on top of each other.
+ For performance reasons, all TileMap updates are batched at the end of a frame. Notably, this means that scene tiles from a [TileSetScenesCollectionSource] may be initialized after their parent.
+ To force an update earlier on, call [method update_internals].
</description>
<tutorials>
<link title="Using Tilemaps">$DOCS_URL/tutorials/2d/using_tilemaps.html</link>
@@ -25,7 +27,7 @@
Called with a TileData object about to be used internally by the TileMap, allowing its modification at runtime.
This method is only called if [method _use_tile_data_runtime_update] is implemented and returns [code]true[/code] for the given tile [param coords] and [param layer].
[b]Warning:[/b] The [param tile_data] object's sub-resources are the same as the one in the TileSet. Modifying them might impact the whole TileSet. Instead, make sure to duplicate those resources.
- [b]Note:[/b] If the properties of [param tile_data] object should change over time, use [method force_update] to trigger a TileMap update.
+ [b]Note:[/b] If the properties of [param tile_data] object should change over time, use [method notify_runtime_tile_data_update] to notify the TileMap it needs an update.
</description>
</method>
<method name="_use_tile_data_runtime_update" qualifiers="virtual">
@@ -35,6 +37,7 @@
<description>
Should return [code]true[/code] if the tile at coordinates [param coords] on layer [param layer] requires a runtime update.
[b]Warning:[/b] Make sure this function only return [code]true[/code] when needed. Any tile processed at runtime without a need for it will imply a significant performance penalty.
+ [b]Note:[/b] If the result of this function should changed, use [method notify_runtime_tile_data_update] to notify the TileMap it needs an update.
</description>
</method>
<method name="add_layer">
@@ -73,13 +76,11 @@
Clears cells that do not exist in the tileset.
</description>
</method>
- <method name="force_update">
+ <method name="force_update" is_deprecated="true">
<return type="void" />
<param index="0" name="layer" type="int" default="-1" />
<description>
- Triggers an update of the TileMap. If [param layer] is provided and is positive, only updates the given layer.
- [b]Note:[/b] The TileMap node updates automatically when one of its properties is modified. A manual update is only needed if runtime modifications (implemented in [method _tile_data_runtime_update]) need to be applied.
- [b]Warning:[/b] Updating the TileMap is computationally expensive and may impact performance. Try to limit the number of updates and the tiles they impact (by placing frequently updated tiles in a dedicated layer for example).
+ [i]Deprecated.[/i] See [method notify_runtime_tile_data_update] and [method update_internals].
</description>
</method>
<method name="get_cell_alternative_tile" qualifiers="const">
@@ -301,6 +302,16 @@
Moves the layer at index [param layer] to the given position [param to_position] in the array.
</description>
</method>
+ <method name="notify_runtime_tile_data_update">
+ <return type="void" />
+ <param index="0" name="layer" type="int" default="-1" />
+ <description>
+ Notifies the TileMap node that calls to [method _use_tile_data_runtime_update] or [method _tile_data_runtime_update] will lead to different results. This will thus trigger a TileMap update.
+ If [param layer] is provided, only notifies changes for the given layer. Providing the [param layer] argument (when applicable) is usually preferred for performance reasons.
+ [b]Warning:[/b] Updating the TileMap is computationally expensive and may impact performance. Try to limit the number of calls to this function to avoid unnecessary update.
+ [b]Note:[/b] This does not trigger a direct update of the TileMap, the update will be done at the end of the frame as usual (unless you call [method update_internals]).
+ </description>
+ </method>
<method name="remove_layer">
<return type="void" />
<param index="0" name="layer" type="int" />
@@ -437,11 +448,16 @@
If [param layer] is negative, the layers are accessed from the last one.
</description>
</method>
+ <method name="update_internals">
+ <return type="void" />
+ <description>
+ Triggers a direct update of the TileMap. Usually, calling this function is not needed, as TileMap node updates automatically when one of its properties or cells is modified.
+ However, for performance reasons, those updates are batched and delayed to the end of the frame. Calling this function will force the TileMap to update right away instead.
+ [b]Warning:[/b] Updating the TileMap is computationally expensive and may impact performance. Try to limit the number of updates and how many tiles they impact.
+ </description>
+ </method>
</methods>
<members>
- <member name="cell_quadrant_size" type="int" setter="set_quadrant_size" getter="get_quadrant_size" default="16">
- The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size.
- </member>
<member name="collision_animatable" type="bool" setter="set_collision_animatable" getter="is_collision_animatable" default="false">
If enabled, the TileMap will see its collisions synced to the physics tick and change its collision type from static to kinematic. This is required to create TileMap-based moving platform.
[b]Note:[/b] Enabling [member collision_animatable] may have a small performance impact, only do it if the TileMap is moving and has colliding tiles.
@@ -452,6 +468,9 @@
<member name="navigation_visibility_mode" type="int" setter="set_navigation_visibility_mode" getter="get_navigation_visibility_mode" enum="TileMap.VisibilityMode" default="0">
Show or hide the TileMap's navigation meshes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show navigation debug settings.
</member>
+ <member name="rendering_quadrant_size" type="int" setter="set_rendering_quadrant_size" getter="get_rendering_quadrant_size" default="16">
+ The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size.
+ </member>
<member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset">
The assigned [TileSet].
</member>
diff --git a/doc/classes/TileSetAtlasSource.xml b/doc/classes/TileSetAtlasSource.xml
index 1623cd87ee..f478f37500 100644
--- a/doc/classes/TileSetAtlasSource.xml
+++ b/doc/classes/TileSetAtlasSource.xml
@@ -287,5 +287,20 @@
<constant name="TILE_ANIMATION_MODE_MAX" value="2" enum="TileAnimationMode">
Represents the size of the [enum TileAnimationMode] enum.
</constant>
+ <constant name="TRANSFORM_FLIP_H" value="4096">
+ Represents cell's horizontal flip flag. Should be used directly with [TileMap] to flip placed tiles by altering their alternative IDs.
+ [codeblock]
+ var alternate_id = $TileMap.get_cell_alternative_tile(0, Vector2i(2, 2))
+ if not alternate_id &amp; TileSetAtlasSource.TRANSFORM_FLIP_H:
+ # If tile is not already flipped, flip it.
+ $TileMap.set_cell(0, Vector2i(2, 2), source_id, atlas_coords, alternate_id | TileSetAtlasSource.TRANSFORM_FLIP_H)
+ [/codeblock]
+ </constant>
+ <constant name="TRANSFORM_FLIP_V" value="8192">
+ Represents cell's vertical flip flag. See [constant TRANSFORM_FLIP_H] for usage.
+ </constant>
+ <constant name="TRANSFORM_TRANSPOSE" value="16384">
+ Represents cell's transposed flag. See [constant TRANSFORM_FLIP_H] for usage.
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml
index ccb5bb7815..2100cd7612 100644
--- a/doc/classes/Vector2i.xml
+++ b/doc/classes/Vector2i.xml
@@ -124,6 +124,12 @@
<constant name="ONE" value="Vector2i(1, 1)">
One vector, a vector with all components set to [code]1[/code].
</constant>
+ <constant name="MIN" value="Vector2i(-2147483648, -2147483648)">
+ Min vector, a vector with all components equal to [code]INT32_MIN[/code]. Can be used as a negative integer equivalent of [constant Vector2.INF].
+ </constant>
+ <constant name="MAX" value="Vector2i(2147483647, 2147483647)">
+ Max vector, a vector with all components equal to [code]INT32_MAX[/code]. Can be used as an integer equivalent of [constant Vector2.INF].
+ </constant>
<constant name="LEFT" value="Vector2i(-1, 0)">
Left unit vector. Represents the direction of left.
</constant>
diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml
index 90cb70f347..8906bf0aa7 100644
--- a/doc/classes/Vector3i.xml
+++ b/doc/classes/Vector3i.xml
@@ -125,6 +125,12 @@
<constant name="ONE" value="Vector3i(1, 1, 1)">
One vector, a vector with all components set to [code]1[/code].
</constant>
+ <constant name="MIN" value="Vector3i(-2147483648, -2147483648, -2147483648)">
+ Min vector, a vector with all components equal to [code]INT32_MIN[/code]. Can be used as a negative integer equivalent of [constant Vector3.INF].
+ </constant>
+ <constant name="MAX" value="Vector3i(2147483647, 2147483647, 2147483647)">
+ Max vector, a vector with all components equal to [code]INT32_MAX[/code]. Can be used as an integer equivalent of [constant Vector3.INF].
+ </constant>
<constant name="LEFT" value="Vector3i(-1, 0, 0)">
Left unit vector. Represents the local direction of left, and the global direction of west.
</constant>
diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml
index f2eb353b5a..a612c135dd 100644
--- a/doc/classes/Vector4i.xml
+++ b/doc/classes/Vector4i.xml
@@ -129,6 +129,12 @@
<constant name="ONE" value="Vector4i(1, 1, 1, 1)">
One vector, a vector with all components set to [code]1[/code].
</constant>
+ <constant name="MIN" value="Vector4i(-2147483648, -2147483648, -2147483648, -2147483648)">
+ Min vector, a vector with all components equal to [code]INT32_MIN[/code]. Can be used as a negative integer equivalent of [constant Vector4.INF].
+ </constant>
+ <constant name="MAX" value="Vector4i(2147483647, 2147483647, 2147483647, 2147483647)">
+ Max vector, a vector with all components equal to [code]INT32_MAX[/code]. Can be used as an integer equivalent of [constant Vector4.INF].
+ </constant>
</constants>
<operators>
<operator name="operator !=">
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 43640916f4..413d9462fe 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -364,6 +364,7 @@
<member name="use_occlusion_culling" type="bool" setter="set_use_occlusion_culling" getter="is_using_occlusion_culling" default="false">
If [code]true[/code], [OccluderInstance3D] nodes will be usable for occlusion culling in 3D for this viewport. For the root viewport, [member ProjectSettings.rendering/occlusion_culling/use_occlusion_culling] must be set to [code]true[/code] instead.
[b]Note:[/b] Enabling occlusion culling has a cost on the CPU. Only enable occlusion culling if you actually plan to use it, and think whether your scene can actually benefit from occlusion culling. Large, open scenes with few or no objects blocking the view will generally not benefit much from occlusion culling. Large open scenes generally benefit more from mesh LOD and visibility ranges ([member GeometryInstance3D.visibility_range_begin] and [member GeometryInstance3D.visibility_range_end]) compared to occlusion culling.
+ [b]Note:[/b] Due to memory constraints, occlusion culling is not supported by default in Web export templates. It can be enabled by compiling custom Web export templates with [code]module_raycast_enabled=yes[/code].
</member>
<member name="use_taa" type="bool" setter="set_use_taa" getter="is_using_taa" default="false">
Enables Temporal Anti-Aliasing for this viewport. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion.
diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml
index ede9688ea8..e12933d64b 100644
--- a/doc/classes/ViewportTexture.xml
+++ b/doc/classes/ViewportTexture.xml
@@ -6,7 +6,7 @@
<description>
Provides the content of a [Viewport] as a dynamic [Texture2D]. This can be used to mix controls, 2D game objects, and 3D game objects in the same scene.
To create a [ViewportTexture] in code, use the [method Viewport.get_texture] method on the target viewport.
- [b]Note:[/b] When local to scene, this texture uses [method Resource.setup_local_to_scene] to set the proxy texture and flags in the local viewport. Local to scene [ViewportTexture]s will return incorrect data until the scene root is ready (see [signal Node.ready]).
+ [b]Note:[/b] A [ViewportTexture] is always local to its scene (see [member Resource.resource_local_to_scene]). If the scene root is not ready, it may return incorrect data (see [signal Node.ready]).
</description>
<tutorials>
<link title="GUI in 3D Demo">https://godotengine.org/asset-library/asset/127</link>
diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml
index 7b741b43d8..99d6e67e51 100644
--- a/doc/classes/XRInterface.xml
+++ b/doc/classes/XRInterface.xml
@@ -188,6 +188,9 @@
<member name="ar_is_anchor_detection_enabled" type="bool" setter="set_anchor_detection_is_enabled" getter="get_anchor_detection_is_enabled" default="false">
On an AR interface, [code]true[/code] if anchor detection is enabled.
</member>
+ <member name="environment_blend_mode" type="int" setter="set_environment_blend_mode" getter="get_environment_blend_mode" enum="XRInterface.EnvironmentBlendMode" default="0">
+ Specify how XR should blend in the environment. This is specific to certain AR and passthrough devices where camera images are blended in by the XR compositor.
+ </member>
<member name="interface_is_primary" type="bool" setter="set_primary" getter="is_primary" default="false">
[code]true[/code] if this is the primary interface.
</member>