summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Array.xml8
-rw-r--r--doc/classes/CodeHighlighter.xml145
-rw-r--r--doc/classes/CollisionObject2D.xml2
-rw-r--r--doc/classes/Control.xml4
-rw-r--r--doc/classes/Decal.xml4
-rw-r--r--doc/classes/DisplayServer.xml2
-rw-r--r--doc/classes/DynamicFont.xml8
-rw-r--r--doc/classes/EditorSyntaxHighlighter.xml31
-rw-r--r--doc/classes/File.xml1
-rw-r--r--doc/classes/HTTPClient.xml1
-rw-r--r--doc/classes/HTTPRequest.xml1
-rw-r--r--doc/classes/InputEventMouseMotion.xml2
-rw-r--r--doc/classes/KinematicBody2D.xml2
-rw-r--r--doc/classes/KinematicBody3D.xml2
-rw-r--r--doc/classes/OS.xml13
-rw-r--r--doc/classes/Object.xml5
-rw-r--r--doc/classes/PrimitiveMesh.xml7
-rw-r--r--doc/classes/ProjectSettings.xml4
-rw-r--r--doc/classes/RayCast2D.xml2
-rw-r--r--doc/classes/RayCast3D.xml2
-rw-r--r--doc/classes/ScriptEditor.xml28
-rw-r--r--doc/classes/ScriptEditorBase.xml67
-rw-r--r--doc/classes/String.xml4
-rw-r--r--doc/classes/SyntaxHighlighter.xml53
-rw-r--r--doc/classes/TextEdit.xml68
-rw-r--r--doc/classes/UDPServer.xml20
-rw-r--r--doc/classes/VehicleBody3D.xml1
-rw-r--r--doc/classes/VehicleWheel3D.xml1
28 files changed, 404 insertions, 84 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index 9a3eccd8dc..b79b24e0bc 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -227,10 +227,10 @@
<description>
Returns [code]true[/code] if the array contains the given value.
[codeblock]
- ["inside", 7].has("inside") == true
- ["inside", 7].has("outside") == false
- ["inside", 7].has(7) == true
- ["inside", 7].has("7") == false
+ print(["inside", 7].has("inside")) # True
+ print(["inside", 7].has("outside")) # False
+ print(["inside", 7].has(7)) # True
+ print(["inside", 7].has("7")) # False
[/codeblock]
[b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows:
[codeblock]
diff --git a/doc/classes/CodeHighlighter.xml b/doc/classes/CodeHighlighter.xml
new file mode 100644
index 0000000000..7a1dad547b
--- /dev/null
+++ b/doc/classes/CodeHighlighter.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CodeHighlighter" inherits="SyntaxHighlighter" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_color_region">
+ <return type="void">
+ </return>
+ <argument index="0" name="p_start_key" type="String">
+ </argument>
+ <argument index="1" name="p_end_key" type="String">
+ </argument>
+ <argument index="2" name="p_color" type="Color">
+ </argument>
+ <argument index="3" name="p_line_only" type="bool" default="false">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="add_keyword_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="keyword" type="String">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="add_member_keyword_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="member_keyword" type="String">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="clear_color_regions">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="clear_keyword_colors">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="clear_member_keyword_colors">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_keyword_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <argument index="0" name="keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_member_keyword_color" qualifiers="const">
+ <return type="Color">
+ </return>
+ <argument index="0" name="member_keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_color_region" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="p_start_key" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_keyword_color" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_member_keyword_color" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="member_keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="remove_color_region">
+ <return type="void">
+ </return>
+ <argument index="0" name="p_start_key" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="remove_keyword_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="remove_member_keyword_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="member_keyword" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="color_regions" type="Dictionary" setter="set_color_regions" getter="get_color_regions" default="{}">
+ </member>
+ <member name="function_color" type="Color" setter="set_function_color" getter="get_function_color" default="Color( 0, 0, 0, 1 )">
+ </member>
+ <member name="keyword_colors" type="Dictionary" setter="set_keyword_colors" getter="get_keyword_colors" default="{}">
+ </member>
+ <member name="member_keyword_colors" type="Dictionary" setter="set_member_keyword_colors" getter="get_member_keyword_colors" default="{}">
+ </member>
+ <member name="member_variable_color" type="Color" setter="set_member_variable_color" getter="get_member_variable_color" default="Color( 0, 0, 0, 1 )">
+ </member>
+ <member name="number_color" type="Color" setter="set_number_color" getter="get_number_color" default="Color( 0, 0, 0, 1 )">
+ </member>
+ <member name="symbol_color" type="Color" setter="set_symbol_color" getter="get_symbol_color" default="Color( 0, 0, 0, 1 )">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml
index c2dd48108f..bf82e921fb 100644
--- a/doc/classes/CollisionObject2D.xml
+++ b/doc/classes/CollisionObject2D.xml
@@ -216,7 +216,7 @@
</method>
</methods>
<members>
- <member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable">
+ <member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable" default="true">
If [code]true[/code], this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events.
</member>
</members>
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index 9dbb843902..1f495bf91a 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -856,7 +856,9 @@
The node's rotation around its pivot, in degrees. See [member rect_pivot_offset] to change the pivot's position.
</member>
<member name="rect_scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2( 1, 1 )">
- The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset].
+ The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value.
+ [b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually.
+ [b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using [code]yield(get_tree(), "idle_frame")[/code] then set its [member rect_scale] property.
</member>
<member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2( 0, 0 )">
The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically.
diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml
index f7329d1537..f9baa3b09a 100644
--- a/doc/classes/Decal.xml
+++ b/doc/classes/Decal.xml
@@ -17,7 +17,7 @@
<argument index="0" name="type" type="int" enum="Decal.DecalTexture">
</argument>
<description>
- Returns the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
+ Returns the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]albedo_tex = $Decal.get_texture(Decal.TEXTURE_ALBEDO)[/code], use [code]albedo_tex = $Decal.texture_albedo[/code].
One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
[codeblock]
@@ -34,7 +34,7 @@
<argument index="1" name="texture" type="Texture2D">
</argument>
<description>
- Sets the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
+ Sets the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]$Decal.set_texture(Decal.TEXTURE_ALBEDO, albedo_tex)[/code], use [code]$Decal.texture_albedo = albedo_tex[/code].
One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
[codeblock]
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index d118cf8205..49af8d7de2 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -139,7 +139,7 @@
<description>
</description>
</method>
- <method name="get_swap_ok_cancel">
+ <method name="get_swap_cancel_ok">
<return type="bool">
</return>
<description>
diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml
index 0864c3ba36..24df056c6b 100644
--- a/doc/classes/DynamicFont.xml
+++ b/doc/classes/DynamicFont.xml
@@ -26,6 +26,14 @@
Adds a fallback font.
</description>
</method>
+ <method name="get_available_chars" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Returns a string containing all the characters available in the main and all the fallback fonts.
+ If a given character is included in more than one font, it appears only once in the returned string.
+ </description>
+ </method>
<method name="get_fallback" qualifiers="const">
<return type="DynamicFontData">
</return>
diff --git a/doc/classes/EditorSyntaxHighlighter.xml b/doc/classes/EditorSyntaxHighlighter.xml
new file mode 100644
index 0000000000..103d95e1d6
--- /dev/null
+++ b/doc/classes/EditorSyntaxHighlighter.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorSyntaxHighlighter" inherits="SyntaxHighlighter" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="_get_name" qualifiers="virtual">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="_get_supported_extentions" qualifiers="virtual">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="_get_supported_languages" qualifiers="virtual">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/File.xml b/doc/classes/File.xml
index b90039e496..20bc39ef1f 100644
--- a/doc/classes/File.xml
+++ b/doc/classes/File.xml
@@ -20,6 +20,7 @@
file.close()
return content
[/codeblock]
+ In the example above, the file will be saved in the user data folder as specified in the [url=https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html]Data paths[/url] documentation.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link>
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index 76153ae041..7e8f0807ac 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -8,6 +8,7 @@
[b]Note:[/b] This client only needs to connect to a host once (see [method connect_to_host]) to send multiple requests. Because of this, methods that take URLs usually take just the part after the host instead of the full URL, as the client is already connected to a host. See [method request] for a full example and to get started.
A [HTTPClient] should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side.
For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616).
+ [b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/networking/http_client_class.html</link>
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index 0b0d71fccf..61e0d2e2b9 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -64,6 +64,7 @@
add_child(texture_rect)
texture_rect.texture = texture
[/codeblock]
+ [b]Note:[/b] When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [url=https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS]CORS[/url]. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the [code]Access-Control-Allow-Origin: *[/code] HTTP header.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/networking/http_request_class.html</link>
diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml
index 97b9d5247a..53e6517c7a 100644
--- a/doc/classes/InputEventMouseMotion.xml
+++ b/doc/classes/InputEventMouseMotion.xml
@@ -16,7 +16,7 @@
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).
+ The mouse position relative to the previous position (position at the last frame).
[b]Note:[/b] Since [InputEventMouseMotion] is only emitted when the mouse moves, the last event won't have a relative position of [code]Vector2(0, 0)[/code] when the user stops moving the mouse.
</member>
<member name="speed" type="Vector2" setter="set_speed" getter="get_speed" default="Vector2( 0, 0 )">
diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml
index f0f4d83821..455fdad771 100644
--- a/doc/classes/KinematicBody2D.xml
+++ b/doc/classes/KinematicBody2D.xml
@@ -104,7 +104,7 @@
<description>
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
- [code]linear_velocity[/code] is the velocity vector in pixels per second. Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
+ [code]linear_velocity[/code] is the velocity vector in pixels per second. Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
[code]up_direction[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games.
If [code]stop_on_slope[/code] is [code]true[/code], body will not slide on slopes when you include gravity in [code]linear_velocity[/code] and the body is standing still.
If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops.
diff --git a/doc/classes/KinematicBody3D.xml b/doc/classes/KinematicBody3D.xml
index 5477c6bab6..01cce907f9 100644
--- a/doc/classes/KinematicBody3D.xml
+++ b/doc/classes/KinematicBody3D.xml
@@ -106,7 +106,7 @@
<description>
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [KinematicBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes.
This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed.
- [code]linear_velocity[/code] is the velocity vector (typically meters per second). Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
+ [code]linear_velocity[/code] is the velocity vector (typically meters per second). Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
[code]up_direction[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector3(0, 0, 0)[/code], everything is considered a wall.
If [code]stop_on_slope[/code] is [code]true[/code], body will not slide on slopes when you include gravity in [code]linear_velocity[/code] and the body is standing still.
If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops.
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 105def21ca..238bc970ef 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -112,7 +112,18 @@
<return type="PackedStringArray">
</return>
<description>
- Returns the command line arguments passed to the engine.
+ Returns the command-line arguments passed to the engine.
+ Command-line arguments can be written in any form, including both [code]--key value[/code] and [code]--key=value[/code] forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments.
+ You can also incorporate environment variables using the [method get_environment] method.
+ You can set [code]editor/main_run_args[/code] in the Project Settings to define command-line arguments to be passed by the editor when running the project.
+ Here's a minimal example on how to parse command-line arguments into a dictionary using the [code]--key=value[/code] form for arguments:
+ [codeblock]
+ var arguments = {}
+ for argument in OS.get_cmdline_args():
+ if argument.find("=") > -1:
+ var key_value = argument.split("=")
+ arguments[key_value[0].lstrip("--")] = key_value[1]
+ [/codeblock]
</description>
</method>
<method name="get_connected_midi_inputs">
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index 8d08688b41..3d8c2c5eb0 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -97,6 +97,7 @@
[codeblock]
call("set", "position", Vector2(42.0, 0.0))
[/codeblock]
+ [b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="call_deferred" qualifiers="vararg">
@@ -109,6 +110,7 @@
[codeblock]
call_deferred("set", "position", Vector2(42.0, 0.0))
[/codeblock]
+ [b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="callv">
@@ -203,6 +205,7 @@
</argument>
<description>
Returns the [Variant] value of the given [code]property[/code]. If the [code]property[/code] doesn't exist, this will return [code]null[/code].
+ [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="get_class" qualifiers="const">
@@ -402,6 +405,7 @@
</argument>
<description>
Assigns a new value to the given property. If the [code]property[/code] does not exist, nothing will happen.
+ [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="set_block_signals">
@@ -422,6 +426,7 @@
</argument>
<description>
Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling [method set] via [method call_deferred], i.e. [code]call_deferred("set", property, value)[/code].
+ [b]Note:[/b] In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).
</description>
</method>
<method name="set_indexed">
diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml
index 77915bc538..9e7f26ed4f 100644
--- a/doc/classes/PrimitiveMesh.xml
+++ b/doc/classes/PrimitiveMesh.xml
@@ -13,7 +13,12 @@
<return type="Array">
</return>
<description>
- Returns mesh arrays used to constitute surface of [Mesh]. Mesh arrays can be used with [ArrayMesh] to create new surfaces.
+ Returns mesh arrays used to constitute surface of [Mesh]. The result can be passed to [method ArrayMesh.add_surface_from_arrays] to create a new surface. For example:
+ [codeblock]
+ var c := CylinderMesh.new()
+ var arr_mesh := ArrayMesh.new()
+ arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays())
+ [/codeblock]
</description>
</method>
</methods>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index c8427ac61f..e255ce2e1a 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -472,8 +472,8 @@
<member name="gui/common/default_scroll_deadzone" type="int" setter="" getter="" default="0">
Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden.
</member>
- <member name="gui/common/swap_ok_cancel" type="bool" setter="" getter="" default="false">
- If [code]true[/code], swaps OK and Cancel buttons in dialogs on Windows and UWP to follow interface conventions.
+ <member name="gui/common/swap_cancel_ok" type="bool" setter="" getter="" default="false">
+ If [code]true[/code], swaps Cancel and OK buttons in dialogs on Windows and UWP to follow interface conventions.
</member>
<member name="gui/common/text_edit_undo_stack_max_size" type="int" setter="" getter="" default="1024">
</member>
diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml
index 4a594d3e1a..6a11630c0e 100644
--- a/doc/classes/RayCast2D.xml
+++ b/doc/classes/RayCast2D.xml
@@ -44,7 +44,7 @@
</return>
<description>
Updates the collision information for the ray. Use this method to update the collision information immediately instead of waiting for the next [code]_physics_process[/code] call, for example if the ray or its parent has changed state.
- [b]Note:[/b] [code]enabled == true[/code] is not required for this to work.
+ [b]Note:[/b] [member enabled] does not need to be [code]true[/code] for this to work.
</description>
</method>
<method name="get_collider" qualifiers="const">
diff --git a/doc/classes/RayCast3D.xml b/doc/classes/RayCast3D.xml
index 3512da9d77..e7ee1d284f 100644
--- a/doc/classes/RayCast3D.xml
+++ b/doc/classes/RayCast3D.xml
@@ -45,7 +45,7 @@
<description>
Updates the collision information for the ray.
Use this method to update the collision information immediately instead of waiting for the next [code]_physics_process[/code] call, for example if the ray or its parent has changed state.
- [b]Note:[/b] [code]enabled == true[/code] is not required for this to work.
+ [b]Note:[/b] [member enabled] does not need to be [code]true[/code] for this to work.
</description>
</method>
<method name="get_collider" qualifiers="const">
diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml
index f0ad781f77..20b0750431 100644
--- a/doc/classes/ScriptEditor.xml
+++ b/doc/classes/ScriptEditor.xml
@@ -33,6 +33,12 @@
<description>
</description>
</method>
+ <method name="get_current_editor" qualifiers="const">
+ <return type="ScriptEditorBase">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_current_script">
<return type="Script">
</return>
@@ -50,6 +56,12 @@
<description>
</description>
</method>
+ <method name="get_open_script_editors" qualifiers="const">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_open_scripts" qualifiers="const">
<return type="Array">
</return>
@@ -76,6 +88,22 @@
<description>
</description>
</method>
+ <method name="register_syntax_highlighter">
+ <return type="void">
+ </return>
+ <argument index="0" name="syntax_highlighter" type="EditorSyntaxHighlighter">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="unregister_syntax_highlighter">
+ <return type="void">
+ </return>
+ <argument index="0" name="syntax_highlighter" type="EditorSyntaxHighlighter">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<signals>
<signal name="editor_script_changed">
diff --git a/doc/classes/ScriptEditorBase.xml b/doc/classes/ScriptEditorBase.xml
new file mode 100644
index 0000000000..9968ae06c3
--- /dev/null
+++ b/doc/classes/ScriptEditorBase.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="ScriptEditorBase" inherits="VBoxContainer" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_syntax_highlighter" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="highlighter" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="edited_script_changed">
+ <description>
+ </description>
+ </signal>
+ <signal name="go_to_help">
+ <argument index="0" name="what" type="String">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ <signal name="name_changed">
+ <description>
+ </description>
+ </signal>
+ <signal name="replace_in_files_requested">
+ <argument index="0" name="text" type="String">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ <signal name="request_help">
+ <argument index="0" name="topic" type="String">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ <signal name="request_open_script_at_line">
+ <argument index="0" name="script" type="Object">
+ </argument>
+ <argument index="1" name="line" type="int">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ <signal name="request_save_history">
+ <description>
+ </description>
+ </signal>
+ <signal name="search_in_files_requested">
+ <argument index="0" name="text" type="String">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 78168562f1..71db03e84f 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -325,7 +325,8 @@
<return type="String">
</return>
<description>
- Returns a copy of the string with escaped characters replaced by their meanings according to the C language standard.
+ Returns a copy of the string with escaped characters replaced by their meanings. Supported escape sequences are [code]\'[/code], [code]\"[/code], [code]\?[/code], [code]\\[/code], [code]\a[/code], [code]\b[/code], [code]\f[/code], [code]\n[/code], [code]\r[/code], [code]\t[/code], [code]\v[/code].
+ [b]Note:[/b] Unlike the GDScript parser, this method doesn't support the [code]\uXXXX[/code] escape sequence.
</description>
</method>
<method name="capitalize">
@@ -413,7 +414,6 @@
</argument>
<description>
Returns the index of the [b]first[/b] case-sensitive occurrence of the specified string in this instance, or [code]-1[/code]. Optionally, the starting search index can be specified, continuing to the end of the string.
-
[b]Note:[/b] If you just want to know whether a string contains a substring, use the [code]in[/code] operator as follows:
[codeblock]
# Will evaluate to `false`.
diff --git a/doc/classes/SyntaxHighlighter.xml b/doc/classes/SyntaxHighlighter.xml
new file mode 100644
index 0000000000..2d6e3de02a
--- /dev/null
+++ b/doc/classes/SyntaxHighlighter.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="SyntaxHighlighter" inherits="Resource" version="4.0">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="_get_line_syntax_highlighting" qualifiers="virtual">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="p_line" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="_update_cache" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="clear_highlighting_cache">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_line_syntax_highlighting">
+ <return type="Dictionary">
+ </return>
+ <argument index="0" name="p_line" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_text_edit">
+ <return type="TextEdit">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="update_cache">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index b7b4278da0..b7240655af 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -9,32 +9,6 @@
<tutorials>
</tutorials>
<methods>
- <method name="add_color_region">
- <return type="void">
- </return>
- <argument index="0" name="begin_key" type="String">
- </argument>
- <argument index="1" name="end_key" type="String">
- </argument>
- <argument index="2" name="color" type="Color">
- </argument>
- <argument index="3" name="line_only" type="bool" default="false">
- </argument>
- <description>
- Adds color region (given the delimiters) and its colors.
- </description>
- </method>
- <method name="add_keyword_color">
- <return type="void">
- </return>
- <argument index="0" name="keyword" type="String">
- </argument>
- <argument index="1" name="color" type="Color">
- </argument>
- <description>
- Adds a [code]keyword[/code] and its [Color].
- </description>
- </method>
<method name="can_fold" qualifiers="const">
<return type="bool">
</return>
@@ -51,13 +25,6 @@
Centers the viewport on the line the editing cursor is at. This also resets the [member scroll_horizontal] value to [code]0[/code].
</description>
</method>
- <method name="clear_colors">
- <return type="void">
- </return>
- <description>
- Clears all custom syntax coloring information previously added with [method add_color_region] or [method add_keyword_color].
- </description>
- </method>
<method name="clear_undo_history">
<return type="void">
</return>
@@ -152,15 +119,6 @@
Returns an array containing the line number of each breakpoint.
</description>
</method>
- <method name="get_keyword_color" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="keyword" type="String">
- </argument>
- <description>
- Returns the [Color] of the specified [code]keyword[/code].
- </description>
- </method>
<method name="get_line" qualifiers="const">
<return type="String">
</return>
@@ -226,15 +184,6 @@
Returns a [String] text with the word under the mouse cursor location.
</description>
</method>
- <method name="has_keyword_color" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="keyword" type="String">
- </argument>
- <description>
- Returns whether the specified [code]keyword[/code] has a color set to it or not.
- </description>
- </method>
<method name="insert_text_at_cursor">
<return type="void">
</return>
@@ -473,8 +422,7 @@
<member name="smooth_scrolling" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled" default="false">
If [code]true[/code], sets the [code]step[/code] of the scrollbars to [code]0.25[/code] which results in smoother scrolling.
</member>
- <member name="syntax_highlighting" type="bool" setter="set_syntax_coloring" getter="is_syntax_coloring_enabled" default="false">
- If [code]true[/code], any custom color properties that have been set for this [TextEdit] will be visible.
+ <member name="syntax_highlighter" type="SyntaxHighlighter" setter="set_syntax_highlighter" getter="get_syntax_highlighter">
</member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
String value of the [TextEdit].
@@ -508,6 +456,12 @@
Emitted when the info icon is clicked.
</description>
</signal>
+ <signal name="line_edited_from">
+ <argument index="0" name="line" type="int">
+ </argument>
+ <description>
+ </description>
+ </signal>
<signal name="request_completion">
<description>
</description>
@@ -627,8 +581,6 @@
<theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )">
Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled.
</theme_item>
- <theme_item name="function_color" type="Color" default="Color( 0.4, 0.64, 0.81, 1 )">
- </theme_item>
<theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )">
Sets the [Color] of the line numbers. [member show_line_numbers] has to be enabled.
</theme_item>
@@ -638,13 +590,9 @@
<theme_item name="mark_color" type="Color" default="Color( 1, 0.4, 0.4, 0.4 )">
Sets the [Color] of marked text.
</theme_item>
- <theme_item name="member_variable_color" type="Color" default="Color( 0.9, 0.31, 0.35, 1 )">
- </theme_item>
<theme_item name="normal" type="StyleBox">
Sets the [StyleBox] of this [TextEdit].
</theme_item>
- <theme_item name="number_color" type="Color" default="Color( 0.92, 0.58, 0.2, 1 )">
- </theme_item>
<theme_item name="read_only" type="StyleBox">
Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled.
</theme_item>
@@ -655,8 +603,6 @@
</theme_item>
<theme_item name="space" type="Texture2D">
</theme_item>
- <theme_item name="symbol_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
- </theme_item>
<theme_item name="tab" type="Texture2D">
Sets a custom [Texture2D] for tab text characters.
</theme_item>
diff --git a/doc/classes/UDPServer.xml b/doc/classes/UDPServer.xml
index f3c865c392..aabfed85f0 100644
--- a/doc/classes/UDPServer.xml
+++ b/doc/classes/UDPServer.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
A simple server that opens a UDP socket and returns connected [PacketPeerUDP] upon receiving new packets. See also [method PacketPeerUDP.connect_to_host].
+ After starting the server ([method listen]), you will need to [method poll] it at regular intervals (e.g. inside [method Node._process]) for it to process new packets, delivering them to the appropriate [PacketPeerUDP], and taking new connections.
Below a small example of how it can be used:
[codeblock]
# server.gd
@@ -17,6 +18,7 @@
server.listen(4242)
func _process(delta):
+ server.poll() # Important!
if server.is_connection_available():
var peer : PacketPeerUDP = server.take_connection()
var pkt = peer.get_packet()
@@ -57,7 +59,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if a packet with a new address/port combination is received on the socket.
+ Returns [code]true[/code] if a packet with a new address/port combination was received on the socket.
</description>
</method>
<method name="is_listening" qualifiers="const">
@@ -78,21 +80,33 @@
Starts the server by opening a UDP socket listening on the given port. You can optionally specify a [code]bind_address[/code] to only listen for packets sent to that address. See also [method PacketPeerUDP.listen].
</description>
</method>
+ <method name="poll">
+ <return type="int" enum="Error">
+ </return>
+ <description>
+ Call this method at regular intervals (e.g. inside [method Node._process]) to process new packets. And packet from known address/port pair will be delivered to the appropriate [PacketPeerUDP], any packet received from an unknown address/port pair will be added as a pending connection (see [method is_connection_available], [method take_connection]). The maximum number of pending connection is defined via [member max_pending_connections].
+ </description>
+ </method>
<method name="stop">
<return type="void">
</return>
<description>
- Stops the server, closing the UDP socket if open. Will not disconnect any connected [PacketPeerUDP].
+ Stops the server, closing the UDP socket if open. Will close all connected [PacketPeerUDP] accepted via [method take_connection] (remote peers will not be notified).
</description>
</method>
<method name="take_connection">
<return type="PacketPeerUDP">
</return>
<description>
- Returns a [PacketPeerUDP] connected to the address/port combination of the first packet in queue. Will return [code]null[/code] if no packet is in queue. See also [method PacketPeerUDP.connect_to_host].
+ Returns the first pending connection (connected to the appropriate address/port). Will return [code]null[/code] if no new connection is available. See also [method is_connection_available], [method PacketPeerUDP.connect_to_host].
</description>
</method>
</methods>
+ <members>
+ <member name="max_pending_connections" type="int" setter="set_max_pending_connections" getter="get_max_pending_connections" default="16">
+ Define the maximum number of pending connections, during [method poll], any new pending connection exceeding that value will be automatically dropped. Setting this value to [code]0[/code] effectively prevents any new pending connection to be accepted (e.g. when all your players have connected).
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/doc/classes/VehicleBody3D.xml b/doc/classes/VehicleBody3D.xml
index b8b85ff605..5a2cce376e 100644
--- a/doc/classes/VehicleBody3D.xml
+++ b/doc/classes/VehicleBody3D.xml
@@ -6,6 +6,7 @@
<description>
This node implements all the physics logic needed to simulate a car. It is based on the raycast vehicle system commonly found in physics engines. You will need to add a [CollisionShape3D] for the main body of your vehicle and add [VehicleWheel3D] nodes for the wheels. You should also add a [MeshInstance3D] to this node for the 3D model of your car but this model should not include meshes for the wheels. You should control the vehicle by using the [member brake], [member engine_force], and [member steering] properties and not change the position or orientation of this node directly.
[b]Note:[/b] The origin point of your VehicleBody3D will determine the center of gravity of your vehicle so it is better to keep this low and move the [CollisionShape3D] and [MeshInstance3D] upwards.
+ [b]Note:[/b] This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another [PhysicsBody3D] class.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VehicleWheel3D.xml b/doc/classes/VehicleWheel3D.xml
index c71d797eff..97b2abfa92 100644
--- a/doc/classes/VehicleWheel3D.xml
+++ b/doc/classes/VehicleWheel3D.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
This node needs to be used as a child node of [VehicleBody3D] and simulates the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface.
+ [b]Note:[/b] This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another [PhysicsBody3D] class.
</description>
<tutorials>
</tutorials>