summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/@GlobalScope.xml6
-rw-r--r--doc/classes/CanvasItem.xml4
-rw-r--r--doc/classes/CanvasLayer.xml11
-rw-r--r--doc/classes/Color.xml33
-rw-r--r--doc/classes/DisplayServer.xml13
-rw-r--r--doc/classes/EditorPlugin.xml6
-rw-r--r--doc/classes/Image.xml9
-rw-r--r--doc/classes/InputEventMouse.xml6
-rw-r--r--doc/classes/JavaScript.xml22
-rw-r--r--doc/classes/Mesh.xml2
-rw-r--r--doc/classes/MultiplayerAPI.xml6
-rw-r--r--doc/classes/MultiplayerReplicator.xml191
-rw-r--r--doc/classes/MultiplayerSpawner.xml47
-rw-r--r--doc/classes/MultiplayerSynchronizer.xml17
-rw-r--r--doc/classes/Node.xml30
-rw-r--r--doc/classes/Panel.xml10
-rw-r--r--doc/classes/PopupMenu.xml7
-rw-r--r--doc/classes/ProjectSettings.xml2
-rw-r--r--doc/classes/RID.xml6
-rw-r--r--doc/classes/RenderingServer.xml2
-rw-r--r--doc/classes/SceneReplicationConfig.xml61
-rw-r--r--doc/classes/String.xml16
-rw-r--r--doc/classes/StringName.xml24
-rw-r--r--doc/classes/TextureButton.xml10
-rw-r--r--doc/classes/Theme.xml200
-rw-r--r--doc/classes/TranslationServer.xml7
-rw-r--r--doc/classes/Tree.xml1
-rw-r--r--doc/classes/Vector2i.xml10
-rw-r--r--doc/classes/Vector3i.xml11
-rw-r--r--doc/classes/Viewport.xml4
-rw-r--r--doc/classes/VisualShaderNode.xml2
-rw-r--r--doc/classes/VisualShaderNodeParticleRandomness.xml10
-rw-r--r--doc/classes/Window.xml5
-rw-r--r--doc/classes/bool.xml2
-rw-r--r--doc/classes/float.xml12
-rw-r--r--doc/classes/int.xml7
36 files changed, 477 insertions, 335 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index d8c9ca08e8..4c0f89f14d 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -1267,6 +1267,12 @@
<constant name="INLINE_ALIGNMENT_BOTTOM" value="14" enum="InlineAlignment">
Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equivalent to [code]INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM[/code].
</constant>
+ <constant name="INLINE_ALIGNMENT_IMAGE_MASK" value="3" enum="InlineAlignment">
+ A bit mask for [code]INLINE_ALIGNMENT_*_TO[/code] alignment constants.
+ </constant>
+ <constant name="INLINE_ALIGNMENT_TEXT_MASK" value="12" enum="InlineAlignment">
+ A bit mask for [code]INLINE_ALIGNMENT_TO_*[/code] alignment constants.
+ </constant>
<constant name="KEY_SPECIAL" value="16777216" enum="Key">
Keycodes with this bit applied are non-printable.
</constant>
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 44845947b1..16aa7309cc 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -334,7 +334,7 @@
<method name="get_global_mouse_position" qualifiers="const">
<return type="Vector2" />
<description>
- Returns the global position of the mouse.
+ Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is in using the coordinate system of the [CanvasLayer].
</description>
</method>
<method name="get_global_transform" qualifiers="const">
@@ -352,7 +352,7 @@
<method name="get_local_mouse_position" qualifiers="const">
<return type="Vector2" />
<description>
- Returns the mouse position relative to this item's position.
+ Returns the mouse's position in this [CanvasItem] using the local coordinate system of this [CanvasItem].
</description>
</method>
<method name="get_transform" qualifiers="const">
diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml
index 9ee5ce0dcb..614bd558e8 100644
--- a/doc/classes/CanvasLayer.xml
+++ b/doc/classes/CanvasLayer.xml
@@ -44,5 +44,16 @@
<member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, 1, 0, 0)">
The layer's transform.
</member>
+ <member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true">
+ If [code]false[/code], any [CanvasItem] under this [CanvasLayer] will be hidden.
+ Unlike [member CanvasItem.visible], visibility of a [CanvasLayer] isn't propagated to underlying layers.
+ </member>
</members>
+ <signals>
+ <signal name="visibility_changed">
+ <description>
+ Emitted when visibility of the layer is changed. See [member visible].
+ </description>
+ </signal>
+ </signals>
</class>
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index f3fcd90f51..4e73d4d9d8 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -218,12 +218,45 @@
<return type="Color" />
<argument index="0" name="rgba" type="String" />
<description>
+ Returns a new color from [code]rgba[/code], an HTML hexadecimal color string. [code]rgba[/code] is not case sensitive, and may be prefixed with a '#' character.
+ [code]rgba[/code] must be a valid three-digit or six-digit hexadecimal color string, and may contain an alpha channel value. If [code]rgba[/code] does not contain an alpha channel value, an alpha channel value of 1.0 is applied.
+ If [code]rgba[/code] is invalid a Color(0.0, 0.0, 0.0, 1.0) is returned.
+ [codeblocks]
+ [gdscript]
+ var green = Color.html("#00FF00FF") # set green to Color(0.0, 1.0, 0.0, 1.0)
+ var blue = Color.html("#0000FF") # set blue to Color(0.0, 0.0, 1.0, 1.0)
+ [/gdscript]
+ [csharp]
+ var green = Color.Html("#00FF00FF"); // set green to Color(0.0, 1.0, 0.0, 1.0)
+ var blue = Color.Html("#0000FF"); // set blue to Color(0.0, 0.0, 1.0, 1.0)
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="html_is_valid" qualifiers="static">
<return type="bool" />
<argument index="0" name="color" type="String" />
<description>
+ Returns [code]true[/code] if [code]color[/code] is a valid HTML hexadecimal color string. [code]color[/code] is not case sensitive, and may be prefixed with a '#' character.
+ For a string to be valid it must be three-digit or six-digit hexadecimal, and may contain an alpha channel value.
+ [codeblocks]
+ [gdscript]
+ var result = Color.html_is_valid("#55aaFF") # result is true
+ result = Color.html_is_valid("#55AAFF20") # result is true
+ result = Color.html_is_valid("55AAFF") # result is true
+ result = Color.html_is_valid("#F2C") # result is true
+ result = Color.html_is_valid("#AABBC) # result is false
+ result = Color.html_is_valid("#55aaFF5") # result is false
+ [/gdscript]
+ [csharp]
+ var result = Color.HtmlIsValid("#55AAFF"); // result is true
+ result = Color.HtmlIsValid("#55AAFF20"); // result is true
+ result = Color.HtmlIsValid("55AAFF); // result is true
+ result = Color.HtmlIsValid("#F2C"); // result is true
+ result = Color.HtmlIsValid("#AABBC"); // result is false
+ result = Color.HtmlIsValid("#55aaFF5"); // result is false
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="inverted" qualifiers="const">
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 8be944b105..281c218d0d 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -399,6 +399,14 @@
<description>
</description>
</method>
+ <method name="screen_get_refresh_rate" qualifiers="const">
+ <return type="float" />
+ <argument index="0" name="screen" type="int" default="-1" />
+ <description>
+ Returns the current refresh rate of the specified screen. If [code]screen[/code] is [code]SCREEN_OF_MAIN_WINDOW[/code] (the default value), a screen with the main window will be used.
+ [b]Note:[/b] Returns [code]60.0[/code] if the DisplayServer fails to find the refresh rate for the specified screen. On HTML5, [method screen_get_refresh_rate] will always return [code]60.0[/code] as there is no way to retrieve the refresh rate on that platform.
+ </description>
+ </method>
<method name="screen_get_scale" qualifiers="const">
<return type="float" />
<argument index="0" name="screen" type="int" default="-1" />
@@ -900,6 +908,11 @@
Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
</constant>
+ <constant name="WINDOW_MODE_EXCLUSIVE_FULLSCREEN" value="4" enum="WindowMode">
+ Exclusive fullscreen window mode. This mode is implemented on Windows only. On other platforms, it is equivalent to [constant WINDOW_MODE_FULLSCREEN].
+ Only one window in exclusive fullscreen mode can be visible on a given screen at a time. If multiple windows are in exclusive fullscreen mode for the same screen, the last one being set to this mode takes precedence.
+ Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
+ </constant>
<constant name="WINDOW_FLAG_RESIZE_DISABLED" value="0" enum="WindowFlags">
</constant>
<constant name="WINDOW_FLAG_BORDERLESS" value="1" enum="WindowFlags">
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index cc1243898f..b9267bc577 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -379,8 +379,10 @@
<method name="add_import_plugin">
<return type="void" />
<argument index="0" name="importer" type="EditorImportPlugin" />
+ <argument index="1" name="first_priority" type="bool" default="false" />
<description>
Registers a new [EditorImportPlugin]. Import plugins are used to import custom and unsupported assets as a custom [Resource] type.
+ If [code]first_priority[/code] is [code]true[/code], the new import plugin is inserted first in the list and takes precedence over pre-existing plugins.
[b]Note:[/b] If you want to import custom 3D asset formats use [method add_scene_format_importer_plugin] instead.
See [method add_inspector_plugin] for an example of how to register a plugin.
</description>
@@ -408,15 +410,19 @@
<method name="add_scene_format_importer_plugin">
<return type="void" />
<argument index="0" name="scene_format_importer" type="EditorSceneFormatImporter" />
+ <argument index="1" name="first_priority" type="bool" default="false" />
<description>
Registers a new [EditorSceneFormatImporter]. Scene importers are used to import custom 3D asset formats as scenes.
+ If [code]first_priority[/code] is [code]true[/code], the new import plugin is inserted first in the list and takes precedence over pre-existing plugins.
</description>
</method>
<method name="add_scene_post_import_plugin">
<return type="void" />
<argument index="0" name="scene_import_plugin" type="EditorScenePostImportPlugin" />
+ <argument index="1" name="first_priority" type="bool" default="false" />
<description>
Add a [EditorScenePostImportPlugin]. These plugins allow customizing the import process of 3D assets by adding new options to the import dialogs.
+ If [code]first_priority[/code] is [code]true[/code], the new import plugin is inserted first in the list and takes precedence over pre-existing plugins.
</description>
</method>
<method name="add_spatial_gizmo_plugin">
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index 60d4b664d2..2f4a0079c9 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -88,6 +88,15 @@
<description>
</description>
</method>
+ <method name="compute_image_metrics">
+ <return type="Dictionary" />
+ <argument index="0" name="compared_image" type="Image" />
+ <argument index="1" name="use_luma" type="bool" />
+ <description>
+ Compute image metrics on the current image and the compared image.
+ The dictionary contains [code]max[/code], [code]mean[/code], [code]mean_squared[/code], [code]root_mean_squared[/code] and [code]peak_snr[/code].
+ </description>
+ </method>
<method name="convert">
<return type="void" />
<argument index="0" name="format" type="int" enum="Image.Format" />
diff --git a/doc/classes/InputEventMouse.xml b/doc/classes/InputEventMouse.xml
index 5215c29b4a..054b3dbb33 100644
--- a/doc/classes/InputEventMouse.xml
+++ b/doc/classes/InputEventMouse.xml
@@ -14,10 +14,12 @@
The mouse button mask identifier, one of or a bitwise combination of the [enum MouseButton] button masks.
</member>
<member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" default="Vector2(0, 0)">
- The global mouse position relative to the current [Viewport]. If used in [method Control._gui_input] and if the current [Control] is not under the mouse, moving it will not update this value.
+ When received in [method Node._input] or [method Node._unhandled_input], returns the mouse's position in the root [Viewport] using the coordinate system of the root [Viewport].
+ When received in [method Control._gui_input], returns the mouse's position in the [CanvasLayer] that the [Control] is in using the coordinate system of the [CanvasLayer].
</member>
<member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2(0, 0)">
- The local mouse position relative to the [Viewport]. If used in [method Control._gui_input], the position is relative to the current [Control] which is under the mouse. If the current [Control] is not under the mouse, moving it will not update this value.
+ When received in [method Node._input] or [method Node._unhandled_input], returns the mouse's position in the [Viewport] this [Node] is in using the coordinate system of this [Viewport].
+ When received in [method Control._gui_input], returns the mouse's position in the [Control] using the local coordinate system of the [Control].
</member>
</members>
</class>
diff --git a/doc/classes/JavaScript.xml b/doc/classes/JavaScript.xml
index aeaf8ac1f5..4ea60ad867 100644
--- a/doc/classes/JavaScript.xml
+++ b/doc/classes/JavaScript.xml
@@ -53,5 +53,27 @@
Returns an interface to a JavaScript object that can be used by scripts. The [code]interface[/code] must be a valid property of the JavaScript [code]window[/code]. The callback must accept a single [Array] argument, which will contain the JavaScript [code]arguments[/code]. See [JavaScriptObject] for usage.
</description>
</method>
+ <method name="pwa_needs_update" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if a new version of the progressive web app is waiting to be activated.
+ [b]Note:[/b] Only relevant when exported as a Progressive Web App.
+ </description>
+ </method>
+ <method name="pwa_update">
+ <return type="int" enum="Error" />
+ <description>
+ Performs the live update of the progressive web app. Forcing the new version to be installed and the page to be reloaded.
+ [b]Note:[/b] Your application will be [b]reloaded in all browser tabs[/b].
+ [b]Note:[/b] Only relevant when exported as a Progressive Web App and [method pwa_needs_update] returns [code]true[/code].
+ </description>
+ </method>
</methods>
+ <signals>
+ <signal name="pwa_update_available">
+ <description>
+ Emitted when an update for this progressive web app has been detected but is waiting to be activated because a previous version is active. See [method pwa_update] to force the update to take place immediately.
+ </description>
+ </signal>
+ </signals>
</class>
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index c774528a39..8fbafcdb51 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -206,7 +206,7 @@
<constant name="ARRAY_FORMAT_INDEX" value="4096" enum="ArrayFormat">
Mesh array uses indices.
</constant>
- <constant name="ARRAY_FORMAT_BLEND_SHAPE_MASK" value="2147475463" enum="ArrayFormat">
+ <constant name="ARRAY_FORMAT_BLEND_SHAPE_MASK" value="7" enum="ArrayFormat">
</constant>
<constant name="ARRAY_FORMAT_CUSTOM_BASE" value="13" enum="ArrayFormat">
</constant>
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index e0da08f5bd..642e000efc 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -79,10 +79,8 @@
<member name="refuse_new_connections" type="bool" setter="set_refuse_new_connections" getter="is_refusing_new_connections" default="false">
If [code]true[/code], the MultiplayerAPI's [member multiplayer_peer] refuses new incoming connections.
</member>
- <member name="replicator" type="MultiplayerReplicator" setter="" getter="get_replicator">
- </member>
- <member name="root_node" type="Node" setter="set_root_node" getter="get_root_node">
- The root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed.
+ <member name="root_path" type="NodePath" setter="set_root_path" getter="get_root_path" default="NodePath(&quot;&quot;)">
+ The root path to use for RPCs and replication. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed.
This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene.
</member>
</members>
diff --git a/doc/classes/MultiplayerReplicator.xml b/doc/classes/MultiplayerReplicator.xml
deleted file mode 100644
index c2e93ddeab..0000000000
--- a/doc/classes/MultiplayerReplicator.xml
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="MultiplayerReplicator" inherits="Object" version="4.0">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="decode_state">
- <return type="int" enum="Error" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="object" type="Object" />
- <argument index="2" name="data" type="PackedByteArray" />
- <argument index="3" name="initial" type="bool" default="true" />
- <description>
- Decode the given [code]data[/code] representing a spawnable state into [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when a client receives a server spawn for a scene with [constant REPLICATION_MODE_SERVER]. See [method spawn_config].
- Tip: You may find this function useful in servers when parsing spawn requests from clients, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM].
- </description>
- </method>
- <method name="despawn">
- <return type="int" enum="Error" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="object" type="Object" />
- <argument index="2" name="peer_id" type="int" default="0" />
- <description>
- Request a despawn for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code]. This will either trigger the default behavior, or invoke the custom spawn/despawn callables specified in [method spawn_config]. See [method send_despawn] for the default behavior.
- </description>
- </method>
- <method name="encode_state">
- <return type="PackedByteArray" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="object" type="Object" />
- <argument index="2" name="initial" type="bool" default="true" />
- <description>
- Encode the given [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when the server spawns scenes with [constant REPLICATION_MODE_SERVER]. See [method spawn_config].
- Tip: You may find this function useful when requesting spawns from clients to server, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM].
- </description>
- </method>
- <method name="send_despawn">
- <return type="int" enum="Error" />
- <argument index="0" name="peer_id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="data" type="Variant" default="null" />
- <argument index="3" name="path" type="NodePath" default="NodePath(&quot;&quot;)" />
- <description>
- Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal despawned]. In all other cases no deletion happens, and the signal [signal despawn_requested] is emitted instead.
- </description>
- </method>
- <method name="send_spawn">
- <return type="int" enum="Error" />
- <argument index="0" name="peer_id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="data" type="Variant" default="null" />
- <argument index="3" name="path" type="NodePath" default="NodePath(&quot;&quot;)" />
- <description>
- Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal spawned]. In all other cases no instantiation happens, and the signal [signal spawn_requested] is emitted instead.
- </description>
- </method>
- <method name="send_sync">
- <return type="int" enum="Error" />
- <argument index="0" name="peer_id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="data" type="PackedByteArray" />
- <argument index="3" name="transfer_mode" type="int" enum="TransferMode" default="2" />
- <argument index="4" name="channel" type="int" default="0" />
- <description>
- Sends a sync request for the instances of the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). This function can only be called manually when overriding the send and receive sync functions (see [method sync_config]).
- </description>
- </method>
- <method name="spawn">
- <return type="int" enum="Error" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="object" type="Object" />
- <argument index="2" name="peer_id" type="int" default="0" />
- <description>
- Request a spawn for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code]. This will either trigger the default behavior, or invoke the custom spawn/despawn callables specified in [method spawn_config]. See [method send_spawn] for the default behavior.
- </description>
- </method>
- <method name="spawn_config">
- <return type="int" enum="Error" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="spawn_mode" type="int" enum="MultiplayerReplicator.ReplicationMode" />
- <argument index="2" name="properties" type="StringName[]" default="[]" />
- <argument index="3" name="custom_send" type="Callable" />
- <argument index="4" name="custom_receive" type="Callable" />
- <description>
- Configures the MultiplayerReplicator to track instances of the [PackedScene] identified by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication. When [code]mode[/code] is [constant REPLICATION_MODE_SERVER], the specified [code]properties[/code] will also be replicated to clients during the initial spawn. You can optionally specify a [code]custom_send[/code] and a [code]custom_receive[/code] to override the default behavior and customize the spawn/despawn proecess.
- Tip: You can use a custom property in the scene main script to return a customly optimized state representation.
- </description>
- </method>
- <method name="sync_all">
- <return type="int" enum="Error" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="peer_id" type="int" default="0" />
- <description>
- Manually request a sync for all the instances of the scene identified by [code]scene_id[/code]. This function will trigger the default sync behavior, or call your send custom send callable if specified in [method sync_config].
- [b]Note:[/b] The default implementation only allow syncing from server to clients.
- </description>
- </method>
- <method name="sync_config">
- <return type="int" enum="Error" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="interval" type="int" />
- <argument index="2" name="properties" type="StringName[]" default="[]" />
- <argument index="3" name="custom_send" type="Callable" />
- <argument index="4" name="custom_receive" type="Callable" />
- <description>
- Configures the MultiplayerReplicator to sync instances of the [PackedScene] identified by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication at the desired [code]interval[/code] (in milliseconds). The specified [code]properties[/code] will be part of the state sync. You can optionally specify a [code]custom_send[/code] and a [code]custom_receive[/code] to override the default behavior and customize the synchronization proecess.
- Tip: You can use a custom property in the scene main script to return a customly optimized state representation (having a single property that returns a PackedByteArray is highly recommended when dealing with many instances).
- </description>
- </method>
- <method name="track">
- <return type="void" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="object" type="Object" />
- <description>
- Track the given [code]object[/code] as an instance of the scene identified by [code]scene_id[/code]. This object will be passed to your custom sync callables (see [method sync_config]). Tracking and untracking is automatic in [constant REPLICATION_MODE_SERVER].
- </description>
- </method>
- <method name="untrack">
- <return type="void" />
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="object" type="Object" />
- <description>
- Untrack the given [code]object[/code]. This object will no longer be passed to your custom sync callables (see [method sync_config]). Tracking and untracking is automatic in [constant REPLICATION_MODE_SERVER].
- </description>
- </method>
- </methods>
- <signals>
- <signal name="despawn_requested">
- <argument index="0" name="id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="parent" type="Node" />
- <argument index="3" name="name" type="String" />
- <argument index="4" name="data" type="PackedByteArray" />
- <description>
- Emitted when a network despawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM].
- </description>
- </signal>
- <signal name="despawned">
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="node" type="Node" />
- <description>
- Emitted on a client before deleting a local Node upon receiving a despawn request from the server.
- </description>
- </signal>
- <signal name="replicated_instance_added">
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="node" type="Node" />
- <description>
- Emitted when an instance of a [PackedScene] that has been configured for networking enters the [SceneTree]. See [method spawn_config].
- </description>
- </signal>
- <signal name="replicated_instance_removed">
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="node" type="Node" />
- <description>
- Emitted when an instance of a [PackedScene] that has been configured for networking leaves the [SceneTree]. See [method spawn_config].
- </description>
- </signal>
- <signal name="spawn_requested">
- <argument index="0" name="id" type="int" />
- <argument index="1" name="scene_id" type="int" />
- <argument index="2" name="parent" type="Node" />
- <argument index="3" name="name" type="String" />
- <argument index="4" name="data" type="PackedByteArray" />
- <description>
- Emitted when a network spawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM].
- </description>
- </signal>
- <signal name="spawned">
- <argument index="0" name="scene_id" type="int" />
- <argument index="1" name="node" type="Node" />
- <description>
- Emitted on a client after a new Node is instantiated locally and added to the SceneTree upon receiving a spawn request from the server.
- </description>
- </signal>
- </signals>
- <constants>
- <constant name="REPLICATION_MODE_NONE" value="0" enum="ReplicationMode">
- Used with [method spawn_config] to identify a [PackedScene] that should not be replicated.
- </constant>
- <constant name="REPLICATION_MODE_SERVER" value="1" enum="ReplicationMode">
- Used with [method spawn_config] to identify a [PackedScene] that should be automatically replicated from server to clients.
- </constant>
- <constant name="REPLICATION_MODE_CUSTOM" value="2" enum="ReplicationMode">
- Used with [method spawn_config] to identify a [PackedScene] that can be manually replicated among peers.
- </constant>
- </constants>
-</class>
diff --git a/doc/classes/MultiplayerSpawner.xml b/doc/classes/MultiplayerSpawner.xml
new file mode 100644
index 0000000000..8bfecfce41
--- /dev/null
+++ b/doc/classes/MultiplayerSpawner.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="MultiplayerSpawner" inherits="Node" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="_spawn_custom" qualifiers="virtual">
+ <return type="Object" />
+ <argument index="0" name="data" type="Variant" />
+ <description>
+ </description>
+ </method>
+ <method name="spawn">
+ <return type="Node" />
+ <argument index="0" name="data" type="Variant" default="null" />
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="auto_spawn" type="bool" setter="set_auto_spawning" getter="is_auto_spawning" default="false">
+ </member>
+ <member name="replication" type="PackedScene[]" setter="set_spawnable_scenes" getter="get_spawnable_scenes" default="[]">
+ </member>
+ <member name="spawn_limit" type="int" setter="set_spawn_limit" getter="get_spawn_limit" default="0">
+ </member>
+ <member name="spawn_path" type="NodePath" setter="set_spawn_path" getter="get_spawn_path" default="NodePath(&quot;&quot;)">
+ </member>
+ </members>
+ <signals>
+ <signal name="despawned">
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="node" type="Node" />
+ <description>
+ </description>
+ </signal>
+ <signal name="spawned">
+ <argument index="0" name="scene_id" type="int" />
+ <argument index="1" name="node" type="Node" />
+ <description>
+ </description>
+ </signal>
+ </signals>
+</class>
diff --git a/doc/classes/MultiplayerSynchronizer.xml b/doc/classes/MultiplayerSynchronizer.xml
new file mode 100644
index 0000000000..242d4589a4
--- /dev/null
+++ b/doc/classes/MultiplayerSynchronizer.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="MultiplayerSynchronizer" inherits="Node" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <members>
+ <member name="replication_interval" type="float" setter="set_replication_interval" getter="get_replication_interval" default="0.0">
+ </member>
+ <member name="resource" type="SceneReplicationConfig" setter="set_replication_config" getter="get_replication_config">
+ </member>
+ <member name="root_path" type="NodePath" setter="set_root_path" getter="get_root_path" default="NodePath(&quot;&quot;)">
+ </member>
+ </members>
+</class>
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index d714fbc0d5..89bc905e69 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -52,7 +52,7 @@
It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_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, [method _unhandled_input] and [method _unhandled_key_input] are usually a better fit as they allow the GUI to intercept the events first.
- [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
+ [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>
<method name="_physics_process" qualifiers="virtual">
@@ -62,7 +62,7 @@
Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [code]delta[/code] variable should be constant. [code]delta[/code] is in seconds.
It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process].
Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification].
- [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
+ [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>
<method name="_process" qualifiers="virtual">
@@ -72,38 +72,38 @@
Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [code]delta[/code] time since the previous frame is not constant. [code]delta[/code] is in seconds.
It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process].
Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification].
- [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
+ [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>
<method name="_ready" qualifiers="virtual">
<return type="void" />
<description>
Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their [method _ready] callbacks get triggered first, and the parent node will receive the ready notification afterwards.
- Corresponds to the [constant NOTIFICATION_READY] notification in [method Object._notification]. See also the [code]onready[/code] keyword for variables.
+ Corresponds to the [constant NOTIFICATION_READY] notification in [method Object._notification]. See also the [code]@onready[/code] annotation for variables.
Usually used for initialization. For even earlier initialization, [method Object._init] may be used. See also [method _enter_tree].
- [b]Note:[/b] [method _ready] may be called only once for each node. After removing a node from the scene tree and adding again, [code]_ready[/code] will not be called for the second time. This can be bypassed with requesting another call with [method request_ready], which may be called anywhere before adding the node again.
+ [b]Note:[/b] [method _ready] may be called only once for each node. After removing a node from the scene tree and adding it again, [code]_ready[/code] will not be called a second time. This can be bypassed by requesting another call with [method request_ready], which may be called anywhere before adding the node again.
</description>
</method>
<method name="_unhandled_input" qualifiers="virtual">
<return type="void" />
<argument index="0" name="event" type="InputEvent" />
<description>
- Called when an [InputEvent] hasn't been consumed by [method _input] or any GUI. The input event propagates up through the node tree until a node consumes it.
+ Called when an [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.
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.
- [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
+ [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>
<method name="_unhandled_key_input" qualifiers="virtual">
<return type="void" />
<argument index="0" name="event" type="InputEvent" />
<description>
- Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed by [method _input] or any GUI. The input event propagates up through the node tree until a node consumes it.
+ 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.
It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input].
To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called.
For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input] as they allow the GUI to intercept the events first.
- [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
+ [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>
<method name="add_child">
@@ -726,6 +726,18 @@
</member>
</members>
<signals>
+ <signal name="child_entered_tree">
+ <argument index="0" name="node" type="Node" />
+ <description>
+ Emitted when a child node enters the scene tree, either because it entered on its own or because this node entered with it.
+ </description>
+ </signal>
+ <signal name="child_exited_tree">
+ <argument index="0" name="node" type="Node" />
+ <description>
+ Emitted when a child node exits the scene tree, either because it exited on its own or because this node exited.
+ </description>
+ </signal>
<signal name="ready">
<description>
Emitted when the node is ready. Comes after [method _ready] callback and follows the same rules.
diff --git a/doc/classes/Panel.xml b/doc/classes/Panel.xml
index 21ac7dfac1..3246fa7eba 100644
--- a/doc/classes/Panel.xml
+++ b/doc/classes/Panel.xml
@@ -11,16 +11,6 @@
<link title="2D Finite State Machine Demo">https://godotengine.org/asset-library/asset/516</link>
<link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link>
</tutorials>
- <members>
- <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Panel.Mode" default="0">
- </member>
- </members>
- <constants>
- <constant name="MODE_BACKGROUND" value="0" enum="Mode">
- </constant>
- <constant name="MODE_FOREGROUND" value="1" enum="Mode">
- </constant>
- </constants>
<theme_items>
<theme_item name="panel" data_type="style" type="StyleBox">
The style of this [Panel].
diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml
index eb1b0aada7..b316f822f0 100644
--- a/doc/classes/PopupMenu.xml
+++ b/doc/classes/PopupMenu.xml
@@ -331,6 +331,13 @@
[b]Note:[/b] The indices of items after the removed item will be shifted by one.
</description>
</method>
+ <method name="scroll_to_item">
+ <return type="void" />
+ <argument index="0" name="index" type="int" />
+ <description>
+ Moves the scroll view to make the item at the given [code]index[/code] visible.
+ </description>
+ </method>
<method name="set_current_index">
<return type="void" />
<argument index="0" name="index" type="int" />
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index dc40d2fd1b..ed124d1d15 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -356,6 +356,8 @@
<member name="debug/gdscript/warnings/incompatible_ternary" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a ternary operator may emit values with incompatible types.
</member>
+ <member name="debug/gdscript/warnings/int_assigned_to_enum" type="bool" setter="" getter="" default="true">
+ </member>
<member name="debug/gdscript/warnings/integer_division" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when dividing an integer by another integer (the decimal part will be discarded).
</member>
diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml
index 695b0933fa..990e82593e 100644
--- a/doc/classes/RID.xml
+++ b/doc/classes/RID.xml
@@ -30,6 +30,12 @@
Returns the ID of the referenced resource.
</description>
</method>
+ <method name="is_valid" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if [RID] is valid.
+ </description>
+ </method>
</methods>
<operators>
<operator name="operator !=">
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 446db40dd8..82728c0570 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -3626,7 +3626,7 @@
<constant name="ARRAY_FORMAT_INDEX" value="4096" enum="ArrayFormat">
Flag used to mark an index array.
</constant>
- <constant name="ARRAY_FORMAT_BLEND_SHAPE_MASK" value="2147475463" enum="ArrayFormat">
+ <constant name="ARRAY_FORMAT_BLEND_SHAPE_MASK" value="7" enum="ArrayFormat">
</constant>
<constant name="ARRAY_FORMAT_CUSTOM_BASE" value="13" enum="ArrayFormat">
</constant>
diff --git a/doc/classes/SceneReplicationConfig.xml b/doc/classes/SceneReplicationConfig.xml
new file mode 100644
index 0000000000..e846740dd3
--- /dev/null
+++ b/doc/classes/SceneReplicationConfig.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="SceneReplicationConfig" inherits="Resource" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_property">
+ <return type="void" />
+ <argument index="0" name="path" type="NodePath" />
+ <argument index="1" name="index" type="int" default="-1" />
+ <description>
+ </description>
+ </method>
+ <method name="get_properties" qualifiers="const">
+ <return type="NodePath[]" />
+ <description>
+ </description>
+ </method>
+ <method name="property_get_index" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="path" type="NodePath" />
+ <description>
+ </description>
+ </method>
+ <method name="property_get_spawn">
+ <return type="bool" />
+ <argument index="0" name="path" type="NodePath" />
+ <description>
+ </description>
+ </method>
+ <method name="property_get_sync">
+ <return type="bool" />
+ <argument index="0" name="path" type="NodePath" />
+ <description>
+ </description>
+ </method>
+ <method name="property_set_spawn">
+ <return type="void" />
+ <argument index="0" name="path" type="NodePath" />
+ <argument index="1" name="enabled" type="bool" />
+ <description>
+ </description>
+ </method>
+ <method name="property_set_sync">
+ <return type="void" />
+ <argument index="0" name="path" type="NodePath" />
+ <argument index="1" name="enabled" type="bool" />
+ <description>
+ </description>
+ </method>
+ <method name="remove_property">
+ <return type="void" />
+ <argument index="0" name="path" type="NodePath" />
+ <description>
+ </description>
+ </method>
+ </methods>
+</class>
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index eeb17c24c0..a6182f5dab 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -222,6 +222,22 @@
[/codeblock]
</description>
</method>
+ <method name="get_slice_count" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="delimiter" type="String" />
+ <description>
+ Splits a string using a [code]delimiter[/code] and returns a number of slices.
+ </description>
+ </method>
+ <method name="get_slicec" qualifiers="const">
+ <return type="String" />
+ <argument index="0" name="delimiter" type="int" />
+ <argument index="1" name="slice" type="int" />
+ <description>
+ Splits a string using a Unicode character with code [code]delimiter[/code] and returns a substring at index [code]slice[/code]. Returns an empty string if the index doesn't exist.
+ This is a more performant alternative to [method split] for cases when you need only one element from the array at a fixed index.
+ </description>
+ </method>
<method name="hash" qualifiers="const">
<return type="int" />
<description>
diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml
index b32665a09f..85c4d7593e 100644
--- a/doc/classes/StringName.xml
+++ b/doc/classes/StringName.xml
@@ -48,6 +48,18 @@
<description>
</description>
</operator>
+ <operator name="operator &lt;">
+ <return type="bool" />
+ <argument index="0" name="right" type="StringName" />
+ <description>
+ </description>
+ </operator>
+ <operator name="operator &lt;=">
+ <return type="bool" />
+ <argument index="0" name="right" type="StringName" />
+ <description>
+ </description>
+ </operator>
<operator name="operator ==">
<return type="bool" />
<description>
@@ -65,5 +77,17 @@
<description>
</description>
</operator>
+ <operator name="operator &gt;">
+ <return type="bool" />
+ <argument index="0" name="right" type="StringName" />
+ <description>
+ </description>
+ </operator>
+ <operator name="operator &gt;=">
+ <return type="bool" />
+ <argument index="0" name="right" type="StringName" />
+ <description>
+ </description>
+ </operator>
</operators>
</class>
diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml
index 476ab2d1bf..5f081b95f5 100644
--- a/doc/classes/TextureButton.xml
+++ b/doc/classes/TextureButton.xml
@@ -12,17 +12,17 @@
<link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<members>
- <member name="expand" type="bool" setter="set_expand" getter="get_expand" default="false">
- If [code]true[/code], the texture stretches to the edges of the node's bounding rectangle using the [member stretch_mode]. If [code]false[/code], the texture will not scale with the node.
- </member>
<member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" default="false">
If [code]true[/code], texture is flipped horizontally.
</member>
<member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v" default="false">
If [code]true[/code], texture is flipped vertically.
</member>
- <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureButton.StretchMode" default="0">
- Controls the texture's behavior when you resize the node's bounding rectangle, [b]only if[/b] [member expand] is [code]true[/code]. Set it to one of the [enum StretchMode] constants. See the constants to learn more.
+ <member name="ignore_texture_size" type="bool" setter="set_ignore_texture_size" getter="get_ignore_texture_size" default="false">
+ If [code]true[/code], the size of the texture won't be considered for minimum size calculation, so the [TextureButton] can be shrunk down past the texture size.
+ </member>
+ <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureButton.StretchMode" default="2">
+ Controls the texture's behavior when you resize the node's bounding rectangle. See the [enum StretchMode] constants for available options.
</member>
<member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask">
Pure black and white [BitMap] image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes.
diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml
index d1a48fda55..b1367be263 100644
--- a/doc/classes/Theme.xml
+++ b/doc/classes/Theme.xml
@@ -1,20 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Theme" inherits="Resource" version="4.0">
<brief_description>
- Theme for controls.
+ Theme resource for styling/skinning [Control]s and [Window]s.
</brief_description>
<description>
- A theme for skinning controls. Controls can be skinned individually, but for complex applications, it's more practical to just create a global theme that defines everything. This theme can be applied to any [Control]; the Control and its children will automatically use it.
- Theme resources can alternatively be loaded by writing them in a [code].theme[/code] file, see the documentation for more information.
+ A theme resource is used for styling/skinning [Control] and [Window] nodes. While individual controls can be styled using their local theme overrides (see [method Control.add_theme_color_override]), theme resources allow you to store and apply the same settings between all controls sharing the same type (e.g. style all [Button]s the same). One theme resource can be used for the entire project, but you can also set a separate theme resource to a branch of control nodes. A theme resources assigned to a control node applies to the control itself, as well as all of its direct and indirect children (as long as a chain of controls is uninterrupted).
+ Use [member ProjectSettings.gui/theme/custom] to set up a project-scope theme that will be available to every control in your project.
+ Use [member Control.theme] of any control node to set up a theme that will be available to that control and all of its direct and indirect children.
</description>
<tutorials>
<link title="GUI skinning">$DOCS_URL/tutorials/ui/gui_skinning.html</link>
+ <link title="Using the theme editor">$DOCS_URL/tutorials/ui/gui_using_theme_editor.html</link>
</tutorials>
<methods>
<method name="clear">
<return type="void" />
<description>
- Clears all values on the theme.
+ Removes all the theme properties defined on the theme resource.
</description>
</method>
<method name="clear_color">
@@ -22,7 +24,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Clears the [Color] at [code]name[/code] if the theme has [code]theme_type[/code].
+ Removes the [Color] property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Fails if it doesn't exist. Use [method has_color] to check for existence.
</description>
</method>
<method name="clear_constant">
@@ -30,7 +33,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Clears the constant at [code]name[/code] if the theme has [code]theme_type[/code].
+ Removes the constant property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Fails if it doesn't exist. Use [method has_constant] to check for existence.
</description>
</method>
<method name="clear_font">
@@ -38,7 +42,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Clears the [Font] at [code]name[/code] if the theme has [code]theme_type[/code].
+ Removes the [Font] property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Fails if it doesn't exist. Use [method has_font] to check for existence.
</description>
</method>
<method name="clear_font_size">
@@ -46,7 +51,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Clears the font size [code]name[/code] if the theme has [code]theme_type[/code].
+ Removes the font size property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Fails if it doesn't exist. Use [method has_font_size] to check for existence.
</description>
</method>
<method name="clear_icon">
@@ -54,7 +60,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Clears the icon at [code]name[/code] if the theme has [code]theme_type[/code].
+ Removes the icon property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Fails if it doesn't exist. Use [method has_icon] to check for existence.
</description>
</method>
<method name="clear_stylebox">
@@ -62,7 +69,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Clears [StyleBox] at [code]name[/code] if the theme has [code]theme_type[/code].
+ Removes the [StyleBox] property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Fails if it doesn't exist. Use [method has_stylebox] to check for existence.
</description>
</method>
<method name="clear_theme_item">
@@ -71,14 +79,16 @@
<argument index="1" name="name" type="StringName" />
<argument index="2" name="theme_type" type="StringName" />
<description>
- Clears the theme item of [code]data_type[/code] at [code]name[/code] if the theme has [code]theme_type[/code].
+ Removes the theme property of [code]data_type[/code] defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Fails if it doesn't exist. Use [method has_theme_item] to check for existence.
+ [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
</description>
</method>
<method name="clear_type_variation">
<return type="void" />
<argument index="0" name="theme_type" type="StringName" />
<description>
- Unmarks [code]theme_type[/code] as being a variation of any other type.
+ Unmarks [code]theme_type[/code] as being a variation of another theme type. See [method set_type_variation].
</description>
</method>
<method name="get_color" qualifiers="const">
@@ -86,20 +96,21 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns the [Color] at [code]name[/code] if the theme has [code]theme_type[/code].
+ Returns the [Color] property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Returns the default color value if the property doesn't exist. Use [method has_color] to check for existence.
</description>
</method>
<method name="get_color_list" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="theme_type" type="String" />
<description>
- Returns all the [Color]s as a [PackedStringArray] filled with each [Color]'s name, for use in [method get_color], if the theme has [code]theme_type[/code].
+ Returns a list of names for [Color] properties defined with [code]theme_type[/code]. Use [method get_color_type_list] to get a list of possible theme type names.
</description>
</method>
<method name="get_color_type_list" qualifiers="const">
<return type="PackedStringArray" />
<description>
- Returns all the [Color] types as a [PackedStringArray] filled with unique type names, for use in [method get_color] and/or [method get_color_list].
+ Returns a list of all unique theme type names for [Color] properties. Use [method get_type_list] to get a list of all unique theme types.
</description>
</method>
<method name="get_constant" qualifiers="const">
@@ -107,20 +118,21 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns the constant at [code]name[/code] if the theme has [code]theme_type[/code].
+ Returns the constant property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Returns [code]0[/code] if the property doesn't exist. Use [method has_constant] to check for existence.
</description>
</method>
<method name="get_constant_list" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="theme_type" type="String" />
<description>
- Returns all the constants as a [PackedStringArray] filled with each constant's name, for use in [method get_constant], if the theme has [code]theme_type[/code].
+ Returns a list of names for constant properties defined with [code]theme_type[/code]. Use [method get_constant_type_list] to get a list of possible theme type names.
</description>
</method>
<method name="get_constant_type_list" qualifiers="const">
<return type="PackedStringArray" />
<description>
- Returns all the constant types as a [PackedStringArray] filled with unique type names, for use in [method get_constant] and/or [method get_constant_list].
+ Returns a list of all unique theme type names for constant properties. Use [method get_type_list] to get a list of all unique theme types.
</description>
</method>
<method name="get_font" qualifiers="const">
@@ -128,14 +140,16 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns the [Font] at [code]name[/code] if the theme has [code]theme_type[/code].
+ Returns the [Font] property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Returns the default theme font if the property doesn't exist and the default theme font is set up (see [member default_font]). Use [method has_font] to check for existence of the property and [method has_default_font] to check for existence of the default theme font.
+ Returns the engine fallback font value, if neither exist.
</description>
</method>
<method name="get_font_list" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="theme_type" type="String" />
<description>
- Returns all the [Font]s as a [PackedStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]theme_type[/code].
+ Returns a list of names for [Font] properties defined with [code]theme_type[/code]. Use [method get_font_type_list] to get a list of possible theme type names.
</description>
</method>
<method name="get_font_size" qualifiers="const">
@@ -143,26 +157,28 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns the font size at [code]name[/code] if the theme has [code]theme_type[/code].
+ Returns the font size property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Returns the default theme font size if the property doesn't exist and the default theme font size is set up (see [member default_font_size]). Use [method has_font_size] to check for existence of the property and [method has_default_font_size] to check for existence of the default theme font.
+ Returns the engine fallback font size value, if neither exist.
</description>
</method>
<method name="get_font_size_list" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="theme_type" type="String" />
<description>
- Returns all the font sizes as a [PackedStringArray] filled with each font size name, for use in [method get_font_size], if the theme has [code]theme_type[/code].
+ Returns a list of names for font size properties defined with [code]theme_type[/code]. Use [method get_font_size_type_list] to get a list of possible theme type names.
</description>
</method>
<method name="get_font_size_type_list" qualifiers="const">
<return type="PackedStringArray" />
<description>
- Returns all the font size types as a [PackedStringArray] filled with unique type names, for use in [method get_font_size] and/or [method get_font_size_list].
+ Returns a list of all unique theme type names for font size properties. Use [method get_type_list] to get a list of all unique theme types.
</description>
</method>
<method name="get_font_type_list" qualifiers="const">
<return type="PackedStringArray" />
<description>
- Returns all the [Font] types as a [PackedStringArray] filled with unique type names, for use in [method get_font] and/or [method get_font_list].
+ Returns a list of all unique theme type names for [Font] properties. Use [method get_type_list] to get a list of all unique theme types.
</description>
</method>
<method name="get_icon" qualifiers="const">
@@ -170,20 +186,21 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]theme_type[/code].
+ Returns the icon property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Returns the engine fallback icon value if the property doesn't exist. Use [method has_icon] to check for existence.
</description>
</method>
<method name="get_icon_list" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="theme_type" type="String" />
<description>
- Returns all the icons as a [PackedStringArray] filled with each [Texture2D]'s name, for use in [method get_icon], if the theme has [code]theme_type[/code].
+ Returns a list of names for icon properties defined with [code]theme_type[/code]. Use [method get_icon_type_list] to get a list of possible theme type names.
</description>
</method>
<method name="get_icon_type_list" qualifiers="const">
<return type="PackedStringArray" />
<description>
- Returns all the icon types as a [PackedStringArray] filled with unique type names, for use in [method get_icon] and/or [method get_icon_list].
+ Returns a list of all unique theme type names for icon properties. Use [method get_type_list] to get a list of all unique theme types.
</description>
</method>
<method name="get_stylebox" qualifiers="const">
@@ -191,22 +208,21 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns the [StyleBox] at [code]name[/code] if the theme has [code]theme_type[/code].
- Valid [code]name[/code]s may be found using [method get_stylebox_list]. Valid [code]theme_type[/code]s may be found using [method get_stylebox_type_list].
+ Returns the [StyleBox] property defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Returns the engine fallback stylebox value if the property doesn't exist. Use [method has_stylebox] to check for existence.
</description>
</method>
<method name="get_stylebox_list" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="theme_type" type="String" />
<description>
- Returns all the [StyleBox]s as a [PackedStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]theme_type[/code].
- Valid [code]theme_type[/code]s may be found using [method get_stylebox_type_list].
+ Returns a list of names for [StyleBox] properties defined with [code]theme_type[/code]. Use [method get_stylebox_type_list] to get a list of possible theme type names.
</description>
</method>
<method name="get_stylebox_type_list" qualifiers="const">
<return type="PackedStringArray" />
<description>
- Returns all the [StyleBox] types as a [PackedStringArray] filled with unique type names, for use in [method get_stylebox] and/or [method get_stylebox_list].
+ Returns a list of all unique theme type names for [StyleBox] properties. Use [method get_type_list] to get a list of all unique theme types.
</description>
</method>
<method name="get_theme_item" qualifiers="const">
@@ -215,8 +231,9 @@
<argument index="1" name="name" type="StringName" />
<argument index="2" name="theme_type" type="StringName" />
<description>
- Returns the theme item of [code]data_type[/code] at [code]name[/code] if the theme has [code]theme_type[/code].
- Valid [code]name[/code]s may be found using [method get_theme_item_list] or a data type specific method. Valid [code]theme_type[/code]s may be found using [method get_theme_item_type_list] or a data type specific method.
+ Returns the theme property of [code]data_type[/code] defined by [code]name[/code] and [code]theme_type[/code], if it exists.
+ Returns the engine fallback icon value if the property doesn't exist. Use [method has_theme_item] to check for existence.
+ [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
</description>
</method>
<method name="get_theme_item_list" qualifiers="const">
@@ -224,35 +241,36 @@
<argument index="0" name="data_type" type="int" enum="Theme.DataType" />
<argument index="1" name="theme_type" type="String" />
<description>
- Returns all the theme items of [code]data_type[/code] as a [PackedStringArray] filled with each theme items's name, for use in [method get_theme_item] or a data type specific method, if the theme has [code]theme_type[/code].
- Valid [code]theme_type[/code]s may be found using [method get_theme_item_type_list] or a data type specific method.
+ Returns a list of names for properties of [code]data_type[/code] defined with [code]theme_type[/code]. Use [method get_theme_item_type_list] to get a list of possible theme type names.
+ [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
</description>
</method>
<method name="get_theme_item_type_list" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="data_type" type="int" enum="Theme.DataType" />
<description>
- Returns all the theme items of [code]data_type[/code] types as a [PackedStringArray] filled with unique type names, for use in [method get_theme_item], [method get_theme_item_list] or data type specific methods.
+ Returns a list of all unique theme type names for [code]data_type[/code] properties. Use [method get_type_list] to get a list of all unique theme types.
+ [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
</description>
</method>
<method name="get_type_list" qualifiers="const">
<return type="PackedStringArray" />
<description>
- Returns all the theme types as a [PackedStringArray] filled with unique type names, for use in other [code]get_*[/code] functions of this theme.
+ Returns a list of all unique theme type names. Use the appropriate [code]get_*_type_list[/code] method to get a list of unique theme types for a single data type.
</description>
</method>
<method name="get_type_variation_base" qualifiers="const">
<return type="StringName" />
<argument index="0" name="theme_type" type="StringName" />
<description>
- Returns the base theme type if [code]theme_type[/code] is a valid variation type. Returns an empty string otherwise.
+ Returns the name of the base theme type if [code]theme_type[/code] is a valid variation type. Returns an empty string otherwise.
</description>
</method>
<method name="get_type_variation_list" qualifiers="const">
<return type="PackedStringArray" />
<argument index="0" name="base_type" type="StringName" />
<description>
- Returns a list of all variation for the given [code]base_type[/code].
+ Returns a list of all type variations for the given [code]base_type[/code].
</description>
</method>
<method name="has_color" qualifiers="const">
@@ -260,8 +278,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]theme_type[/code].
- Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
+ Returns [code]true[/code] if the [Color] property defined by [code]name[/code] and [code]theme_type[/code] exists.
+ Returns [code]false[/code] if it doesn't exist. Use [method set_color] to define it.
</description>
</method>
<method name="has_constant" qualifiers="const">
@@ -269,26 +287,29 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns [code]true[/code] if constant with [code]name[/code] is in [code]theme_type[/code].
- Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
+ Returns [code]true[/code] if the constant property defined by [code]name[/code] and [code]theme_type[/code] exists.
+ Returns [code]false[/code] if it doesn't exist. Use [method set_constant] to define it.
</description>
</method>
<method name="has_default_base_scale" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if this theme has a valid [member default_base_scale] value.
+ Returns [code]true[/code] if [member default_base_scale] has a valid value.
+ Returns [code]false[/code] if it doesn't. The value must be greater than [code]0.0[/code] to be considered valid.
</description>
</method>
<method name="has_default_font" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if this theme has a valid [member default_font] value.
+ Returns [code]true[/code] if [member default_font] has a valid value.
+ Returns [code]false[/code] if it doesn't.
</description>
</method>
<method name="has_default_font_size" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if this theme has a valid [member default_font_size] value.
+ Returns [code]true[/code] if [member default_font_size] has a valid value.
+ Returns [code]false[/code] if it doesn't. The value must be greater than [code]0[/code] to be considered valid.
</description>
</method>
<method name="has_font" qualifiers="const">
@@ -296,8 +317,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]theme_type[/code].
- Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
+ Returns [code]true[/code] if the [Font] property defined by [code]name[/code] and [code]theme_type[/code] exists, or if the default theme font is set up (see [method has_default_font]).
+ Returns [code]false[/code] if neither exist. Use [method set_font] to define the property.
</description>
</method>
<method name="has_font_size" qualifiers="const">
@@ -305,8 +326,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns [code]true[/code] if font size with [code]name[/code] is in [code]theme_type[/code].
- Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
+ Returns [code]true[/code] if the font size property defined by [code]name[/code] and [code]theme_type[/code] exists, or if the default theme font size is set up (see [method has_default_font_size]).
+ Returns [code]false[/code] if neither exist. Use [method set_font_size] to define the property.
</description>
</method>
<method name="has_icon" qualifiers="const">
@@ -314,8 +335,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns [code]true[/code] if icon [Texture2D] with [code]name[/code] is in [code]theme_type[/code].
- Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
+ Returns [code]true[/code] if the icon property defined by [code]name[/code] and [code]theme_type[/code] exists.
+ Returns [code]false[/code] if it doesn't exist. Use [method set_icon] to define it.
</description>
</method>
<method name="has_stylebox" qualifiers="const">
@@ -323,8 +344,8 @@
<argument index="0" name="name" type="StringName" />
<argument index="1" name="theme_type" type="StringName" />
<description>
- Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]theme_type[/code].
- Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
+ Returns [code]true[/code] if the [StyleBox] property defined by [code]name[/code] and [code]theme_type[/code] exists.
+ Returns [code]false[/code] if it doesn't exist. Use [method set_stylebox] to define it.
</description>
</method>
<method name="has_theme_item" qualifiers="const">
@@ -333,8 +354,9 @@
<argument index="1" name="name" type="StringName" />
<argument index="2" name="theme_type" type="StringName" />
<description>
- Returns [code]true[/code] if a theme item of [code]data_type[/code] with [code]name[/code] is in [code]theme_type[/code].
- Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
+ Returns [code]true[/code] if the theme property of [code]data_type[/code] defined by [code]name[/code] and [code]theme_type[/code] exists.
+ Returns [code]false[/code] if it doesn't exist. Use [method set_theme_item] to define it.
+ [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
</description>
</method>
<method name="is_type_variation" qualifiers="const">
@@ -342,14 +364,14 @@
<argument index="0" name="theme_type" type="StringName" />
<argument index="1" name="base_type" type="StringName" />
<description>
- Returns [code]true[/code] if [code]theme_type[/code] is marked as a variation of [code]base_type[/code] in this theme.
+ Returns [code]true[/code] if [code]theme_type[/code] is marked as a variation of [code]base_type[/code].
</description>
</method>
<method name="merge_with">
<return type="void" />
<argument index="0" name="other" type="Theme" />
<description>
- Adds missing and overrides existing definitions with values from the [code]other[/code] [Theme].
+ Adds missing and overrides existing definitions with values from the [code]other[/code] theme resource.
[b]Note:[/b] This modifies the current theme. If you want to merge two themes together without modifying either one, create a new empty theme and merge the other two into it one after another.
</description>
</method>
@@ -359,7 +381,8 @@
<argument index="1" name="name" type="StringName" />
<argument index="2" name="theme_type" type="StringName" />
<description>
- Renames the [Color] at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
+ Renames the [Color] property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists.
+ Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_color] to check for existence, and [method clear_color] to remove the existing property.
</description>
</method>
<method name="rename_constant">
@@ -368,7 +391,8 @@
<argument index="1" name="name" type="StringName" />
<argument index="2" name="theme_type" type="StringName" />
<description>
- Renames the constant at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
+ Renames the constant property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists.
+ Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_constant] to check for existence, and [method clear_constant] to remove the existing property.
</description>
</method>
<method name="rename_font">
@@ -377,7 +401,8 @@
<argument index="1" name="name" type="StringName" />
<argument index="2" name="theme_type" type="StringName" />
<description>
- Renames the [Font] at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
+ Renames the [Font] property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists.
+ Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font] to check for existence, and [method clear_font] to remove the existing property.
</description>
</method>
<method name="rename_font_size">
@@ -386,7 +411,8 @@
<argument index="1" name="name" type="StringName" />
<argument index="2" name="theme_type" type="StringName" />
<description>
- Renames the font size [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
+ Renames the font size property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists.
+ Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font_size] to check for existence, and [method clear_font_size] to remove the existing property.
</description>
</method>
<method name="rename_icon">
@@ -395,7 +421,8 @@
<argument index="1" name="name" type="StringName" />
<argument index="2" name="theme_type" type="StringName" />
<description>
- Renames the icon at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
+ Renames the icon property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists.
+ Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_icon] to check for existence, and [method clear_icon] to remove the existing property.
</description>
</method>
<method name="rename_stylebox">
@@ -404,7 +431,8 @@
<argument index="1" name="name" type="StringName" />
<argument index="2" name="theme_type" type="StringName" />
<description>
- Renames [StyleBox] at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
+ Renames the [StyleBox] property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists.
+ Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_stylebox] to check for existence, and [method clear_stylebox] to remove the existing property.
</description>
</method>
<method name="rename_theme_item">
@@ -414,7 +442,9 @@
<argument index="2" name="name" type="StringName" />
<argument index="3" name="theme_type" type="StringName" />
<description>
- Renames the theme item of [code]data_type[/code] at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
+ Renames the theme property of [code]data_type[/code] defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists.
+ Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_theme_item] to check for existence, and [method clear_theme_item] to remove the existing property.
+ [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
</description>
</method>
<method name="set_color">
@@ -423,8 +453,7 @@
<argument index="1" name="theme_type" type="StringName" />
<argument index="2" name="color" type="Color" />
<description>
- Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]theme_type[/code].
- Creates [code]theme_type[/code] if the theme does not have it.
+ Creates or changes the value of the [Color] property defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_color] to remove the property.
</description>
</method>
<method name="set_constant">
@@ -433,8 +462,7 @@
<argument index="1" name="theme_type" type="StringName" />
<argument index="2" name="constant" type="int" />
<description>
- Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]theme_type[/code].
- Creates [code]theme_type[/code] if the theme does not have it.
+ Creates or changes the value of the constant property defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_constant] to remove the property.
</description>
</method>
<method name="set_font">
@@ -443,8 +471,7 @@
<argument index="1" name="theme_type" type="StringName" />
<argument index="2" name="font" type="Font" />
<description>
- Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]theme_type[/code].
- Creates [code]theme_type[/code] if the theme does not have it.
+ Creates or changes the value of the [Font] property defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_font] to remove the property.
</description>
</method>
<method name="set_font_size">
@@ -453,8 +480,7 @@
<argument index="1" name="theme_type" type="StringName" />
<argument index="2" name="font_size" type="int" />
<description>
- Sets the theme's font size to [code]font_size[/code] at [code]name[/code] in [code]theme_type[/code].
- Creates [code]theme_type[/code] if the theme does not have it.
+ Creates or changes the value of the font size property defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_font_size] to remove the property.
</description>
</method>
<method name="set_icon">
@@ -463,8 +489,7 @@
<argument index="1" name="theme_type" type="StringName" />
<argument index="2" name="texture" type="Texture2D" />
<description>
- Sets the theme's icon [Texture2D] to [code]texture[/code] at [code]name[/code] in [code]theme_type[/code].
- Creates [code]theme_type[/code] if the theme does not have it.
+ Creates or changes the value of the icon property defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_icon] to remove the property.
</description>
</method>
<method name="set_stylebox">
@@ -473,8 +498,7 @@
<argument index="1" name="theme_type" type="StringName" />
<argument index="2" name="texture" type="StyleBox" />
<description>
- Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]theme_type[/code].
- Creates [code]theme_type[/code] if the theme does not have it.
+ Creates or changes the value of the [StyleBox] property defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_stylebox] to remove the property.
</description>
</method>
<method name="set_theme_item">
@@ -484,9 +508,9 @@
<argument index="2" name="theme_type" type="StringName" />
<argument index="3" name="value" type="Variant" />
<description>
- Sets the theme item of [code]data_type[/code] to [code]value[/code] at [code]name[/code] in [code]theme_type[/code].
- Does nothing if the [code]value[/code] type does not match [code]data_type[/code].
- Creates [code]theme_type[/code] if the theme does not have it.
+ Creates or changes the value of the theme property of [code]data_type[/code] defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_theme_item] to remove the property.
+ Fails if the [code]value[/code] type is not accepted by [code]data_type[/code].
+ [b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
</description>
</method>
<method name="set_type_variation">
@@ -494,25 +518,25 @@
<argument index="0" name="theme_type" type="StringName" />
<argument index="1" name="base_type" type="StringName" />
<description>
- Marks [code]theme_type[/code] as being a variation of [code]base_type[/code].
+ Marks [code]theme_type[/code] as a variation of [code]base_type[/code].
This adds [code]theme_type[/code] as a suggested option for [member Control.theme_type_variation] on a [Control] that is of the [code]base_type[/code] class.
- Variations can also be nested, i.e. [code]base_type[/code] can be another variation. If a chain of variations ends with a [code]base_type[/code] matching a class of a [Control], the whole chain is going to be suggested as options.
- [b]Note:[/b] Suggestions only show up if this [Theme] is set as the project default theme. See [member ProjectSettings.gui/theme/custom].
+ Variations can also be nested, i.e. [code]base_type[/code] can be another variation. If a chain of variations ends with a [code]base_type[/code] matching the class of the [Control], the whole chain is going to be suggested as options.
+ [b]Note:[/b] Suggestions only show up if this theme resource is set as the project default theme. See [member ProjectSettings.gui/theme/custom].
</description>
</method>
</methods>
<members>
<member name="default_base_scale" type="float" setter="set_default_base_scale" getter="get_default_base_scale" default="0.0">
- The default base scale factor of this [Theme] resource. Used by some controls to scale their visual properties based on a global scale factor. If this value is set to [code]0.0[/code], the global scale factor is used.
+ The default base scale factor of this theme resource. Used by some controls to scale their visual properties based on the global scale factor. If this value is set to [code]0.0[/code], the global scale factor is used.
Use [method has_default_base_scale] to check if this value is valid.
</member>
<member name="default_font" type="Font" setter="set_default_font" getter="get_default_font">
- The default font of this [Theme] resource. Used as a fallback value for font items defined in this theme, but having invalid values. If this value is also invalid, the global default value is used.
+ The default font of this theme resource. Used as the default value when trying to fetch a font resource that doesn't exist in this theme or is in invalid state. If the default font is also missing or invalid, the engine fallback value is used.
Use [method has_default_font] to check if this value is valid.
</member>
<member name="default_font_size" type="int" setter="set_default_font_size" getter="get_default_font_size" default="-1">
- The default font size of this [Theme] resource. Used as a fallback value for font size items defined in this theme, but having invalid values. If this value is set to [code]-1[/code], the global default value is used.
- Use [method has_default_font_size] to check if this value is valid.
+ The default font size of this theme resource. Used as the default value when trying to fetch a font size value that doesn't exist in this theme or is in invalid state. If the default font size is also missing or invalid, the engine fallback value is used.
+ Values below [code]0[/code] are invalid and can be used to unset the property. Use [method has_default_font_size] to check if this value is valid.
</member>
</members>
<constants>
diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml
index c90cb2987c..6ece42da6b 100644
--- a/doc/classes/TranslationServer.xml
+++ b/doc/classes/TranslationServer.xml
@@ -91,6 +91,13 @@
Returns readable script name for the [code]script[/code] code.
</description>
</method>
+ <method name="get_tool_locale">
+ <return type="String" />
+ <description>
+ Returns the current locale of the editor.
+ [b]Note:[/b] When called from an exported project returns the same value as [method get_locale].
+ </description>
+ </method>
<method name="get_translation_object">
<return type="Translation" />
<argument index="0" name="locale" type="String" />
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index 766c740a2c..4b051c4938 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -240,6 +240,7 @@
<method name="scroll_to_item">
<return type="void" />
<argument index="0" name="item" type="TreeItem" />
+ <argument index="1" name="center_on_item" type="bool" default="false" />
<description>
Causes the [Tree] to jump to the specified [TreeItem].
</description>
diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml
index 721c73d603..d7e010cc53 100644
--- a/doc/classes/Vector2i.xml
+++ b/doc/classes/Vector2i.xml
@@ -174,12 +174,12 @@
</description>
</operator>
<operator name="operator *">
- <return type="Vector2i" />
+ <return type="Vector2" />
<argument index="0" name="right" type="float" />
<description>
- Multiplies each component of the [Vector2i] by the given [float] truncated to an integer.
+ Multiplies each component of the [Vector2i] by the given [float]. Returns a [Vector2].
[codeblock]
- print(Vector2i(10, 20) * 0.9) # Prints "(0, 0)"
+ print(Vector2i(10, 15) * 0.9) # Prints "(9, 13.5)"
[/codeblock]
</description>
</operator>
@@ -221,10 +221,10 @@
</description>
</operator>
<operator name="operator /">
- <return type="Vector2i" />
+ <return type="Vector2" />
<argument index="0" name="right" type="float" />
<description>
- Divides each component of the [Vector2i] by the given [float] truncated to an integer.
+ Divides each component of the [Vector2i] by the given [float]. Returns a [Vector2].
[codeblock]
print(Vector2i(10, 20) / 2.9) # Prints "(5, 10)"
[/codeblock]
diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml
index da729e1ec2..e0b8a53a3c 100644
--- a/doc/classes/Vector3i.xml
+++ b/doc/classes/Vector3i.xml
@@ -48,6 +48,7 @@
<method name="abs" qualifiers="const">
<return type="Vector3i" />
<description>
+ Returns a new vector with all components in absolute values (i.e. positive).
</description>
</method>
<method name="clamp" qualifiers="const">
@@ -180,12 +181,12 @@
</description>
</operator>
<operator name="operator *">
- <return type="Vector3i" />
+ <return type="Vector3" />
<argument index="0" name="right" type="float" />
<description>
- Multiplies each component of the [Vector3i] by the given [float] truncated to an integer.
+ Multiplies each component of the [Vector3i] by the given [float]. Returns a [Vector3].
[codeblock]
- print(Vector3i(10, 20, 30) * 0.9) # Prints "(0, 0, 0)"
+ print(Vector3i(10, 15, 20) * 0.9) # Prints "(9, 13.5, 18)"
[/codeblock]
</description>
</operator>
@@ -227,10 +228,10 @@
</description>
</operator>
<operator name="operator /">
- <return type="Vector3i" />
+ <return type="Vector3" />
<argument index="0" name="right" type="float" />
<description>
- Divides each component of the [Vector3i] by the given [float] truncated to an integer.
+ Divides each component of the [Vector3i] by the given [float]. Returns a [Vector3].
[codeblock]
print(Vector3i(10, 20, 30) / 2.9) # Prints "(5, 10, 15)"
[/codeblock]
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 1b37cab68e..7a60ca9fa6 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -55,7 +55,7 @@
<method name="get_mouse_position" qualifiers="const">
<return type="Vector2" />
<description>
- Returns the mouse position relative to the viewport.
+ Returns the mouse's positon in this [Viewport] using the coordinate system of this [Viewport].
</description>
</method>
<method name="get_render_info">
@@ -180,7 +180,7 @@
<return type="void" />
<argument index="0" name="to_position" type="Vector2" />
<description>
- Warps the mouse to a position relative to the viewport.
+ Moves the mouse pointer to the specified position in this [Viewport] using the coordinate system of this [Viewport].
</description>
</method>
</methods>
diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml
index 0067240820..332620f915 100644
--- a/doc/classes/VisualShaderNode.xml
+++ b/doc/classes/VisualShaderNode.xml
@@ -75,7 +75,7 @@
<constant name="PORT_TYPE_VECTOR_2D" value="2" enum="PortType">
2D vector of floating-point values. Translated to [code]vec2[/code] type in shader code.
</constant>
- <constant name="PORT_TYPE_VECTOR" value="3" enum="PortType">
+ <constant name="PORT_TYPE_VECTOR_3D" value="3" enum="PortType">
3D vector of floating-point values. Translated to [code]vec3[/code] type in shader code.
</constant>
<constant name="PORT_TYPE_BOOLEAN" value="4" enum="PortType">
diff --git a/doc/classes/VisualShaderNodeParticleRandomness.xml b/doc/classes/VisualShaderNodeParticleRandomness.xml
index 2dec41105c..880208b136 100644
--- a/doc/classes/VisualShaderNodeParticleRandomness.xml
+++ b/doc/classes/VisualShaderNodeParticleRandomness.xml
@@ -8,14 +8,20 @@
</tutorials>
<members>
<member name="op_type" type="int" setter="set_op_type" getter="get_op_type" enum="VisualShaderNodeParticleRandomness.OpType" default="0">
+ A type of operands and returned value.
</member>
</members>
<constants>
<constant name="OP_TYPE_SCALAR" value="0" enum="OpType">
+ A floating-point scalar.
</constant>
- <constant name="OP_TYPE_VECTOR" value="1" enum="OpType">
+ <constant name="OP_TYPE_VECTOR_2D" value="1" enum="OpType">
+ A 2D vector type.
</constant>
- <constant name="OP_TYPE_MAX" value="2" enum="OpType">
+ <constant name="OP_TYPE_VECTOR_3D" value="2" enum="OpType">
+ A 3D vector type.
+ </constant>
+ <constant name="OP_TYPE_MAX" value="3" enum="OpType">
Represents the size of the [enum OpType] enum.
</constant>
</constants>
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index 3bb6603646..ab8f51ced5 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -398,6 +398,11 @@
Fullscreen window mode. Note that this is not [i]exclusive[/i] fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
</constant>
+ <constant name="MODE_EXCLUSIVE_FULLSCREEN" value="4" enum="Mode">
+ Exclusive fullscreen window mode. This mode is implemented on Windows only. On other platforms, it is equivalent to [constant MODE_FULLSCREEN].
+ Only one window in exclusive fullscreen mode can be visible on a given screen at a time. If multiple windows are in exclusive fullscreen mode for the same screen, the last one being set to this mode takes precedence.
+ Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
+ </constant>
<constant name="FLAG_RESIZE_DISABLED" value="0" enum="Flags">
The window's ability to be resized.
</constant>
diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml
index 49f2d2dd7f..243d19d94f 100644
--- a/doc/classes/bool.xml
+++ b/doc/classes/bool.xml
@@ -52,7 +52,7 @@
[codeblocks]
[gdscript]
var _can_shoot = true
- onready var _cool_down = $CoolDownTimer
+ @onready var _cool_down = $CoolDownTimer
func shoot():
if _can_shoot and Input.is_action_pressed("shoot"):
diff --git a/doc/classes/float.xml b/doc/classes/float.xml
index 9effe9d5bf..2dae7275b5 100644
--- a/doc/classes/float.xml
+++ b/doc/classes/float.xml
@@ -89,12 +89,12 @@
</description>
</operator>
<operator name="operator *">
- <return type="Vector2i" />
+ <return type="Vector2" />
<argument index="0" name="right" type="Vector2i" />
<description>
- Multiplies each component of the [Vector2i] by the given [float] truncated to an integer.
+ Multiplies each component of the [Vector2i] by the given [float]. Returns a [Vector2].
[codeblock]
- print(0.9 * Vector2i(10, 20)) # Prints "(0, 0)"
+ print(0.9 * Vector2i(10, 15)) # Prints "(9, 13.5)"
[/codeblock]
</description>
</operator>
@@ -106,12 +106,12 @@
</description>
</operator>
<operator name="operator *">
- <return type="Vector3i" />
+ <return type="Vector3" />
<argument index="0" name="right" type="Vector3i" />
<description>
- Multiplies each component of the [Vector3i] by the given [float] truncated to an integer.
+ Multiplies each component of the [Vector3i] by the given [float]. Returns a [Vector3].
[codeblock]
- print(0.9 * Vector3i(10, 20, 30)) # Prints "(0, 0, 0)"
+ print(0.9 * Vector3i(10, 15, 20)) # Prints "(9, 13.5, 18)"
[/codeblock]
</description>
</operator>
diff --git a/doc/classes/int.xml b/doc/classes/int.xml
index d212fe42bf..006dc7eb29 100644
--- a/doc/classes/int.xml
+++ b/doc/classes/int.xml
@@ -177,6 +177,13 @@
</description>
</operator>
<operator name="operator +">
+ <return type="String" />
+ <argument index="0" name="right" type="String" />
+ <description>
+ Adds Unicode character with code [int] to the [String].
+ </description>
+ </operator>
+ <operator name="operator +">
<return type="float" />
<argument index="0" name="right" type="float" />
<description>