diff options
Diffstat (limited to 'doc')
33 files changed, 265 insertions, 34 deletions
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index 7dcfa5345d..61e1ea9b8d 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -176,6 +176,14 @@ Returns [code]true[/code] if the [AABB] intersects the line segment between [code]from[/code] and [code]to[/code]. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="aabb" type="AABB"> + </argument> + <description> + </description> + </method> <method name="merge"> <return type="AABB"> </return> diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index e835af01e8..6304bd34f6 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -1,11 +1,23 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AStar" inherits="Reference" category="Core" version="3.2"> <brief_description> - AStar class representation that uses 3d-vectors as edges. + An implementation of A* to find shortest paths among connected points in space. </brief_description> <description> - A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting an efficiently directed path between multiple points. It enjoys widespread use due to its performance and accuracy. Godot's A* implementation make use of vectors as points. - You must add points manually with [method add_point] and create segments manually with [method connect_points]. So you can test if there is a path between two points with the [method are_points_connected] function, get the list of existing ids in the found path with [method get_id_path], or the points list with [method get_point_path]. + A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in three-dimensional space and Euclidean distances by default. + You must add points manually with [method add_point] and create segments manually with [method connect_points]. Then you can test if there is a path between two points with the [method are_points_connected] function, get a path containing indices by [method get_id_path], or one containing actual coordinates with [method get_point_path]. + It is also possible to use non-Euclidean distances. To do so, create a class that extends [code]AStar[/code] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example. + [codeblock] + class MyAStar: + extends AStar + + func _compute_cost(u, v): + return abs(u - v) + + func _estimate_cost(u, v): + return min(0, abs(u - v) - 1) + [/codeblock] + [method _estimate_cost] should return a lower bound of the distance, i.e. [code]_estimate_cost(u, v) <= _compute_cost(u, v)[/code]. This serves as a hint to the algorithm because the custom [code]_compute_cost[/code] might be computation-heavy. If this is not the case, make [method _estimate_cost] return the same value as [method _compute_cost] to provide the algorithm with the most accurate information. </description> <tutorials> </tutorials> @@ -19,6 +31,7 @@ </argument> <description> Called when computing the cost between two connected points. + Note that this function is hidden in the default [code]AStar[/code] class. </description> </method> <method name="_estimate_cost" qualifiers="virtual"> @@ -30,6 +43,7 @@ </argument> <description> Called when estimating the cost between a point and the path's ending point. + Note that this function is hidden in the default [code]AStar[/code] class. </description> </method> <method name="add_point"> @@ -57,8 +71,10 @@ </argument> <argument index="1" name="to_id" type="int"> </argument> + <argument index="2" name="bidirectional" type="bool" default="true"> + </argument> <description> - Returns whether there is a connection/segment between the given points. + Returns whether the two given points are directly connected by a segment. If [code]bidirectional[/code] is [code]false[/code], returns whether movement from [code]id[/code] to [code]to_id[/code] is possible through this segment. </description> </method> <method name="clear"> @@ -94,8 +110,10 @@ </argument> <argument index="1" name="to_id" type="int"> </argument> + <argument index="2" name="bidirectional" type="bool" default="true"> + </argument> <description> - Deletes the segment between the given points. + Deletes the segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is prevented, and a unidirectional segment possibly remains. </description> </method> <method name="get_available_point_id" qualifiers="const"> diff --git a/doc/classes/Camera.xml b/doc/classes/Camera.xml index d410800141..3b4313b204 100644 --- a/doc/classes/Camera.xml +++ b/doc/classes/Camera.xml @@ -77,10 +77,10 @@ </return> <argument index="0" name="screen_point" type="Vector2"> </argument> - <argument index="1" name="z_depth" type="float" default="0"> + <argument index="1" name="z_depth" type="float"> </argument> <description> - Returns the 3D point in worldspace that maps to the given 2D coordinate in the [Viewport] rectangle on a plane that is the given distance into the scene away from the camera. + Returns the 3D point in worldspace that maps to the given 2D coordinate in the [Viewport] rectangle on a plane that is the given [code]z_depth[/code] distance into the scene away from the camera. </description> </method> <method name="project_ray_normal" qualifiers="const"> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 46499ed349..deba30712e 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -151,6 +151,14 @@ [/codeblock] </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="color" type="Color"> + </argument> + <description> + </description> + </method> <method name="lightened"> <return type="Color"> </return> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index f5a8683a39..75d5a72fb1 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -652,7 +652,18 @@ <argument index="0" name="control" type="Control"> </argument> <description> - Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. + Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree. + [codeblock] + export (Color, RGBA) var color = Color(1, 0, 0, 1) + + func get_drag_data(position): + # Use a control that is not in the tree + var cpb = ColorPickerButton.new() + cpb.color = color + cpb.rect_size = Vector2(50, 50) + set_drag_preview(cpb) + return color + [/codeblock] </description> </method> <method name="set_end"> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 831a0bb02f..7cb6b1b754 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -83,7 +83,13 @@ <return type="int"> </return> <description> - Returns a hashed integer value representing the dictionary contents. + Returns a hashed integer value representing the dictionary contents. This can be used to compare dictionaries by value: + [codeblock] + var dict1 = {0: 10} + var dict2 = {0: 10} + # The line below prints `true`, whereas it would have printed `false` if both variables were compared directly. + print(dict1.hash() == dict2.hash()) + [/codeblock] </description> </method> <method name="keys"> diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml index 5c49e227be..981e0a6180 100644 --- a/doc/classes/EditorScript.xml +++ b/doc/classes/EditorScript.xml @@ -5,7 +5,7 @@ </brief_description> <description> Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File > Run[/b] menu option (or by pressing [code]Ctrl+Shift+X[/code]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead. - [b]Note:[/b] Extending scripts need to have [code]tool mode[/code] enabled. + [b]Note:[/b] Extending scripts need to have [code]tool[/code] mode enabled. [b]Example script:[/b] [codeblock] tool diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 3a73d44a01..d0e8a5972f 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -1,13 +1,43 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="HTTPRequest" inherits="Node" category="Core" version="3.2"> <brief_description> - A node with the ability to send HTTP requests. + A node with the ability to send HTTP(S) requests. </brief_description> <description> A node with the ability to send HTTP requests. Uses [HTTPClient] internally. Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP. + [b]Example of loading and displaying an image using HTTPRequest:[/b] + [codeblock] + func _ready(): + # Create an HTTP request node and connect its completion signal. + var http_request = HTTPRequest.new() + add_child(http_request) + http_request.connect("request_completed", self, "_http_request_completed") + + # Perform the HTTP request. The URL below returns a PNG image as of writing. + var error = http_request.request("https://via.placeholder.com/512") + if error != OK: + push_error("An error occurred in the HTTP request.") + + + # Called when the HTTP request is completed. + func _http_request_completed(result, response_code, headers, body): + var image = Image.new() + var error = image.load_png_from_buffer(body) + if error != OK: + push_error("Couldn't load the image.") + + var texture = ImageTexture.new() + texture.create_from_image(image) + + # Display the image in a TextureRect node. + var texture_rect = TextureRect.new() + add_child(texture_rect) + texture_rect.texture = texture + [/codeblock] </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/networking/http_request_class.html</link> <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> </tutorials> <methods> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index d37ab64cb3..c6d63035d1 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -415,7 +415,7 @@ <argument index="1" name="grayscale" type="bool" default="false"> </argument> <description> - Saves the image as an EXR file to [code]path[/code]. If grayscale is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module. + Saves the image as an EXR file to [code]path[/code]. If [code]grayscale[/code] is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module. </description> </method> <method name="save_png" qualifiers="const"> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index 4c8d83adba..d412ce09e2 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -51,8 +51,10 @@ </return> <argument index="0" name="action" type="String"> </argument> + <argument index="1" name="allow_echo" type="bool" default="false"> + </argument> <description> - Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. + Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events, unless [code]allow_echo[/code] is [code]true[/code]). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. </description> </method> <method name="is_action_released" qualifiers="const"> diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index cb89a746bf..5cd6a0c285 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -12,16 +12,16 @@ <methods> </methods> <members> + <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" default="0.0"> + Represents the pressure the user puts on the pen. Ranges from [code]0.0[/code] to [code]1.0[/code]. + </member> <member name="relative" type="Vector2" setter="set_relative" getter="get_relative" default="Vector2( 0, 0 )"> The mouse position relative to the previous position (position at the last frame). </member> <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" default="Vector2( 0, 0 )"> The mouse speed in pixels per second. </member> - <member name="pressure" type="float" setter="set_pressure" getter="get_pressure"> - Represents the pressure the user puts on the pen. Ranges from [code]0.0[/code] to [code]1.0[/code]. - </member> - <member name="tilt" type="Vector2" setter="set_tilt" getter="get_tilt"> + <member name="tilt" type="Vector2" setter="set_tilt" getter="get_tilt" default="Vector2( 0, 0 )"> Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from [code]-1.0[/code] to [code]1.0[/code] for both axes. </member> </members> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 5aeeb61647..6da0547352 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -878,6 +878,9 @@ <member name="low_processor_usage_mode" type="bool" setter="set_low_processor_usage_mode" getter="is_in_low_processor_usage_mode" default="false"> If [code]true[/code], the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile. </member> + <member name="low_processor_usage_mode_sleep_usec" type="int" setter="set_low_processor_usage_mode_sleep_usec" getter="get_low_processor_usage_mode_sleep_usec" default="6900"> + The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. + </member> <member name="max_window_size" type="Vector2" setter="set_max_window_size" getter="get_max_window_size" default="Vector2( 0, 0 )"> The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to [code](0, 0)[/code] to reset to the system default value. </member> diff --git a/doc/classes/PCKPacker.xml b/doc/classes/PCKPacker.xml index f3091a3e3f..ff45ca925c 100644 --- a/doc/classes/PCKPacker.xml +++ b/doc/classes/PCKPacker.xml @@ -3,6 +3,14 @@ <brief_description> </brief_description> <description> + The [PCKPacker] is used to create packages in application runtime. + [codeblock] + var packer = PCKPacker.new() + packer.pck_start("test.pck", 0) + packer.add_file("res://text.txt", "text.txt") + packer.flush(false) + [/codeblock] + The above [PCKPacker] creates package [b]test.pck[/b], then adds a file named [b]text.txt[/b] in the root of the package. </description> <tutorials> </tutorials> @@ -15,6 +23,7 @@ <argument index="1" name="source_path" type="String"> </argument> <description> + Adds the [code]source_path[/code] file to the current PCK package at the [code]pck_path[/code] internal path (should start with [code]res://[/code]). </description> </method> <method name="flush"> diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index 69dfe28ac4..bb72f2734e 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -116,6 +116,14 @@ Returns the intersection point of a segment from position [code]begin[/code] to position [code]end[/code] with this plane. If no intersection is found, [code]null[/code] is returned. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="plane" type="Plane"> + </argument> + <description> + </description> + </method> <method name="is_point_over"> <return type="bool"> </return> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index eb937df286..772c2f5073 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -282,6 +282,9 @@ <member name="debug/gdscript/warnings/enable" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables specific GDScript warnings (see [code]debug/gdscript/warnings/*[/code] settings). If [code]false[/code], disables all GDScript warnings. </member> + <member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true"> + If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings. + </member> <member name="debug/gdscript/warnings/function_conflicts_constant" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables warnings when a function is declared with the same name as a constant. </member> @@ -428,9 +431,6 @@ <member name="display/window/vsync/use_vsync" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If [code]false[/code], vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5). </member> - <member name="editor/active" type="bool" setter="" getter="" default="false"> - Internal editor setting, don't touch. - </member> <member name="editor/script_templates_search_path" type="String" setter="" getter="" default=""res://script_templates""> </member> <member name="editor/search_in_file_extensions" type="PoolStringArray" setter="" getter="" default="PoolStringArray( "gd", "shader" )"> diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 9d163e926c..f5ee99d30c 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -94,6 +94,14 @@ Returns the inverse of the quaternion. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="quat" type="Quat"> + </argument> + <description> + </description> + </method> <method name="is_normalized"> <return type="bool"> </return> diff --git a/doc/classes/RayCast.xml b/doc/classes/RayCast.xml index 19f62a57bd..5e17d6e7d7 100644 --- a/doc/classes/RayCast.xml +++ b/doc/classes/RayCast.xml @@ -11,6 +11,7 @@ RayCast calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame), use [method force_raycast_update] after adjusting the raycast. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> <method name="add_exception"> diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml index 81d66ef496..c5ba5da24e 100644 --- a/doc/classes/RayCast2D.xml +++ b/doc/classes/RayCast2D.xml @@ -11,6 +11,7 @@ RayCast2D calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> <method name="add_exception"> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 9d6bfbf398..07fa7777fe 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -137,6 +137,14 @@ Returns [code]true[/code] if the [Rect2] overlaps with another. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="rect" type="Rect2"> + </argument> + <description> + </description> + </method> <method name="merge"> <return type="Rect2"> </return> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index bd81a48ff5..bf22b865d3 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -194,7 +194,7 @@ </return> <description> Reloads the currently active scene. - Returns an [enum Error] code as described in [method change_scene], with the addition of [constant ERR_UNCONFIGURED] if no [member current_scene] was defined yet. + Returns [constant OK] on success, [constant ERR_UNCONFIGURED] if no [member current_scene] was defined yet, [constant ERR_CANT_OPEN] if [member current_scene] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if the scene cannot be instantiated. </description> </method> <method name="set_auto_accept_quit"> @@ -204,6 +204,7 @@ </argument> <description> If [code]true[/code], the application automatically accepts quitting. Enabled by default. + For mobile platforms, see [method set_quit_on_go_back]. </description> </method> <method name="set_group"> @@ -248,6 +249,7 @@ </argument> <description> If [code]true[/code], the application quits automatically on going back (e.g. on Android). Enabled by default. + To handle 'Go Back' button when this option is disabled, use [constant MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST]. </description> </method> <method name="set_screen_stretch"> diff --git a/doc/classes/SoftBody.xml b/doc/classes/SoftBody.xml index 93f02c0e01..a51907b1bf 100644 --- a/doc/classes/SoftBody.xml +++ b/doc/classes/SoftBody.xml @@ -77,9 +77,6 @@ </method> </methods> <members> - <member name="ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable" default="false"> - If [code]true[/code], the [SoftBody] will respond to [RayCast]s. - </member> <member name="areaAngular_stiffness" type="float" setter="set_areaAngular_stiffness" getter="get_areaAngular_stiffness" default="0.5"> </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1"> @@ -103,6 +100,9 @@ </member> <member name="pressure_coefficient" type="float" setter="set_pressure_coefficient" getter="get_pressure_coefficient" default="0.0"> </member> + <member name="ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable" default="true"> + If [code]true[/code], the [SoftBody] will respond to [RayCast]s. + </member> <member name="simulation_precision" type="int" setter="set_simulation_precision" getter="get_simulation_precision" default="5"> Increasing this value will improve the resulting simulation, but can affect performance. Use with care. </member> diff --git a/doc/classes/SpringArm.xml b/doc/classes/SpringArm.xml index 438d96f2b3..133ff68859 100644 --- a/doc/classes/SpringArm.xml +++ b/doc/classes/SpringArm.xml @@ -1,8 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="SpringArm" inherits="Spatial" category="Core" version="3.2"> <brief_description> + A helper node, mostly used in 3rd person cameras. </brief_description> <description> + The SpringArm node is a node that casts a ray (or collision shape) along its z axis and moves all its direct children to the collision point, minus a margin. + The most common use case for this is to make a 3rd person camera that reacts to collisions in the environment. + The SpringArm will either cast a ray, or if a shape is given, it will cast the shape in the direction of its z axis. + If you use the SpringArm as a camera controller for your player, you might need to exclude the player's collider from the SpringArm's collision check. </description> <tutorials> </tutorials> @@ -13,18 +18,21 @@ <argument index="0" name="RID" type="RID"> </argument> <description> + Adds the object with the given [RID] to the list of objects excluded from the collision check. </description> </method> <method name="clear_excluded_objects"> <return type="void"> </return> <description> + Clears the list of objects excluded from the collision check. </description> </method> <method name="get_hit_length"> <return type="float"> </return> <description> + Returns the proportion between the current arm length (after checking for collisions) and the [member spring_length]. Ranges from 0 to 1. </description> </method> <method name="remove_excluded_object"> @@ -33,17 +41,26 @@ <argument index="0" name="RID" type="RID"> </argument> <description> + Removes the given [RID] from the list of objects excluded from the collision check. </description> </method> </methods> <members> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> + The layers against which the collision check shall be done. </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.01"> + When the collision check is made, a candidate length for the SpringArm is given. + The margin is then subtracted to this length and the translation is applied to the child objects of the SpringArm. + This margin is useful for when the SpringArm has a [Camera] as a child node: without the margin, the [Camera] would be placed on the exact point of collision, while with the margin the [Camera] would be placed close to the point of collision. </member> <member name="shape" type="Shape" setter="set_shape" getter="get_shape"> + The [Shape] to use for the SpringArm. + When the shape is set, the SpringArm will cast the [Shape] on its z axis instead of performing a ray cast. </member> <member name="spring_length" type="float" setter="set_length" getter="get_length" default="1.0"> + The maximum extent of the SpringArm. This is used as a length for both the ray and the shape cast used internally to calculate the desired position of the SpringArm's child nodes. + To know more about how to perform a shape cast or a ray cast, please consult the [PhysicsDirectSpaceState] documentation. </member> </members> <constants> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 591dda9014..11a9f6dc0d 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -459,7 +459,7 @@ <argument index="1" name="what" type="String"> </argument> <description> - Inserts a substring at a given position. + Returns a copy of the string with the substring [code]what[/code] inserted at the given position. </description> </method> <method name="is_abs_path"> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index e883341107..75fceac500 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -310,11 +310,11 @@ <argument index="3" name="from_column" type="int"> </argument> <description> - Perform a search inside the text. Search flags can be specified in the [code]SEARCH_*[/code] enum. - Returns an empty [code]PoolIntArray[/code] if no result was found. Otherwise, the result line and column can be accessed at indices specified in the [code]SEARCH_RESULT_*[/code] enum, e.g: + Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum. + Returns an empty [code]PoolIntArray[/code] if no result was found. Otherwise, the result line and column can be accessed at indices specified in the [enum SearchResult] enum, e.g: [codeblock] var result = search(key, flags, line, column) - if result.size() > 0: + if result.size() > 0: # result found var res_line = result[TextEdit.SEARCH_RESULT_LINE] var res_column = result[TextEdit.SEARCH_RESULT_COLUMN] @@ -513,13 +513,13 @@ Search from end to beginning. </constant> <constant name="SEARCH_RESULT_COLUMN" value="0" enum="SearchResult"> - Used to access the result column from [member search]. + Used to access the result column from [method search]. </constant> <constant name="SEARCH_RESULT_LINE" value="1" enum="SearchResult"> - Used to access the result line from [member search]. + Used to access the result line from [method search]. </constant> <constant name="MENU_CUT" value="0" enum="MenuItems"> - Cuts (Copies and clears) the selected text. + Cuts (copies and clears) the selected text. </constant> <constant name="MENU_COPY" value="1" enum="MenuItems"> Copies the selected text. diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index fccfb4cd6d..3d18534a68 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -37,7 +37,7 @@ The button's shape. </member> <member name="shape_centered" type="bool" setter="set_shape_centered" getter="is_shape_centered" default="true"> - If [code]true[/code], the button's shape is centered. + If [code]true[/code], the button's shape is centered in the provided texture. If no texture is used, this property has no effect. </member> <member name="shape_visible" type="bool" setter="set_shape_visible" getter="is_shape_visible" default="true"> If [code]true[/code], the button's shape is visible. diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index 6ebc389ed7..034a1b2f5b 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -89,6 +89,14 @@ Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling). </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="transform" type="Transform"> + </argument> + <description> + </description> + </method> <method name="looking_at"> <return type="Transform"> </return> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 580da080b3..89ccffc2e9 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -106,6 +106,14 @@ Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling). </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="transform" type="Transform2D"> + </argument> + <description> + </description> + </method> <method name="orthonormalized"> <return type="Transform2D"> </return> diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml index 4c06195d5c..6240178b82 100644 --- a/doc/classes/VScrollBar.xml +++ b/doc/classes/VScrollBar.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VScrollBar" inherits="ScrollBar" category="Core" version="3.2"> <brief_description> - Vertical version of [ScrollBar], which goes from left (min) to right (max). + Vertical version of [ScrollBar], which goes from top (min) to bottom (max). </brief_description> <description> </description> diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml index 522e131b45..9d55f5846f 100644 --- a/doc/classes/Variant.xml +++ b/doc/classes/Variant.xml @@ -4,7 +4,37 @@ The most important data type in Godot. </brief_description> <description> + In computer programming, a Variant class is a class that is designed to store a variety of other types. Dynamic programming languages like PHP, Lua, JavaScript and GDScript like to use them to store variables' data on the backend. With these Variants, properties are able to change value types freely. + [codeblock] + var foo = 2 # foo is dynamically an integer + foo = "Now foo is a string!" + foo = Reference.new() # foo is an Object + var bar: int = 2 # bar is a statically typed integer. + # bar = "Uh oh! I can't make static variables become a different type!" + [/codeblock] + Godot tracks all scripting API variables within Variants. Without even realizing it, you use Variants all the time. When a particular language enforces its own rules for keeping data typed, then that language is applying its own custom logic over the base Variant scripting API. + - GDScript automatically wrap values in them. It keeps all data in plain Variants by default and then optionally enforces custom static typing rules on variable types. + - VisualScript tracks properties inside Variants as well, but it also uses static typing. The GUI interface enforces that properties have a particular type that doesn't change over time. + - C# is statically typed, but uses the Mono [code]object[/code] type in place of Godot's Variant class when it needs to represent a dynamic value. [code]object[/code] is the Mono runtime's equivalent of the same concept. + - The statically-typed language NativeScript C++ does not define a built-in Variant-like class. Godot's GDNative bindings provide their own godot::Variant class for users; Any point at which the C++ code starts interacting with the Godot runtime is a place where you might have to start wrapping data inside Variant objects. + The global [method @GDScript.typeof] function returns the enumerated value of the Variant type stored in the current variable. These correspond to [code]TYPE_*[/code] constants in the [@GlobalScope] docs. + [codeblock] + var foo = 2 + match typeof(foo): + TYPE_NIL: + print("foo is null") + TYPE_INTEGER: + print("foo is an integer") + TYPE_OBJECT: + # Note that Objects are their own special category. + # To get the name of the underlying Object type, you need the `get_class()` method. + print("foo is a(n) %s" % foo.get_class()) # inject the class name into a formatted string. + # Note also that there is not yet any way to get a script's `class_name` string easily. + # To fetch that value, you need to dig deeply into a hidden ProjectSettings setting: an Array of Dictionaries called "_global_script_classes". + # Open your project.godot file to see it up close. + [/codeblock] A Variant takes up only 20 bytes and can store almost any engine datatype inside of it. Variants are rarely used to hold information for long periods of time. Instead, they are used mainly for communication, editing, serialization and moving data around. + Godot has specifically invested in making its Variant class as flexible as possible; so much so that it is used for a multitude of operations to facilitate communication between all of Godot's systems. A Variant: - Can store almost any datatype. - Can perform operations between many variants. GDScript uses Variant as its atomic/native datatype. @@ -16,10 +46,11 @@ - Can be serialized to text and use it for printing values and editable settings. - Can work as an exported property, so the editor can edit it universally. - Can be used for dictionaries, arrays, parsers, etc. - [b]Containers ([Array] and [Dictionary]):[/b] Both are implemented using variants. A [Dictionary] can match any datatype used as key to any other datatype. An [Array] just holds an array of Variants. Of course, a Variant can also hold a [Dictionary] and an [Array] inside, making it even more flexible. + [b]Containers (Array and Dictionary):[/b] Both are implemented using variants. A [Dictionary] can match any datatype used as key to any other datatype. An [Array] just holds an array of Variants. Of course, a Variant can also hold a [Dictionary] and an [Array] inside, making it even more flexible. Modifications to a container will modify all references to it. A [Mutex] should be created to lock it if multi-threaded access is desired. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/development/cpp/variant_class.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 987ed9867b..8ae5caf68c 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -153,6 +153,14 @@ Returns the vector with all components rounded down. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="v" type="Vector2"> + </argument> + <description> + </description> + </method> <method name="is_normalized"> <return type="bool"> </return> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 05ce6c43ae..29c24709e2 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -129,6 +129,14 @@ Returns the inverse of the vector. This is the same as [code]Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )[/code]. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="v" type="Vector3"> + </argument> + <description> + </description> + </method> <method name="is_normalized"> <return type="bool"> </return> diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index b95b970816..28365c213b 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -2782,6 +2782,22 @@ <description> </description> </method> + <method name="particles_is_inactive"> + <return type="bool"> + </return> + <argument index="0" name="particles" type="RID"> + </argument> + <description> + </description> + </method> + <method name="particles_request_process"> + <return type="void"> + </return> + <argument index="0" name="particles" type="RID"> + </argument> + <description> + </description> + </method> <method name="particles_restart"> <return type="void"> </return> @@ -4238,6 +4254,12 @@ <constant name="VIEWPORT_MSAA_16X" value="4" enum="ViewportMSAA"> Multisample antialiasing is set to 16×. </constant> + <constant name="VIEWPORT_MSAA_EXT_2X" value="5" enum="ViewportMSAA"> + Multisample antialiasing is set to 2× on external texture. Special mode for GLES2 VR for the Oculus Quest. + </constant> + <constant name="VIEWPORT_MSAA_EXT_4X" value="6" enum="ViewportMSAA"> + Multisample antialiasing is set to 4× on external texture. Special mode for GLES2 VR for the Oculus Quest. + </constant> <constant name="VIEWPORT_USAGE_2D" value="0" enum="ViewportUsage"> The Viewport does not render 3D but samples. </constant> diff --git a/doc/classes/VisualShaderNodeInput.xml b/doc/classes/VisualShaderNodeInput.xml index 302c8dff71..bfcd4c734c 100644 --- a/doc/classes/VisualShaderNodeInput.xml +++ b/doc/classes/VisualShaderNodeInput.xml @@ -7,6 +7,12 @@ <tutorials> </tutorials> <methods> + <method name="get_input_real_name" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> </methods> <members> <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> |