summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2023-04-04 00:18:49 +0200
committerGitHub <noreply@github.com>2023-04-04 00:18:49 +0200
commitbd016c8c4d51febb6b4da52a22ff7357ac400daa (patch)
treed7ab47b4816e9808da2928b3b8fd779b0b04cf3b /doc
parente243dfa9f6fd68740d6ae7bba02ae0114e791543 (diff)
parent0a8fdde9241c495a1a3b5f58c78910c9eaa12dee (diff)
Merge pull request #75624 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.2) - 3rd batch
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/CanvasItem.xml7
-rw-r--r--doc/classes/ConeTwistJoint3D.xml2
-rw-r--r--doc/classes/EditorUndoRedoManager.xml2
-rw-r--r--doc/classes/FileSystemDock.xml12
-rw-r--r--doc/classes/InputEventFromWindow.xml3
-rw-r--r--doc/classes/InputEventGesture.xml1
-rw-r--r--doc/classes/InputEventMagnifyGesture.xml3
-rw-r--r--doc/classes/InputEventPanGesture.xml3
-rw-r--r--doc/classes/InputEventShortcut.xml3
-rw-r--r--doc/classes/Node.xml20
-rw-r--r--doc/classes/Node3D.xml3
-rw-r--r--doc/classes/OS.xml2
-rw-r--r--doc/classes/Polygon2D.xml3
-rw-r--r--doc/classes/ProjectSettings.xml3
-rw-r--r--doc/classes/RenderingServer.xml42
-rw-r--r--doc/classes/UndoRedo.xml31
-rw-r--r--doc/classes/Viewport.xml2
17 files changed, 125 insertions, 17 deletions
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index f99d90d32c..572963b406 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -569,13 +569,14 @@
The rendering layers in which this [CanvasItem] responds to [Light2D] nodes.
</member>
<member name="material" type="Material" setter="set_material" getter="get_material">
- The material applied to textures on this [CanvasItem].
+ The material applied to this [CanvasItem].
</member>
<member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)">
- The color applied to textures on this [CanvasItem].
+ The color applied to this [CanvasItem]. This property does affect child [CanvasItem]s, unlike [member self_modulate] which only affects the node itself.
</member>
<member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate" default="Color(1, 1, 1, 1)">
- The color applied to textures on this [CanvasItem]. This is not inherited by children [CanvasItem]s.
+ The color applied to this [CanvasItem]. This property does [b]not[/b] affect child [CanvasItem]s, unlike [member modulate] which affects both the node itself and its children.
+ [b]Note:[/b] Internal children (e.g. sliders in [ColorPicker] or tab bar in [TabContainer]) are also not affected by this property (see [code]include_internal[/code] parameter of [method Node.get_child] and other similar methods).
</member>
<member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled" default="false">
If [code]true[/code], the object draws behind its parent.
diff --git a/doc/classes/ConeTwistJoint3D.xml b/doc/classes/ConeTwistJoint3D.xml
index 1cfe9d197d..ee68b156d7 100644
--- a/doc/classes/ConeTwistJoint3D.xml
+++ b/doc/classes/ConeTwistJoint3D.xml
@@ -15,6 +15,7 @@
<return type="float" />
<param index="0" name="param" type="int" enum="ConeTwistJoint3D.Param" />
<description>
+ Returns the value of the specified parameter.
</description>
</method>
<method name="set_param">
@@ -22,6 +23,7 @@
<param index="0" name="param" type="int" enum="ConeTwistJoint3D.Param" />
<param index="1" name="value" type="float" />
<description>
+ Sets the value of the specified parameter.
</description>
</method>
</methods>
diff --git a/doc/classes/EditorUndoRedoManager.xml b/doc/classes/EditorUndoRedoManager.xml
index 4d6938e6aa..bf2acd0805 100644
--- a/doc/classes/EditorUndoRedoManager.xml
+++ b/doc/classes/EditorUndoRedoManager.xml
@@ -10,6 +10,8 @@
- If the object is a built-in resource, use the scene from its path;
- If the object is external resource or anything else, use global history.
This guessing can sometimes yield false results, so you can provide a custom context object when creating an action.
+ [EditorUndoRedoManager] is intended to be used by Godot editor plugins. You can obtain it using [method EditorPlugin.get_undo_redo]. For non-editor uses or plugins that don't need to integrate with the editor's undo history, use [UndoRedo] instead.
+ The manager's API is mostly the same as in [UndoRedo], so you can refer to its documentation for more examples. The main difference is that [EditorUndoRedoManager] uses object + method name for actions, instead of [Callable].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/FileSystemDock.xml b/doc/classes/FileSystemDock.xml
index f76bc2c279..f549695e72 100644
--- a/doc/classes/FileSystemDock.xml
+++ b/doc/classes/FileSystemDock.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="FileSystemDock" inherits="VBoxContainer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
+ Editor dock for managing files in the project.
</brief_description>
<description>
+ This class is available only in [EditorPlugin]s and can't be instantiated. You can access it using [method EditorInterface.get_file_system_dock].
+ While FileSystemDock doesn't expose any methods for file manipulation, you can listen for various file-related signals.
</description>
<tutorials>
</tutorials>
@@ -11,49 +14,58 @@
<return type="void" />
<param index="0" name="path" type="String" />
<description>
+ Sets the given [param path] as currently selected, ensuring that the selected file/directory is visible.
</description>
</method>
</methods>
<signals>
<signal name="display_mode_changed">
<description>
+ Emitted when the user switches file display mode or split mode.
</description>
</signal>
<signal name="file_removed">
<param index="0" name="file" type="String" />
<description>
+ Emitted when the given [param file] was removed.
</description>
</signal>
<signal name="files_moved">
<param index="0" name="old_file" type="String" />
<param index="1" name="new_file" type="String" />
<description>
+ Emitted when a file is moved from [param old_file] path to [param new_file] path.
</description>
</signal>
<signal name="folder_moved">
<param index="0" name="old_folder" type="String" />
<param index="1" name="new_folder" type="String" />
<description>
+ Emitted when a folder is moved from [param old_folder] path to [param new_folder] path.
</description>
</signal>
<signal name="folder_removed">
<param index="0" name="folder" type="String" />
<description>
+ Emitted when the given [param folder] was removed.
</description>
</signal>
<signal name="inherit">
<param index="0" name="file" type="String" />
<description>
+ Emitted when a new scene is created that inherits the scene at [param file] path.
</description>
</signal>
<signal name="instantiate">
<param index="0" name="files" type="PackedStringArray" />
<description>
+ Emitted when the given scenes are being instantiated in the editor.
</description>
</signal>
<signal name="resource_removed">
<param index="0" name="resource" type="Resource" />
<description>
+ Emitted when an external [param resource] had its file removed.
</description>
</signal>
</signals>
diff --git a/doc/classes/InputEventFromWindow.xml b/doc/classes/InputEventFromWindow.xml
index adbf8ccc08..24b084bb5d 100644
--- a/doc/classes/InputEventFromWindow.xml
+++ b/doc/classes/InputEventFromWindow.xml
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="InputEventFromWindow" inherits="InputEvent" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
+ Base class for [Viewport]-based input events.
</brief_description>
<description>
+ InputEventFromWindow represents events specifically received by windows. This includes mouse events, keyboard events in focused windows or touch screen actions.
</description>
<tutorials>
</tutorials>
<members>
<member name="window_id" type="int" setter="set_window_id" getter="get_window_id" default="0">
+ The ID of a [Window] that received this event.
</member>
</members>
</class>
diff --git a/doc/classes/InputEventGesture.xml b/doc/classes/InputEventGesture.xml
index 85d1a405b2..578faab6b5 100644
--- a/doc/classes/InputEventGesture.xml
+++ b/doc/classes/InputEventGesture.xml
@@ -4,6 +4,7 @@
Base class for touch control gestures.
</brief_description>
<description>
+ InputEventGesture is sent when a user performs a supported gesture on a touch screen. Gestures can't be emulated using mouse, because they typically require multi-touch.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/InputEventMagnifyGesture.xml b/doc/classes/InputEventMagnifyGesture.xml
index 2063dfda6c..838809423f 100644
--- a/doc/classes/InputEventMagnifyGesture.xml
+++ b/doc/classes/InputEventMagnifyGesture.xml
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="InputEventMagnifyGesture" inherits="InputEventGesture" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
+ [InputEvent] that represents a magnifying touch gesture.
</brief_description>
<description>
+ Magnify gesture is performed when the user pinches the touch screen. It's typically used for zooming.
</description>
<tutorials>
</tutorials>
<members>
<member name="factor" type="float" setter="set_factor" getter="get_factor" default="1.0">
+ The amount (or delta) of the event. This value is higher the faster the gesture is performed.
</member>
</members>
</class>
diff --git a/doc/classes/InputEventPanGesture.xml b/doc/classes/InputEventPanGesture.xml
index deb76d5d38..e276f68cc3 100644
--- a/doc/classes/InputEventPanGesture.xml
+++ b/doc/classes/InputEventPanGesture.xml
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="InputEventPanGesture" inherits="InputEventGesture" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
+ [InputEvent] that represents a panning touch gesture.
</brief_description>
<description>
+ Pan gesture is performed when the user swipes the touch screen with two fingers. It's typically used for panning/scrolling.
</description>
<tutorials>
</tutorials>
<members>
<member name="delta" type="Vector2" setter="set_delta" getter="get_delta" default="Vector2(0, 0)">
+ Panning amount since last pan event.
</member>
</members>
</class>
diff --git a/doc/classes/InputEventShortcut.xml b/doc/classes/InputEventShortcut.xml
index 58b44132bb..93c1e84be3 100644
--- a/doc/classes/InputEventShortcut.xml
+++ b/doc/classes/InputEventShortcut.xml
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="InputEventShortcut" inherits="InputEvent" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
+ [InputEvent] that signifies a triggered keyboard [Shortcut].
</brief_description>
<description>
+ InputEventShortcut is a special event that can be received in [method Node._unhandled_key_input]. It's typically sent by the editor's Command Palette to trigger actions, but can also be sent manually using [method Viewport.push_unhandled_input].
</description>
<tutorials>
</tutorials>
<members>
<member name="shortcut" type="Shortcut" setter="set_shortcut" getter="get_shortcut">
+ The [Shortcut] represented by this event. Its [method Shortcut.matches_event] method will always return [code]true[/code] for this event.
</member>
</members>
</class>
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index d904d20335..62d708618a 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -42,6 +42,18 @@
The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a [code]tool[/code] script.
Returning an empty array produces no warnings.
Call [method update_configuration_warnings] when the warnings need to be updated for this node.
+ [codeblock]
+ @export var energy = 0:
+ set(value):
+ energy = value
+ update_configuration_warnings()
+
+ func _get_configuration_warnings():
+ if energy &lt; 0:
+ return ["Energy must be 0 or greater."]
+ else:
+ return []
+ [/codeblock]
</description>
</method>
<method name="_input" qualifiers="virtual">
@@ -127,7 +139,7 @@
<description>
Adds a child [param node]. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
If [param force_readable_name] is [code]true[/code], improves the readability of the added [param node]. If not named, the [param node] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to [code]false[/code], which assigns a dummy name featuring [code]@[/code] in both situations.
- If [param internal] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. Such nodes are ignored by methods like [method get_children], unless their parameter [code]include_internal[/code] is [code]true[/code].The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes.
+ If [param internal] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. Such nodes are ignored by methods like [method get_children], unless their parameter [code]include_internal[/code] is [code]true[/code]. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes.
[b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example:
[codeblocks]
[gdscript]
@@ -206,7 +218,7 @@
<param index="1" name="recursive" type="bool" default="true" />
<param index="2" name="owned" type="bool" default="true" />
<description>
- Finds the first descendant of this node whose name matches [param pattern] as in [method String.match].
+ Finds the first descendant of this node whose name matches [param pattern] as in [method String.match]. Internal children are also searched over (see [code]internal[/code] parameter in [method add_child]).
[param pattern] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]).
If [param recursive] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [param recursive] is [code]false[/code], only this node's direct children are matched.
If [param owned] is [code]true[/code], this method only finds nodes who have an assigned [member Node.owner]. This is especially important for scenes instantiated through a script, because those scenes don't have an owner.
@@ -222,7 +234,7 @@
<param index="2" name="recursive" type="bool" default="true" />
<param index="3" name="owned" type="bool" default="true" />
<description>
- Finds descendants of this node whose name matches [param pattern] as in [method String.match], and/or type matches [param type] as in [method Object.is_class].
+ Finds descendants of this node whose name matches [param pattern] as in [method String.match], and/or type matches [param type] as in [method Object.is_class]. Internal children are also searched over (see [code]internal[/code] parameter in [method add_child]).
[param pattern] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]).
[param type] will check equality or inheritance, and is case-sensitive. [code]"Object"[/code] will match a node whose type is [code]"Node"[/code] but not the other way around.
If [param recursive] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [param recursive] is [code]false[/code], only this node's direct children are matched.
@@ -942,8 +954,10 @@
Specific to the Android platform.
</constant>
<constant name="NOTIFICATION_WM_SIZE_CHANGED" value="1008">
+ Notification received from the OS when the window is resized.
</constant>
<constant name="NOTIFICATION_WM_DPI_CHANGE" value="1009">
+ Notification received from the OS when the screen's DPI has been changed. Only implemented on macOS.
</constant>
<constant name="NOTIFICATION_VP_MOUSE_ENTER" value="1010">
Notification received when the mouse enters the viewport.
diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml
index 61e5c44251..581cb68c92 100644
--- a/doc/classes/Node3D.xml
+++ b/doc/classes/Node3D.xml
@@ -344,10 +344,13 @@
In order for [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] to work, users first need to ask for it, with [method set_notify_local_transform].
</constant>
<constant name="ROTATION_EDIT_MODE_EULER" value="0" enum="RotationEditMode">
+ The rotation is edited using [Vector3] Euler angles.
</constant>
<constant name="ROTATION_EDIT_MODE_QUATERNION" value="1" enum="RotationEditMode">
+ The rotation is edited using a [Quaternion].
</constant>
<constant name="ROTATION_EDIT_MODE_BASIS" value="2" enum="RotationEditMode">
+ The rotation is edited using a [Basis]. In this mode, [member scale] can't be edited separately.
</constant>
</constants>
</class>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 92ee2fb40b..10818e0dec 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -4,7 +4,7 @@
Operating System functions.
</brief_description>
<description>
- Operating System functions. [OS] wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, delays, environment variables, execution of binaries, command line, etc.
+ Operating System functions. [OS] wraps the most common functionality to communicate with the host operating system, such as the video driver, delays, environment variables, execution of binaries, command line, etc.
[b]Note:[/b] In Godot 4, [OS] functions related to window management were moved to the [DisplayServer] singleton.
</description>
<tutorials>
diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml
index a3fc326351..4f24800647 100644
--- a/doc/classes/Polygon2D.xml
+++ b/doc/classes/Polygon2D.xml
@@ -72,11 +72,13 @@
If [code]true[/code], polygon edges will be anti-aliased.
</member>
<member name="bones" type="Array" setter="_set_bones" getter="_get_bones" default="[]">
+ Internal list of [Bone2D] nodes used by the assigned [member skeleton]. Edited using the Polygon2D editor ("UV" button on the top toolbar).
</member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)">
The polygon's fill color. If [code]texture[/code] is defined, it will be multiplied by this color. It will also be the default color for vertices not set in [code]vertex_colors[/code].
</member>
<member name="internal_vertex_count" type="int" setter="set_internal_vertex_count" getter="get_internal_vertex_count" default="0">
+ Number of internal vertices, used for UV mapping.
</member>
<member name="invert_border" type="float" setter="set_invert_border" getter="get_invert_border" default="100.0">
Added padding applied to the bounding box when [member invert_enabled] is set to [code]true[/code]. Setting this value too small may result in a "Bad Polygon" error.
@@ -95,6 +97,7 @@
The list of polygons, in case more than one is being represented. Every individual polygon is stored as a [PackedInt32Array] where each [int] is an index to a point in [member polygon]. If empty, this property will be ignored, and the resulting single polygon will be composed of all points in [member polygon], using the order they are stored in.
</member>
<member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath(&quot;&quot;)">
+ Path to a [Skeleton2D] node used for skeleton-based deformations of this polygon. If empty or invalid, skeletal deformations will not be used.
</member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
The polygon's fill texture. Use [code]uv[/code] to set texture coordinates.
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 120dda92c4..78b7e073c7 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -1958,8 +1958,10 @@
<member name="rendering/2d/shadow_atlas/size" type="int" setter="" getter="" default="2048">
</member>
<member name="rendering/2d/snap/snap_2d_transforms_to_pixel" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], [CanvasItem] nodes will internally snap to full pixels. Their position can still be sub-pixel, but the decimals will not have effect.
</member>
<member name="rendering/2d/snap/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], vertices of [CanvasItem] nodes will snap to full pixels. Only affects the final vertex positions, not the transforms.
</member>
<member name="rendering/anti_aliasing/quality/msaa_2d" type="int" setter="" getter="" default="0">
Sets the number of MSAA samples to use for 2D/Canvas rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware. This has no effect on shader-induced aliasing or texture aliasing.
@@ -2416,6 +2418,7 @@
<member name="threading/worker_pool/low_priority_thread_ratio" type="float" setter="" getter="" default="0.3">
</member>
<member name="threading/worker_pool/max_threads" type="int" setter="" getter="" default="-1">
+ Maximum number of threads to be used by [WorkerThreadPool]. Value of [code]-1[/code] means no limit.
</member>
<member name="threading/worker_pool/use_system_threads_for_low_priority_tasks" type="bool" setter="" getter="" default="true">
</member>
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 2ba8e40ce2..ec338cb729 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -33,6 +33,7 @@
<description>
Creates a camera attributes object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_attributes_[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ This is the internal equivalent of the [CameraAttributes] resource.
</description>
</method>
<method name="camera_attributes_set_auto_exposure">
@@ -100,6 +101,7 @@
<description>
Creates a camera and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ This is the internal equivalent of the [Camera3D] node.
</description>
</method>
<method name="camera_set_camera_attributes">
@@ -178,6 +180,7 @@
<description>
Creates a canvas and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ Canvas has no [Resource] or [Node] equivalent.
</description>
</method>
<method name="canvas_item_add_animation_slice">
@@ -350,6 +353,7 @@
<param index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="5" name="transpose" type="bool" default="false" />
<description>
+ Draws a 2D textured rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_texture_rect] and [method Texture2D.draw_rect].
</description>
</method>
<method name="canvas_item_add_texture_rect_region">
@@ -362,6 +366,7 @@
<param index="5" name="transpose" type="bool" default="false" />
<param index="6" name="clip_uv" type="bool" default="true" />
<description>
+ Draws the specified region of a 2D textured rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_texture_rect_region] and [method Texture2D.draw_rect_region].
</description>
</method>
<method name="canvas_item_add_triangle_array">
@@ -388,7 +393,9 @@
<method name="canvas_item_create">
<return type="RID" />
<description>
- Creates a new [CanvasItem] instance and returns its [RID].
+ Creates a canvas item and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_item_*[/code] RenderingServer functions.
+ Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ This is the internal equivalent of the [CanvasItem] node.
</description>
</method>
<method name="canvas_item_set_canvas_group_mode">
@@ -482,6 +489,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="color" type="Color" />
<description>
+ Sets a color modulation to the [CanvasItem]. This also affects child canvas items.
</description>
</method>
<method name="canvas_item_set_parent">
@@ -489,6 +497,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="parent" type="RID" />
<description>
+ Sets a parent [CanvasItem] to the [CanvasItem]. The item will inherit transform, modulation and visibility from its parent, like [CanvasItem] nodes in the scene tree.
</description>
</method>
<method name="canvas_item_set_self_modulate">
@@ -496,6 +505,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="color" type="Color" />
<description>
+ Sets a color self-modulation to the [CanvasItem]. It does not affect the child canvas items.
</description>
</method>
<method name="canvas_item_set_sort_children_by_y">
@@ -503,6 +513,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
+ Enables or disables Y-sorting of a [CanvasItem].
</description>
</method>
<method name="canvas_item_set_transform">
@@ -510,6 +521,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="transform" type="Transform2D" />
<description>
+ Sets the transform of the [CanvasItem]. It affects where and how the item will be drawn. Child canvas items' transforms are multiplied by their parent's transform.
</description>
</method>
<method name="canvas_item_set_use_parent_material">
@@ -536,6 +548,8 @@
<param index="3" name="enter_callable" type="Callable" />
<param index="4" name="exit_callable" type="Callable" />
<description>
+ Sets the given [CanvasItem] as visibility notifier. [param area] defines the area of detecting visibility. [param enter_callable] is called when the [CanvasItem] enters the screen, [param exit_callable] is called when the [CanvasItem] exits the screen. If [param enable] is [code]false[/code], the item will no longer function as notifier.
+ This method can be used to manually mimic [VisibleOnScreenNotifier2D].
</description>
</method>
<method name="canvas_item_set_visible">
@@ -543,6 +557,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="visible" type="bool" />
<description>
+ Sets the visibility of the [CanvasItem].
</description>
</method>
<method name="canvas_item_set_z_as_relative_to_parent">
@@ -832,6 +847,9 @@
<method name="canvas_texture_create">
<return type="RID" />
<description>
+ Creates a canvas texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_texture_*[/code] RenderingServer functions.
+ Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ This is the internal equivalent of the [CanvasTexture] resource.
</description>
</method>
<method name="canvas_texture_set_channel">
@@ -855,6 +873,7 @@
<param index="0" name="canvas_texture" type="RID" />
<param index="1" name="filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" />
<description>
+ Sets the texture filter used by the [CanvasTexture].
</description>
</method>
<method name="canvas_texture_set_texture_repeat">
@@ -862,6 +881,7 @@
<param index="0" name="canvas_texture" type="RID" />
<param index="1" name="repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" />
<description>
+ Sets the texture repeat used by the [CanvasTexture].
</description>
</method>
<method name="create_local_rendering_device" qualifiers="const">
@@ -874,6 +894,9 @@
<method name="decal_create">
<return type="RID" />
<description>
+ Creates a decal and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]decal_*[/code] RenderingServer functions.
+ Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ This is the internal equivalent of the [Decal] node.
</description>
</method>
<method name="decal_set_albedo_mix">
@@ -919,6 +942,7 @@
<param index="0" name="decal" type="RID" />
<param index="1" name="color" type="Color" />
<description>
+ Sets the color modulation of the [Decal].
</description>
</method>
<method name="decal_set_normal_fade">
@@ -933,6 +957,7 @@
<param index="0" name="decal" type="RID" />
<param index="1" name="size" type="Vector3" />
<description>
+ Sets the size of the [Decal].
</description>
</method>
<method name="decal_set_texture">
@@ -941,6 +966,7 @@
<param index="1" name="type" type="int" enum="RenderingServer.DecalTexture" />
<param index="2" name="texture" type="RID" />
<description>
+ Sets the texture of the [Decal].
</description>
</method>
<method name="decals_set_filter">
@@ -955,6 +981,7 @@
Creates a directional light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
To place in a scene, attach this directional light to an instance using [method instance_set_base] using the returned RID.
+ This is the internal equivalent of the [DirectionalLight3D] node.
</description>
</method>
<method name="directional_shadow_atlas_set_size">
@@ -983,6 +1010,7 @@
<description>
Creates an environment and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]environment_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ This is the internal equivalent of the [Environment] resource.
</description>
</method>
<method name="environment_glow_set_use_bicubic_upscale">
@@ -1244,7 +1272,9 @@
<method name="fog_volume_create">
<return type="RID" />
<description>
- Creates a new fog volume and allocates an RID.
+ Creates a fog volume and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]fog_volume_*[/code] RenderingServer functions.
+ Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ This is the internal equivalent of the [FogVolume] node.
</description>
</method>
<method name="fog_volume_set_material">
@@ -1461,6 +1491,7 @@
Creates a visual instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using [method instance_set_base].
+ This is the internal equivalent of the [VisualInstance3D] node.
</description>
</method>
<method name="instance_create2">
@@ -1821,7 +1852,9 @@
<method name="lightmap_create">
<return type="RID" />
<description>
- Creates a new [LightmapGI] instance.
+ Creates a lightmap GI and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions.
+ Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ This is the internal equivalent of the [LightmapGI] node.
</description>
</method>
<method name="lightmap_get_probe_capture_bsp_tree" qualifiers="const">
@@ -1908,6 +1941,7 @@
<description>
Creates an empty material and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]material_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
+ This is the internal equivalent of the [Material] resource.
</description>
</method>
<method name="material_get_param" qualifiers="const">
@@ -1982,6 +2016,7 @@
Creates a new mesh and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]mesh_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
To place in a scene, attach this mesh to an instance using [method instance_set_base] using the returned RID.
+ This is the internal equivalent of the [Mesh] resource.
</description>
</method>
<method name="mesh_create_from_surfaces">
@@ -2154,6 +2189,7 @@
Creates a new multimesh on the RenderingServer and returns an [RID] handle. This RID will be used in all [code]multimesh_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
To place in a scene, attach this multimesh to an instance using [method instance_set_base] using the returned RID.
+ This is the internal equivalent of the [MultiMesh] resource.
</description>
</method>
<method name="multimesh_get_aabb" qualifiers="const">
diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml
index e43bceb941..3365806b4c 100644
--- a/doc/classes/UndoRedo.xml
+++ b/doc/classes/UndoRedo.xml
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="UndoRedo" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Helper to manage undo/redo operations in the editor or custom tools.
+ General-purpose helper to manage undo/redo operations.
</brief_description>
<description>
- Helper to manage undo/redo operations in the editor or custom tools. It works by registering methods and property changes inside "actions".
+ UndoRedo works by registering methods and property changes inside "actions".
Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action.
- Here's an example on how to add an action to the Godot editor's own [UndoRedo], from a plugin:
+ Here's an example on how to add an UndoRedo action:
[codeblocks]
[gdscript]
- var undo_redo = get_undo_redo() # Method of EditorPlugin.
+ var undo_redo = UndoRedo.new()
func do_something():
pass # Put your code here.
@@ -20,8 +20,8 @@
func _on_my_button_pressed():
var node = get_node("MyNode2D")
undo_redo.create_action("Move the node")
- undo_redo.add_do_method(self, "do_something")
- undo_redo.add_undo_method(self, "undo_something")
+ undo_redo.add_do_method(do_something)
+ undo_redo.add_undo_method(undo_something)
undo_redo.add_do_property(node, "position", Vector2(100,100))
undo_redo.add_undo_property(node, "position", node.position)
undo_redo.commit_action()
@@ -31,7 +31,7 @@
public override void _Ready()
{
- _undoRedo = GetUndoRedo(); // Method of EditorPlugin.
+ _undoRedo = new UndoRedo();
}
public void DoSomething()
@@ -58,6 +58,7 @@
[/codeblocks]
[method create_action], [method add_do_method], [method add_undo_method], [method add_do_property], [method add_undo_property], and [method commit_action] should be called one after the other, like in the example. Not doing so could lead to crashes.
If you don't need to register a method, you can leave [method add_do_method] and [method add_undo_method] out; the same goes for properties. You can also register more than one method/property.
+ If you are making an [EditorPlugin] and want to integrate into the editor's undo history, use [EditorUndoRedoManager] instead.
</description>
<tutorials>
</tutorials>
@@ -83,6 +84,14 @@
<param index="0" name="object" type="Object" />
<description>
Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources.
+ [codeblock]
+ var node = Node2D.new()
+ undo_redo.create_action("Add node")
+ undo_redo.add_do_method(add_child.bind(node))
+ undo_redo.add_do_reference(node)
+ undo_redo.add_undo_method(remove_child.bind(node))
+ undo_redo.commit_action()
+ [/codeblock]
</description>
</method>
<method name="add_undo_method">
@@ -106,6 +115,14 @@
<param index="0" name="object" type="Object" />
<description>
Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!).
+ [codeblock]
+ var node = $Node2D
+ undo_redo.create_action("Remove node")
+ undo_redo.add_do_method(remove_child.bind(node))
+ undo_redo.add_undo_method(add_child.bind(node))
+ undo_redo.add_undo_reference(node)
+ undo_redo.commit_action()
+ [/codeblock]
</description>
</method>
<method name="clear_history">
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index e76f805e3c..8d92616d6f 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -76,6 +76,7 @@
<param index="0" name="type" type="int" enum="Viewport.RenderInfoType" />
<param index="1" name="info" type="int" enum="Viewport.RenderInfo" />
<description>
+ Returns rendering statistics of the given type. See [enum RenderInfoType] and [enum RenderInfo] for options.
</description>
</method>
<method name="get_screen_transform" qualifiers="const">
@@ -165,6 +166,7 @@
<return type="void" />
<param index="0" name="text" type="String" />
<description>
+ Helper method which calls the [code]set_text()[/code] method on the currently focused [Control], provided that it is defined (e.g. if the focused Control is [Button] or [LineEdit]).
</description>
</method>
<method name="push_unhandled_input">