diff options
Diffstat (limited to 'doc/classes')
42 files changed, 304 insertions, 45 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/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml index c71a06d931..d8ea7fea5b 100644 --- a/doc/classes/AnimationNodeBlendSpace2D.xml +++ b/doc/classes/AnimationNodeBlendSpace2D.xml @@ -125,7 +125,7 @@ </methods> <members> <member name="auto_triangles" type="bool" setter="set_auto_triangles" getter="get_auto_triangles" default="true"> - If true, the blend space is triangulated automatically. The mesh updates every time you add or remove points with [method add_blend_point] and [method remove_blend_point]. + If [code]true[/code], the blend space is triangulated automatically. The mesh updates every time you add or remove points with [method add_blend_point] and [method remove_blend_point]. </member> <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="AnimationNodeBlendSpace2D.BlendMode" default="0"> Controls the interpolation between animations. See [enum BlendMode] constants. diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index e1cb9056da..9a5870c73d 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -7,6 +7,7 @@ 2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping). </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/using_area_2d.html</link> </tutorials> <methods> <method name="get_collision_layer_bit" qualifiers="const"> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index a1529f3eb3..e09c1f4b08 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -316,7 +316,7 @@ <argument index="3" name="deep" type="bool" default="False"> </argument> <description> - Duplicates the subset described in the function and returns it in an array, deeply copying the array if [code]deep[/code] is true. Lower and upper index are inclusive, with the [code]step[/code] describing the change between indices while slicing. + Duplicates the subset described in the function and returns it in an array, deeply copying the array if [code]deep[/code] is [code]true[/code]. Lower and upper index are inclusive, with the [code]step[/code] describing the change between indices while slicing. </description> </method> <method name="sort"> diff --git a/doc/classes/BackBufferCopy.xml b/doc/classes/BackBufferCopy.xml index 9bb32e0444..945af0c701 100644 --- a/doc/classes/BackBufferCopy.xml +++ b/doc/classes/BackBufferCopy.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="BackBufferCopy" inherits="Node2D" category="Core" version="3.2"> <brief_description> - Copies a region of the screen (or the whole screen) to a buffer so it can be accessed with [code]SCREEN_TEXTURE[/code] in the [code]texture()[/code] function. + Copies a region of the screen (or the whole screen) to a buffer so it can be accessed in your shader scripts through the [code]texture(SCREEN_TEXTURE, ...)[/code] function. </brief_description> <description> - Node for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is bufferized with the content of the screen it covers, or the entire screen according to the copy mode set. Use [code]SCREEN_TEXTURE[/code] in the [code]texture()[/code] function to access the buffer. + Node for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is bufferized with the content of the screen it covers, or the entire screen according to the copy mode set. Use the [code]texture(SCREEN_TEXTURE, ...)[/code] function in your shader scripts to access the buffer. </description> <tutorials> </tutorials> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index a920001de4..8372d15324 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -363,6 +363,7 @@ <return type="void"> </return> <description> + Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. </description> </method> <method name="get_canvas" 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 05ffac803a..75d5a72fb1 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -62,7 +62,7 @@ </argument> <description> Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. Use [code]for_text[/code] parameter to determine what text the tooltip should contain (likely the contents of [member hint_tooltip]). - The returned node must be of type [Control] or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When null or non-Control node is returned, the default tooltip will be used instead. + The returned node must be of type [Control] or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When [code]null[/code] or non-Control node is returned, the default tooltip will be used instead. [b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member rect_min_size] to some non-zero value. Example of usage with custom-constructed node: [codeblock] @@ -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/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index cab5af3985..a713e06585 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -6,7 +6,7 @@ <description> This plugins allows adding custom property editors to [EditorInspector]. Plugins are registered via [method EditorPlugin.add_inspector_plugin]. - When an object is edited, the [method can_handle] function is called and must return true if the object type is supported. + When an object is edited, the [method can_handle] function is called and must return [code]true[/code] if the object type is supported. If supported, the function [method parse_begin] will be called, allowing to place custom controls at the beginning of the class. Subsequently, the [method parse_category] and [method parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too. Finally [method parse_end] will be called. @@ -54,7 +54,7 @@ <argument index="0" name="object" type="Object"> </argument> <description> - Returns true if this object can be handled by this plugin. + Returns [code]true[/code] if this object can be handled by this plugin. </description> </method> <method name="parse_begin" qualifiers="virtual"> 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 d297bc98ae..d37ab64cb3 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 true 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 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. </description> </method> <method name="save_png" qualifiers="const"> @@ -456,6 +456,15 @@ <argument index="1" name="color" type="Color"> </argument> <description> + Sets the [Color] of the pixel at [code](dst.x, dst.y)[/code] if the image is locked. Note that the [code]dst[/code] values must be integers. Example: + [codeblock] + var img = Image.new() + img.create(img_width, img_height, false, Image.FORMAT_RGBA8) + img.lock() + img.set_pixelv(Vector2(x, y), color) # Works + img.unlock() + img.set_pixelv(Vector2(x, y), color) # Does not have an effect + [/codeblock] </description> </method> <method name="shrink_x2"> 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 fab4cc0fb9..5cd6a0c285 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -4,7 +4,7 @@ Input event type for mouse motion events. </brief_description> <description> - Contains mouse motion information. Supports relative, absolute positions and speed. See [method Node._input]. + Contains mouse and pen motion information. Supports relative, absolute positions and speed. See [method Node._input]. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link> @@ -12,12 +12,18 @@ <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="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> <constants> </constants> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index b6eeed4a21..5aeeb61647 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -157,6 +157,8 @@ <return type="PoolStringArray"> </return> <description> + Returns an array of MIDI device names. + The returned array will be empty if the system MIDI driver has not previously been initialised with [method open_midi_inputs]. </description> </method> <method name="get_current_video_driver" qualifiers="const"> @@ -699,6 +701,7 @@ <return type="void"> </return> <description> + Initialises the singleton for the system MIDI driver. </description> </method> <method name="print_all_resources"> 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/PoolByteArray.xml b/doc/classes/PoolByteArray.xml index 21bf078017..867f042cd2 100644 --- a/doc/classes/PoolByteArray.xml +++ b/doc/classes/PoolByteArray.xml @@ -53,6 +53,13 @@ Returns a new [PoolByteArray] with the data decompressed. Set [code]buffer_size[/code] to the size of the uncompressed data. Set the compression mode using one of [enum File.CompressionMode]'s constants. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="get_string_from_ascii"> <return type="String"> </return> diff --git a/doc/classes/PoolColorArray.xml b/doc/classes/PoolColorArray.xml index a1fb868ef5..34cfa0ab53 100644 --- a/doc/classes/PoolColorArray.xml +++ b/doc/classes/PoolColorArray.xml @@ -33,6 +33,13 @@ Appends a [PoolColorArray] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolIntArray.xml b/doc/classes/PoolIntArray.xml index 28a28b2bba..25e1e718f7 100644 --- a/doc/classes/PoolIntArray.xml +++ b/doc/classes/PoolIntArray.xml @@ -34,6 +34,13 @@ Appends a [PoolIntArray] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolRealArray.xml b/doc/classes/PoolRealArray.xml index 7eaec82338..e8afe46640 100644 --- a/doc/classes/PoolRealArray.xml +++ b/doc/classes/PoolRealArray.xml @@ -33,6 +33,13 @@ Appends a [PoolRealArray] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolStringArray.xml b/doc/classes/PoolStringArray.xml index a408a18b19..f41a3c7a68 100644 --- a/doc/classes/PoolStringArray.xml +++ b/doc/classes/PoolStringArray.xml @@ -33,6 +33,13 @@ Appends a [PoolStringArray] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolVector2Array.xml b/doc/classes/PoolVector2Array.xml index 623247e639..321846d08b 100644 --- a/doc/classes/PoolVector2Array.xml +++ b/doc/classes/PoolVector2Array.xml @@ -33,6 +33,13 @@ Appends a [PoolVector2Array] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolVector3Array.xml b/doc/classes/PoolVector3Array.xml index adc28b46cb..c82bd62a11 100644 --- a/doc/classes/PoolVector3Array.xml +++ b/doc/classes/PoolVector3Array.xml @@ -33,6 +33,13 @@ Appends a [PoolVector3Array] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 691aec2eb1..bdb6ca84ee 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -444,7 +444,7 @@ <argument index="1" name="enable" type="bool"> </argument> <description> - Sets the type of the item at the specified index [code]idx[/code] to radio button. If false, sets the type of the item to plain text. + Sets the type of the item at the specified index [code]idx[/code] to radio button. If [code]false[/code], sets the type of the item to plain text. </description> </method> <method name="set_item_as_separator"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index fa735b8918..772c2f5073 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -145,6 +145,7 @@ <argument index="1" name="value" type="Variant"> </argument> <description> + Sets the specified property's initial value. This is the value the property reverts to. </description> </method> <method name="set_order"> @@ -166,6 +167,11 @@ <argument index="1" name="value" type="Variant"> </argument> <description> + Sets the value of a setting. + [b]Example:[/b] + [codeblock] + ProjectSettings.set_setting("application/config/name", "Example") + [/codeblock] </description> </method> </methods> @@ -276,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> @@ -422,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/SoftBody.xml b/doc/classes/SoftBody.xml index 5cde31fa59..a51907b1bf 100644 --- a/doc/classes/SoftBody.xml +++ b/doc/classes/SoftBody.xml @@ -7,6 +7,7 @@ A deformable physics body. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/soft_body.html</link> </tutorials> <methods> <method name="add_collision_exception_with"> @@ -43,12 +44,6 @@ Returns an individual bit on the collision mask. </description> </method> - <method name="is_ray_pickable" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> <method name="remove_collision_exception_with"> <return type="void"> </return> @@ -80,25 +75,17 @@ Sets individual bits on the collision mask. Use this if you only need to change one layer's value. </description> </method> - <method name="set_ray_pickable"> - <return type="void"> - </return> - <argument index="0" name="ray_pickable" type="bool"> - </argument> - <description> - </description> - </method> </methods> <members> <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"> - The physics layers this area is in. + The physics layers this SoftBody is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The physics layers this area scans for collisions. + The physics layers this SoftBody scans for collisions. </member> <member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.01"> </member> @@ -107,15 +94,20 @@ <member name="linear_stiffness" type="float" setter="set_linear_stiffness" getter="get_linear_stiffness" default="0.5"> </member> <member name="parent_collision_ignore" type="NodePath" setter="set_parent_collision_ignore" getter="get_parent_collision_ignore" default="NodePath("")"> + [NodePath] to a [CollisionObject] this SoftBody should avoid clipping. </member> <member name="pose_matching_coefficient" type="float" setter="set_pose_matching_coefficient" getter="get_pose_matching_coefficient" default="0.0"> </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> <member name="total_mass" type="float" setter="set_total_mass" getter="get_total_mass" default="1.0"> + The SoftBody's mass. </member> <member name="volume_stiffness" type="float" setter="set_volume_stiffness" getter="get_volume_stiffness" default="0.5"> </member> diff --git a/doc/classes/Spatial.xml b/doc/classes/Spatial.xml index 128aa93f15..0309e73eec 100644 --- a/doc/classes/Spatial.xml +++ b/doc/classes/Spatial.xml @@ -15,6 +15,7 @@ <return type="void"> </return> <description> + Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. </description> </method> <method name="get_parent_spatial" qualifiers="const"> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index cf152e716e..e0a4a24299 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 0dd2d75cd5..75fceac500 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -94,7 +94,7 @@ </argument> <description> Moves the cursor at the specified [code]column[/code] index. - If [code]adjust_viewport[/code] is set to true, the viewport will center at the cursor position after the move occurs. + If [code]adjust_viewport[/code] is set to [code]true[/code], the viewport will center at the cursor position after the move occurs. </description> </method> <method name="cursor_set_line"> @@ -110,8 +110,8 @@ </argument> <description> Moves the cursor at the specified [code]line[/code] index. - If [code]adjust_viewport[/code] is set to true, the viewport will center at the cursor position after the move occurs. - If [code]can_be_hidden[/code] is set to true, the specified [code]line[/code] can be hidden using [method set_line_as_hidden]. + If [code]adjust_viewport[/code] is set to [code]true[/code], the viewport will center at the cursor position after the move occurs. + If [code]can_be_hidden[/code] is set to [code]true[/code], the specified [code]line[/code] can be hidden using [method set_line_as_hidden]. </description> </method> <method name="cut"> @@ -310,7 +310,15 @@ <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. + 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: + # result found + var res_line = result[TextEdit.SEARCH_RESULT_LINE] + var res_column = result[TextEdit.SEARCH_RESULT_COLUMN] + [/codeblock] </description> </method> <method name="select"> @@ -504,8 +512,14 @@ <constant name="SEARCH_BACKWARDS" value="4" enum="SearchFlags"> Search from end to beginning. </constant> + <constant name="SEARCH_RESULT_COLUMN" value="0" enum="SearchResult"> + 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 [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/Theme.xml b/doc/classes/Theme.xml index e4db9243ef..dd12c5af23 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -15,6 +15,7 @@ <return type="void"> </return> <description> + Clears all values on the theme. </description> </method> <method name="clear_color"> @@ -85,6 +86,7 @@ <argument index="0" name="other" type="Theme"> </argument> <description> + Sets the Theme's values to a copy of a given theme. </description> </method> <method name="get_color" qualifiers="const"> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 75eb8b5862..7376f624cb 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -43,6 +43,7 @@ <argument index="1" name="y" type="int"> </argument> <description> + Returns the coordinate of the autotile variation in the tileset. Returns a zero vector if the cell doesn't have autotiling. </description> </method> <method name="get_cellv" qualifiers="const"> @@ -255,6 +256,7 @@ </methods> <members> <member name="cell_clip_uv" type="bool" setter="set_clip_uv" getter="get_clip_uv" default="false"> + If [code]true[/code], the cell's UVs will be clipped. </member> <member name="cell_custom_transform" type="Transform2D" setter="set_custom_transform" getter="get_custom_transform" default="Transform2D( 64, 0, 0, 64, 0, 0 )"> The custom [Transform2D] to be applied to the TileMap's cells. @@ -294,6 +296,7 @@ If [code]true[/code], TileMap collisions will be handled as a kinematic body. If [code]false[/code], collisions will be handled as static body. </member> <member name="collision_use_parent" type="bool" setter="set_collision_use_parent" getter="get_collision_use_parent" default="false"> + If [code]true[/code], this tilemap's collision shape will be added to the collision shape of the parent. The parent has to be a [CollisionObject2D]. </member> <member name="compatibility_mode" type="bool" setter="set_compatibility_mode" getter="is_compatibility_mode_enabled" default="false"> If [code]true[/code], the compatibility with the tilemaps made in Godot 3.1 or earlier is maintained (textures move when the tile origin changes and rotate if the texture size is not homogeneous). This mode presents problems when doing [code]flip_h[/code], [code]flip_v[/code] and [code]transpose[/code] tile operations on non-homogeneous isometric tiles (e.g. 2:1), in which the texture could not coincide with the collision, thus it is not recommended for isometric or non-square tiles. 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/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/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="[ ]" /> |