Validate code tags in documentation for potential params

Adds a check to make_rst to look for matches
between the text inside of the [code][/code] tag
and known param identifiers.
Fixes most of what was revealed.
This commit is contained in:
Yuri Sizov 2023-04-26 21:36:04 +02:00
parent e2e870c611
commit 391eccca76
44 changed files with 191 additions and 175 deletions

View File

@ -78,7 +78,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="index" type="int" /> <param index="0" name="index" type="int" />
<description> <description>
Removes the point at [code]index[/code] from the curve. Removes the point at [param index] from the curve.
</description> </description>
</method> </method>
<method name="sample" qualifiers="const"> <method name="sample" qualifiers="const">

View File

@ -80,7 +80,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="idx" type="int" /> <param index="0" name="idx" type="int" />
<description> <description>
Deletes the point [code]idx[/code] from the curve. Sends an error to the console if [code]idx[/code] is out of bounds. Deletes the point [param idx] from the curve. Sends an error to the console if [param idx] is out of bounds.
</description> </description>
</method> </method>
<method name="sample" qualifiers="const"> <method name="sample" qualifiers="const">

View File

@ -100,7 +100,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="idx" type="int" /> <param index="0" name="idx" type="int" />
<description> <description>
Deletes the point [code]idx[/code] from the curve. Sends an error to the console if [code]idx[/code] is out of bounds. Deletes the point [param idx] from the curve. Sends an error to the console if [param idx] is out of bounds.
</description> </description>
</method> </method>
<method name="sample" qualifiers="const"> <method name="sample" qualifiers="const">

View File

@ -13,21 +13,21 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="branch_name" type="String" /> <param index="0" name="branch_name" type="String" />
<description> <description>
Checks out a [code]branch_name[/code] in the VCS. Checks out a [param branch_name] in the VCS.
</description> </description>
</method> </method>
<method name="_commit" qualifiers="virtual"> <method name="_commit" qualifiers="virtual">
<return type="void" /> <return type="void" />
<param index="0" name="msg" type="String" /> <param index="0" name="msg" type="String" />
<description> <description>
Commits the currently staged changes and applies the commit [code]msg[/code] to the resulting commit. Commits the currently staged changes and applies the commit [param msg] to the resulting commit.
</description> </description>
</method> </method>
<method name="_create_branch" qualifiers="virtual"> <method name="_create_branch" qualifiers="virtual">
<return type="void" /> <return type="void" />
<param index="0" name="branch_name" type="String" /> <param index="0" name="branch_name" type="String" />
<description> <description>
Creates a new branch named [code]branch_name[/code] in the VCS. Creates a new branch named [param branch_name] in the VCS.
</description> </description>
</method> </method>
<method name="_create_remote" qualifiers="virtual"> <method name="_create_remote" qualifiers="virtual">
@ -35,21 +35,21 @@
<param index="0" name="remote_name" type="String" /> <param index="0" name="remote_name" type="String" />
<param index="1" name="remote_url" type="String" /> <param index="1" name="remote_url" type="String" />
<description> <description>
Creates a new remote destination with name [code]remote_name[/code] and points it to [code]remote_url[/code]. This can be an HTTPS remote or an SSH remote. Creates a new remote destination with name [param remote_name] and points it to [param remote_url]. This can be an HTTPS remote or an SSH remote.
</description> </description>
</method> </method>
<method name="_discard_file" qualifiers="virtual"> <method name="_discard_file" qualifiers="virtual">
<return type="void" /> <return type="void" />
<param index="0" name="file_path" type="String" /> <param index="0" name="file_path" type="String" />
<description> <description>
Discards the changes made in a file present at [code]file_path[/code]. Discards the changes made in a file present at [param file_path].
</description> </description>
</method> </method>
<method name="_fetch" qualifiers="virtual"> <method name="_fetch" qualifiers="virtual">
<return type="void" /> <return type="void" />
<param index="0" name="remote" type="String" /> <param index="0" name="remote" type="String" />
<description> <description>
Fetches new changes from the remote, but doesn't write changes to the current working directory. Equivalent to [code]git fetch[/code]. Fetches new changes from the [param remote], but doesn't write changes to the current working directory. Equivalent to [code]git fetch[/code].
</description> </description>
</method> </method>
<method name="_get_branch_list" qualifiers="virtual"> <method name="_get_branch_list" qualifiers="virtual">
@ -69,7 +69,7 @@
<param index="0" name="identifier" type="String" /> <param index="0" name="identifier" type="String" />
<param index="1" name="area" type="int" /> <param index="1" name="area" type="int" />
<description> <description>
Returns an array of [Dictionary] items (see [method create_diff_file], [method create_diff_hunk], [method create_diff_line], [method add_line_diffs_into_diff_hunk] and [method add_diff_hunks_into_diff_file]), each containing information about a diff. If [code]identifier[/code] is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff. Returns an array of [Dictionary] items (see [method create_diff_file], [method create_diff_hunk], [method create_diff_line], [method add_line_diffs_into_diff_hunk] and [method add_diff_hunks_into_diff_file]), each containing information about a diff. If [param identifier] is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff.
</description> </description>
</method> </method>
<method name="_get_line_diff" qualifiers="virtual"> <method name="_get_line_diff" qualifiers="virtual">
@ -77,7 +77,7 @@
<param index="0" name="file_path" type="String" /> <param index="0" name="file_path" type="String" />
<param index="1" name="text" type="String" /> <param index="1" name="text" type="String" />
<description> <description>
Returns an [Array] of [Dictionary] items (see [method create_diff_hunk]), each containing a line diff between a file at [code]file_path[/code] and the [code]text[/code] which is passed in. Returns an [Array] of [Dictionary] items (see [method create_diff_hunk]), each containing a line diff between a file at [param file_path] and the [param text] which is passed in.
</description> </description>
</method> </method>
<method name="_get_modified_files_data" qualifiers="virtual"> <method name="_get_modified_files_data" qualifiers="virtual">
@ -109,7 +109,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="project_path" type="String" /> <param index="0" name="project_path" type="String" />
<description> <description>
Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at [code]project_path[/code]. Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at [param project_path].
</description> </description>
</method> </method>
<method name="_pull" qualifiers="virtual"> <method name="_pull" qualifiers="virtual">
@ -149,7 +149,7 @@
<param index="3" name="ssh_private_key_path" type="String" /> <param index="3" name="ssh_private_key_path" type="String" />
<param index="4" name="ssh_passphrase" type="String" /> <param index="4" name="ssh_passphrase" type="String" />
<description> <description>
Set user credentials in the underlying VCS. [code]username[/code] and [code]password[/code] are used only during HTTPS authentication unless not already mentioned in the remote URL. [code]ssh_public_key_path[/code], [code]ssh_private_key_path[/code], and [code]ssh_passphrase[/code] are only used during SSH authentication. Set user credentials in the underlying VCS. [param username] and [param password] are used only during HTTPS authentication unless not already mentioned in the remote URL. [param ssh_public_key_path], [param ssh_private_key_path], and [param ssh_passphrase] are only used during SSH authentication.
</description> </description>
</method> </method>
<method name="_shut_down" qualifiers="virtual"> <method name="_shut_down" qualifiers="virtual">
@ -162,14 +162,14 @@
<return type="void" /> <return type="void" />
<param index="0" name="file_path" type="String" /> <param index="0" name="file_path" type="String" />
<description> <description>
Stages the file present at [code]file_path[/code] to the staged area. Stages the file present at [param file_path] to the staged area.
</description> </description>
</method> </method>
<method name="_unstage_file" qualifiers="virtual"> <method name="_unstage_file" qualifiers="virtual">
<return type="void" /> <return type="void" />
<param index="0" name="file_path" type="String" /> <param index="0" name="file_path" type="String" />
<description> <description>
Unstages the file present at [code]file_path[/code] from the staged area to the unstaged area. Unstages the file present at [param file_path] from the staged area to the unstaged area.
</description> </description>
</method> </method>
<method name="add_diff_hunks_into_diff_file"> <method name="add_diff_hunks_into_diff_file">
@ -177,7 +177,7 @@
<param index="0" name="diff_file" type="Dictionary" /> <param index="0" name="diff_file" type="Dictionary" />
<param index="1" name="diff_hunks" type="Dictionary[]" /> <param index="1" name="diff_hunks" type="Dictionary[]" />
<description> <description>
Helper function to add an array of [code]diff_hunks[/code] into a [code]diff_file[/code]. Helper function to add an array of [param diff_hunks] into a [param diff_file].
</description> </description>
</method> </method>
<method name="add_line_diffs_into_diff_hunk"> <method name="add_line_diffs_into_diff_hunk">
@ -185,7 +185,7 @@
<param index="0" name="diff_hunk" type="Dictionary" /> <param index="0" name="diff_hunk" type="Dictionary" />
<param index="1" name="line_diffs" type="Dictionary[]" /> <param index="1" name="line_diffs" type="Dictionary[]" />
<description> <description>
Helper function to add an array of [code]line_diffs[/code] into a [code]diff_hunk[/code]. Helper function to add an array of [param line_diffs] into a [param diff_hunk].
</description> </description>
</method> </method>
<method name="create_commit"> <method name="create_commit">
@ -196,7 +196,7 @@
<param index="3" name="unix_timestamp" type="int" /> <param index="3" name="unix_timestamp" type="int" />
<param index="4" name="offset_minutes" type="int" /> <param index="4" name="offset_minutes" type="int" />
<description> <description>
Helper function to create a commit [Dictionary] item. [code]msg[/code] is the commit message of the commit. [code]author[/code] is a single human-readable string containing all the author's details, e.g. the email and name configured in the VCS. [code]id[/code] is the identifier of the commit, in whichever format your VCS may provide an identifier to commits. [code]unix_timestamp[/code] is the UTC Unix timestamp of when the commit was created. [code]offset_minutes[/code] is the timezone offset in minutes, recorded from the system timezone where the commit was created. Helper function to create a commit [Dictionary] item. [param msg] is the commit message of the commit. [param author] is a single human-readable string containing all the author's details, e.g. the email and name configured in the VCS. [param id] is the identifier of the commit, in whichever format your VCS may provide an identifier to commits. [param unix_timestamp] is the UTC Unix timestamp of when the commit was created. [param offset_minutes] is the timezone offset in minutes, recorded from the system timezone where the commit was created.
</description> </description>
</method> </method>
<method name="create_diff_file"> <method name="create_diff_file">
@ -204,7 +204,7 @@
<param index="0" name="new_file" type="String" /> <param index="0" name="new_file" type="String" />
<param index="1" name="old_file" type="String" /> <param index="1" name="old_file" type="String" />
<description> <description>
Helper function to create a [code]Dictionary[/code] for storing old and new diff file paths. Helper function to create a [Dictionary] for storing old and new diff file paths.
</description> </description>
</method> </method>
<method name="create_diff_hunk"> <method name="create_diff_hunk">
@ -214,7 +214,7 @@
<param index="2" name="old_lines" type="int" /> <param index="2" name="old_lines" type="int" />
<param index="3" name="new_lines" type="int" /> <param index="3" name="new_lines" type="int" />
<description> <description>
Helper function to create a [code]Dictionary[/code] for storing diff hunk data. [code]old_start[/code] is the starting line number in old file. [code]new_start[/code] is the starting line number in new file. [code]old_lines[/code] is the number of lines in the old file. [code]new_lines[/code] is the number of lines in the new file. Helper function to create a [Dictionary] for storing diff hunk data. [param old_start] is the starting line number in old file. [param new_start] is the starting line number in new file. [param old_lines] is the number of lines in the old file. [param new_lines] is the number of lines in the new file.
</description> </description>
</method> </method>
<method name="create_diff_line"> <method name="create_diff_line">
@ -224,7 +224,7 @@
<param index="2" name="content" type="String" /> <param index="2" name="content" type="String" />
<param index="3" name="status" type="String" /> <param index="3" name="status" type="String" />
<description> <description>
Helper function to create a [code]Dictionary[/code] for storing a line diff. [code]new_line_no[/code] is the line number in the new file (can be [code]-1[/code] if the line is deleted). [code]old_line_no[/code] is the line number in the old file (can be [code]-1[/code] if the line is added). [code]content[/code] is the diff text. [code]status[/code] is a single character string which stores the line origin. Helper function to create a [Dictionary] for storing a line diff. [param new_line_no] is the line number in the new file (can be [code]-1[/code] if the line is deleted). [param old_line_no] is the line number in the old file (can be [code]-1[/code] if the line is added). [param content] is the diff text. [param status] is a single character string which stores the line origin.
</description> </description>
</method> </method>
<method name="create_status_file"> <method name="create_status_file">
@ -233,7 +233,7 @@
<param index="1" name="change_type" type="int" enum="EditorVCSInterface.ChangeType" /> <param index="1" name="change_type" type="int" enum="EditorVCSInterface.ChangeType" />
<param index="2" name="area" type="int" enum="EditorVCSInterface.TreeArea" /> <param index="2" name="area" type="int" enum="EditorVCSInterface.TreeArea" />
<description> <description>
Helper function to create a [code]Dictionary[/code] used by editor to read the status of a file. Helper function to create a [Dictionary] used by editor to read the status of a file.
</description> </description>
</method> </method>
<method name="popup_error"> <method name="popup_error">

View File

@ -50,7 +50,7 @@
<param index="1" name="enable" type="bool" /> <param index="1" name="enable" type="bool" />
<param index="2" name="arguments" type="Array" default="[]" /> <param index="2" name="arguments" type="Array" default="[]" />
<description> <description>
Calls the [code]toggle[/code] callable of the profiler with given [param name] and [param arguments]. Enables/Disables the same profiler depending on [code]enable[/code] argument. Calls the [code]toggle[/code] callable of the profiler with given [param name] and [param arguments]. Enables/Disables the same profiler depending on [param enable] argument.
</description> </description>
</method> </method>
<method name="register_message_capture"> <method name="register_message_capture">

View File

@ -204,7 +204,7 @@
<return type="int" /> <return type="int" />
<param index="0" name="file" type="String" /> <param index="0" name="file" type="String" />
<description> <description>
Returns the last time the [param file] was modified in Unix timestamp format or returns a [String] "ERROR IN [code]file[/code]". This Unix timestamp can be converted to another format using the [Time] singleton. Returns the last time the [param file] was modified in Unix timestamp format or returns a [String] "ERROR IN [param file]". This Unix timestamp can be converted to another format using the [Time] singleton.
</description> </description>
</method> </method>
<method name="get_open_error" qualifiers="static"> <method name="get_open_error" qualifiers="static">

View File

@ -26,7 +26,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="data" type="Image[]" /> <param index="0" name="data" type="Image[]" />
<description> <description>
Replaces the texture's existing data with the layers specified in [code]data[/code]. The size of [code]data[/code] must match the parameters that were used for [method create]. In other words, the texture cannot be resized or have its format changed by calling [method update]. Replaces the texture's existing data with the layers specified in [param data]. The size of [param data] must match the parameters that were used for [method create]. In other words, the texture cannot be resized or have its format changed by calling [method update].
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -22,7 +22,7 @@
<param index="0" name="image" type="Image" /> <param index="0" name="image" type="Image" />
<param index="1" name="layer" type="int" /> <param index="1" name="layer" type="int" />
<description> <description>
Replaces the existing [Image] data at the given [code]layer[/code] with this new image. Replaces the existing [Image] data at the given [param layer] with this new image.
The given [Image] must have the same width, height, image format and mipmapping setting (a [code]bool[/code] value) as the rest of the referenced images. The given [Image] must have the same width, height, image format and mipmapping setting (a [code]bool[/code] value) as the rest of the referenced images.
If the image format is unsupported, it will be decompressed and converted to a similar and supported [enum Image.Format]. If the image format is unsupported, it will be decompressed and converted to a similar and supported [enum Image.Format].
The update is immediate: it's synchronized with drawing. The update is immediate: it's synchronized with drawing.

View File

@ -203,7 +203,7 @@
[b]Note:[/b] [kbd]Backspace[/kbd] is always removing individual composite character components. [b]Note:[/b] [kbd]Backspace[/kbd] is always removing individual composite character components.
</member> </member>
<member name="clear_button_enabled" type="bool" setter="set_clear_button_enabled" getter="is_clear_button_enabled" default="false"> <member name="clear_button_enabled" type="bool" setter="set_clear_button_enabled" getter="is_clear_button_enabled" default="false">
If [code]true[/code], the [LineEdit] will show a clear button if [code]text[/code] is not empty, which can be used to clear the text quickly. If [code]true[/code], the [LineEdit] will show a clear button if [member text] is not empty, which can be used to clear the text quickly.
</member> </member>
<member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true"> <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true">
If [code]true[/code], the context menu will appear when right-clicked. If [code]true[/code], the context menu will appear when right-clicked.
@ -302,7 +302,7 @@
<signal name="text_change_rejected"> <signal name="text_change_rejected">
<param index="0" name="rejected_substring" type="String" /> <param index="0" name="rejected_substring" type="String" />
<description> <description>
Emitted when appending text that overflows the [member max_length]. The appended text is truncated to fit [member max_length], and the part that couldn't fit is passed as the [code]rejected_substring[/code] argument. Emitted when appending text that overflows the [member max_length]. The appended text is truncated to fit [member max_length], and the part that couldn't fit is passed as the [param rejected_substring] argument.
</description> </description>
</signal> </signal>
<signal name="text_changed"> <signal name="text_changed">
@ -487,7 +487,7 @@
Texture for the clear button. See [member clear_button_enabled]. Texture for the clear button. See [member clear_button_enabled].
</theme_item> </theme_item>
<theme_item name="focus" data_type="style" type="StyleBox"> <theme_item name="focus" data_type="style" type="StyleBox">
Background used when [LineEdit] has GUI focus. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. Background used when [LineEdit] has GUI focus. The [theme_item focus] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
</theme_item> </theme_item>
<theme_item name="normal" data_type="style" type="StyleBox"> <theme_item name="normal" data_type="style" type="StyleBox">
Default background for the [LineEdit]. Default background for the [LineEdit].

View File

@ -26,7 +26,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<description> <description>
Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [code]layer_number[/code] between 1 and 32. Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="set_global_end_position"> <method name="set_global_end_position">
@ -48,7 +48,7 @@
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<param index="1" name="value" type="bool" /> <param index="1" name="value" type="bool" />
<description> <description>
Based on [code]value[/code], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [code]layer_number[/code] between 1 and 32. Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
</methods> </methods>
@ -65,7 +65,7 @@
The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius]. The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius].
</member> </member>
<member name="enter_cost" type="float" setter="set_enter_cost" getter="get_enter_cost" default="0.0"> <member name="enter_cost" type="float" setter="set_enter_cost" getter="get_enter_cost" default="0.0">
When pathfinding enters this link from another regions navigation mesh the [code]enter_cost[/code] value is added to the path distance for determining the shortest path. When pathfinding enters this link from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path.
</member> </member>
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1"> <member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer2D.map_get_path]. A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer2D.map_get_path].
@ -76,7 +76,7 @@
The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius]. The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius].
</member> </member>
<member name="travel_cost" type="float" setter="set_travel_cost" getter="get_travel_cost" default="1.0"> <member name="travel_cost" type="float" setter="set_travel_cost" getter="get_travel_cost" default="1.0">
When pathfinding moves along the link the traveled distance is multiplied with [code]travel_cost[/code] for determining the shortest path. When pathfinding moves along the link the traveled distance is multiplied with [member travel_cost] for determining the shortest path.
</member> </member>
</members> </members>
</class> </class>

View File

@ -26,7 +26,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<description> <description>
Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [code]layer_number[/code] between 1 and 32. Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="set_global_end_position"> <method name="set_global_end_position">
@ -48,7 +48,7 @@
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<param index="1" name="value" type="bool" /> <param index="1" name="value" type="bool" />
<description> <description>
Based on [code]value[/code], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [code]layer_number[/code] between 1 and 32. Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
</methods> </methods>
@ -65,7 +65,7 @@
The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius]. The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius].
</member> </member>
<member name="enter_cost" type="float" setter="set_enter_cost" getter="get_enter_cost" default="0.0"> <member name="enter_cost" type="float" setter="set_enter_cost" getter="get_enter_cost" default="0.0">
When pathfinding enters this link from another regions navigation mesh the [code]enter_cost[/code] value is added to the path distance for determining the shortest path. When pathfinding enters this link from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path.
</member> </member>
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1"> <member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer3D.map_get_path]. A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer3D.map_get_path].
@ -76,7 +76,7 @@
The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius]. The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius].
</member> </member>
<member name="travel_cost" type="float" setter="set_travel_cost" getter="get_travel_cost" default="1.0"> <member name="travel_cost" type="float" setter="set_travel_cost" getter="get_travel_cost" default="1.0">
When pathfinding moves along the link the traveled distance is multiplied with [code]travel_cost[/code] for determining the shortest path. When pathfinding moves along the link the traveled distance is multiplied with [member travel_cost] for determining the shortest path.
</member> </member>
</members> </members>
</class> </class>

View File

@ -148,7 +148,7 @@
<return type="Vector2" /> <return type="Vector2" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns the ending position of this [code]link[/code]. Returns the ending position of this [param link].
</description> </description>
</method> </method>
<method name="link_get_enter_cost" qualifiers="const"> <method name="link_get_enter_cost" qualifiers="const">
@ -162,14 +162,14 @@
<return type="RID" /> <return type="RID" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns the navigation map [RID] the requested [code]link[/code] is currently assigned to. Returns the navigation map [RID] the requested [param link] is currently assigned to.
</description> </description>
</method> </method>
<method name="link_get_navigation_layers" qualifiers="const"> <method name="link_get_navigation_layers" qualifiers="const">
<return type="int" /> <return type="int" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns the navigation layers for this [code]link[/code]. Returns the navigation layers for this [param link].
</description> </description>
</method> </method>
<method name="link_get_owner_id" qualifiers="const"> <method name="link_get_owner_id" qualifiers="const">
@ -183,7 +183,7 @@
<return type="Vector2" /> <return type="Vector2" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns the starting position of this [code]link[/code]. Returns the starting position of this [param link].
</description> </description>
</method> </method>
<method name="link_get_travel_cost" qualifiers="const"> <method name="link_get_travel_cost" qualifiers="const">
@ -197,7 +197,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns whether this [code]link[/code] can be travelled in both directions. Returns whether this [param link] can be travelled in both directions.
</description> </description>
</method> </method>
<method name="link_set_bidirectional"> <method name="link_set_bidirectional">
@ -205,7 +205,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="bidirectional" type="bool" /> <param index="1" name="bidirectional" type="bool" />
<description> <description>
Sets whether this [code]link[/code] can be travelled in both directions. Sets whether this [param link] can be travelled in both directions.
</description> </description>
</method> </method>
<method name="link_set_end_position"> <method name="link_set_end_position">
@ -213,7 +213,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="position" type="Vector2" /> <param index="1" name="position" type="Vector2" />
<description> <description>
Sets the exit position for the [code]link[/code]. Sets the exit position for the [param link].
</description> </description>
</method> </method>
<method name="link_set_enter_cost"> <method name="link_set_enter_cost">
@ -221,7 +221,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="enter_cost" type="float" /> <param index="1" name="enter_cost" type="float" />
<description> <description>
Sets the [code]enter_cost[/code] for this [code]link[/code]. Sets the [param enter_cost] for this [param link].
</description> </description>
</method> </method>
<method name="link_set_map"> <method name="link_set_map">
@ -253,7 +253,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="position" type="Vector2" /> <param index="1" name="position" type="Vector2" />
<description> <description>
Sets the entry position for this [code]link[/code]. Sets the entry position for this [param link].
</description> </description>
</method> </method>
<method name="link_set_travel_cost"> <method name="link_set_travel_cost">
@ -261,7 +261,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="travel_cost" type="float" /> <param index="1" name="travel_cost" type="float" />
<description> <description>
Sets the [code]travel_cost[/code] for this [code]link[/code]. Sets the [param travel_cost] for this [param link].
</description> </description>
</method> </method>
<method name="map_create"> <method name="map_create">
@ -328,7 +328,7 @@
<return type="RID[]" /> <return type="RID[]" />
<param index="0" name="map" type="RID" /> <param index="0" name="map" type="RID" />
<description> <description>
Returns all navigation link [RID]s that are currently assigned to the requested navigation [code]map[/code]. Returns all navigation link [RID]s that are currently assigned to the requested navigation [param map].
</description> </description>
</method> </method>
<method name="map_get_path" qualifiers="const"> <method name="map_get_path" qualifiers="const">

View File

@ -155,7 +155,7 @@
<return type="Vector3" /> <return type="Vector3" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns the ending position of this [code]link[/code]. Returns the ending position of this [param link].
</description> </description>
</method> </method>
<method name="link_get_enter_cost" qualifiers="const"> <method name="link_get_enter_cost" qualifiers="const">
@ -169,14 +169,14 @@
<return type="RID" /> <return type="RID" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns the navigation map [RID] the requested [code]link[/code] is currently assigned to. Returns the navigation map [RID] the requested [param link] is currently assigned to.
</description> </description>
</method> </method>
<method name="link_get_navigation_layers" qualifiers="const"> <method name="link_get_navigation_layers" qualifiers="const">
<return type="int" /> <return type="int" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns the navigation layers for this [code]link[/code]. Returns the navigation layers for this [param link].
</description> </description>
</method> </method>
<method name="link_get_owner_id" qualifiers="const"> <method name="link_get_owner_id" qualifiers="const">
@ -190,7 +190,7 @@
<return type="Vector3" /> <return type="Vector3" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns the starting position of this [code]link[/code]. Returns the starting position of this [param link].
</description> </description>
</method> </method>
<method name="link_get_travel_cost" qualifiers="const"> <method name="link_get_travel_cost" qualifiers="const">
@ -204,7 +204,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<description> <description>
Returns whether this [code]link[/code] can be travelled in both directions. Returns whether this [param link] can be travelled in both directions.
</description> </description>
</method> </method>
<method name="link_set_bidirectional"> <method name="link_set_bidirectional">
@ -212,7 +212,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="bidirectional" type="bool" /> <param index="1" name="bidirectional" type="bool" />
<description> <description>
Sets whether this [code]link[/code] can be travelled in both directions. Sets whether this [param link] can be travelled in both directions.
</description> </description>
</method> </method>
<method name="link_set_end_position"> <method name="link_set_end_position">
@ -220,7 +220,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="position" type="Vector3" /> <param index="1" name="position" type="Vector3" />
<description> <description>
Sets the exit position for the [code]link[/code]. Sets the exit position for the [param link].
</description> </description>
</method> </method>
<method name="link_set_enter_cost"> <method name="link_set_enter_cost">
@ -228,7 +228,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="enter_cost" type="float" /> <param index="1" name="enter_cost" type="float" />
<description> <description>
Sets the [code]enter_cost[/code] for this [code]link[/code]. Sets the [param enter_cost] for this [param link].
</description> </description>
</method> </method>
<method name="link_set_map"> <method name="link_set_map">
@ -260,7 +260,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="position" type="Vector3" /> <param index="1" name="position" type="Vector3" />
<description> <description>
Sets the entry position for this [code]link[/code]. Sets the entry position for this [param link].
</description> </description>
</method> </method>
<method name="link_set_travel_cost"> <method name="link_set_travel_cost">
@ -268,7 +268,7 @@
<param index="0" name="link" type="RID" /> <param index="0" name="link" type="RID" />
<param index="1" name="travel_cost" type="float" /> <param index="1" name="travel_cost" type="float" />
<description> <description>
Sets the [code]travel_cost[/code] for this [code]link[/code]. Sets the [param travel_cost] for this [param link].
</description> </description>
</method> </method>
<method name="map_create"> <method name="map_create">
@ -353,7 +353,7 @@
<return type="RID[]" /> <return type="RID[]" />
<param index="0" name="map" type="RID" /> <param index="0" name="map" type="RID" />
<description> <description>
Returns all navigation link [RID]s that are currently assigned to the requested navigation [code]map[/code]. Returns all navigation link [RID]s that are currently assigned to the requested navigation [param map].
</description> </description>
</method> </method>
<method name="map_get_path" qualifiers="const"> <method name="map_get_path" qualifiers="const">

View File

@ -15,7 +15,7 @@
<param index="0" name="transform" type="Transform3D" /> <param index="0" name="transform" type="Transform3D" />
<param index="1" name="rotation_mode" type="int" enum="PathFollow3D.RotationMode" /> <param index="1" name="rotation_mode" type="int" enum="PathFollow3D.RotationMode" />
<description> <description>
Correct the [code]transform[/code]. [code]rotation_mode[/code] implicitly specifies how posture (forward, up and sideway direction) is calculated. Correct the [param transform]. [param rotation_mode] implicitly specifies how posture (forward, up and sideway direction) is calculated.
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -595,7 +595,7 @@
Sets the function used to calculate physics for the body, if that body allows it (see [method body_set_omit_force_integration]). Sets the function used to calculate physics for the body, if that body allows it (see [method body_set_omit_force_integration]).
The force integration function takes the following two parameters: The force integration function takes the following two parameters:
1. a [PhysicsDirectBodyState2D] [code]state[/code]: used to retrieve and modify the body's state, 1. a [PhysicsDirectBodyState2D] [code]state[/code]: used to retrieve and modify the body's state,
2. a [Variant] [code]userdata[/code]: optional user data. 2. a [Variant] [param userdata]: optional user data.
[b]Note:[/b] This callback is currently not called in Godot Physics. [b]Note:[/b] This callback is currently not called in Godot Physics.
</description> </description>
</method> </method>

View File

@ -20,9 +20,9 @@
<param index="0" name="hint" type="Dictionary" /> <param index="0" name="hint" type="Dictionary" />
<description> <description>
Adds a custom property info to a property. The dictionary must contain: Adds a custom property info to a property. The dictionary must contain:
- [code]name[/code]: [String] (the property's name) - [code]"name"[/code]: [String] (the property's name)
- [code]type[/code]: [int] (see [enum Variant.Type]) - [code]"type"[/code]: [int] (see [enum Variant.Type])
- optionally [code]hint[/code]: [int] (see [enum PropertyHint]) and [code]hint_string[/code]: [String] - optionally [code]"hint"[/code]: [int] (see [enum PropertyHint]) and [code]"hint_string"[/code]: [String]
[b]Example:[/b] [b]Example:[/b]
[codeblocks] [codeblocks]
[gdscript] [gdscript]

View File

@ -154,7 +154,7 @@
<param index="0" name="b" type="Rect2" /> <param index="0" name="b" type="Rect2" />
<param index="1" name="include_borders" type="bool" default="false" /> <param index="1" name="include_borders" type="bool" default="false" />
<description> <description>
Returns [code]true[/code] if the [Rect2] overlaps with [code]b[/code] (i.e. they have at least one point in common). Returns [code]true[/code] if the [Rect2] overlaps with [param b] (i.e. they have at least one point in common).
If [param include_borders] is [code]true[/code], they will also be considered overlapping if their borders touch, even without intersection. If [param include_borders] is [code]true[/code], they will also be considered overlapping if their borders touch, even without intersection.
</description> </description>
</method> </method>

View File

@ -143,7 +143,7 @@
<return type="Rect2i" /> <return type="Rect2i" />
<param index="0" name="b" type="Rect2i" /> <param index="0" name="b" type="Rect2i" />
<description> <description>
Returns the intersection of this [Rect2i] and [code]b[/code]. Returns the intersection of this [Rect2i] and [param b].
If the rectangles do not intersect, an empty [Rect2i] is returned. If the rectangles do not intersect, an empty [Rect2i] is returned.
</description> </description>
</method> </method>
@ -151,7 +151,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="b" type="Rect2i" /> <param index="0" name="b" type="Rect2i" />
<description> <description>
Returns [code]true[/code] if the [Rect2i] overlaps with [code]b[/code] (i.e. they have at least one point in common). Returns [code]true[/code] if the [Rect2i] overlaps with [param b] (i.e. they have at least one point in common).
</description> </description>
</method> </method>
<method name="merge" qualifiers="const"> <method name="merge" qualifiers="const">

View File

@ -62,9 +62,9 @@
<param index="3" name="ignore_time_scale" type="bool" default="false" /> <param index="3" name="ignore_time_scale" type="bool" default="false" />
<description> <description>
Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this [SceneTree]. Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this [SceneTree].
If [code]process_always[/code] is set to [code]false[/code], pausing the [SceneTree] will also pause the timer. If [param process_always] is set to [code]false[/code], pausing the [SceneTree] will also pause the timer.
If [code]process_in_physics[/code] is set to [code]true[/code], will update the [SceneTreeTimer] during the physics frame instead of the process frame (fixed framerate processing). If [param process_in_physics] is set to [code]true[/code], will update the [SceneTreeTimer] during the physics frame instead of the process frame (fixed framerate processing).
If [code]ignore_time_scale[/code] is set to [code]true[/code], will ignore [member Engine.time_scale] and update the [SceneTreeTimer] with the actual frame delta. If [param ignore_time_scale] is set to [code]true[/code], will ignore [member Engine.time_scale] and update the [SceneTreeTimer] with the actual frame delta.
Commonly used to create a one-shot delay timer as in the following example: Commonly used to create a one-shot delay timer as in the following example:
[codeblocks] [codeblocks]
[gdscript] [gdscript]

View File

@ -4,7 +4,7 @@
SkeletonIK3D is used to place the end bone of a [Skeleton3D] bone chain at a certain point in 3D by rotating all bones in the chain accordingly. SkeletonIK3D is used to place the end bone of a [Skeleton3D] bone chain at a certain point in 3D by rotating all bones in the chain accordingly.
</brief_description> </brief_description>
<description> <description>
SkeletonIK3D is used to place the end bone of a [Skeleton3D] bone chain at a certain point in 3D by rotating all bones in the chain accordingly. A typical scenario for IK in games is to place a characters feet on the ground or a characters hands on a currently hold object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the [Skeleton3D] [code]bones_global_pose_override[/code] property for all affected bones in the chain. If fully applied this overwrites any bone transform from [Animation]s or bone custom poses set by users. The applied amount can be controlled with the [code]interpolation[/code] property. SkeletonIK3D is used to place the end bone of a [Skeleton3D] bone chain at a certain point in 3D by rotating all bones in the chain accordingly. A typical scenario for IK in games is to place a characters feet on the ground or a characters hands on a currently hold object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the [Skeleton3D] [code]bones_global_pose_override[/code] property for all affected bones in the chain. If fully applied this overwrites any bone transform from [Animation]s or bone custom poses set by users. The applied amount can be controlled with the [member interpolation] property.
[codeblock] [codeblock]
# Apply IK effect automatically on every new frame (not the current) # Apply IK effect automatically on every new frame (not the current)
skeleton_ik_node.start() skeleton_ik_node.start()
@ -45,7 +45,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="one_time" type="bool" default="false" /> <param index="0" name="one_time" type="bool" default="false" />
<description> <description>
Starts applying IK effects on each frame to the [Skeleton3D] bones but will only take effect starting on the next frame. If [code]one_time[/code] is [code]true[/code], this will take effect immediately but also reset on the next frame. Starts applying IK effects on each frame to the [Skeleton3D] bones but will only take effect starting on the next frame. If [param one_time] is [code]true[/code], this will take effect immediately but also reset on the next frame.
</description> </description>
</method> </method>
<method name="stop"> <method name="stop">

View File

@ -69,7 +69,7 @@
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<param index="1" name="value" type="bool" /> <param index="1" name="value" type="bool" />
<description> <description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32. Based on [param value], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="set_collision_mask_value"> <method name="set_collision_mask_value">
@ -77,7 +77,7 @@
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<param index="1" name="value" type="bool" /> <param index="1" name="value" type="bool" />
<description> <description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32. Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="set_point_pinned"> <method name="set_point_pinned">

View File

@ -867,7 +867,7 @@
<description> <description>
Moves the caret to the specified [param line] index. Moves the caret to the specified [param line] index.
If [param adjust_viewport] is [code]true[/code], the viewport will center at the caret position after the move occurs. If [param adjust_viewport] is [code]true[/code], the viewport will center at the caret position after the move occurs.
If [param can_be_hidden] is [code]true[/code], the specified [code]line[/code] can be hidden. If [param can_be_hidden] is [code]true[/code], the specified [param line] can be hidden.
[b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets]. [b]Note:[/b] If supporting multiple carets this will not check for any overlap. See [method merge_overlapping_carets].
</description> </description>
</method> </method>
@ -1061,7 +1061,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="action" type="int" enum="TextEdit.EditAction" /> <param index="0" name="action" type="int" enum="TextEdit.EditAction" />
<description> <description>
Starts an action, will end the current action if [code]action[/code] is different. Starts an action, will end the current action if [param action] is different.
An action will also end after a call to [method end_action], after [member ProjectSettings.gui/timers/text_edit_idle_detect_sec] is triggered or a new undoable step outside the [method start_action] and [method end_action] calls. An action will also end after a call to [method end_action], after [member ProjectSettings.gui/timers/text_edit_idle_detect_sec] is triggered or a new undoable step outside the [method start_action] and [method end_action] calls.
</description> </description>
</method> </method>

View File

@ -310,7 +310,7 @@
<description> <description>
Update all the cells in the [param cells] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. If an updated cell has the same terrain as one of its neighboring cells, this function tries to join the two. This function might update neighboring tiles if needed to create correct terrain transitions. Update all the cells in the [param cells] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. If an updated cell has the same terrain as one of its neighboring cells, this function tries to join the two. This function might update neighboring tiles if needed to create correct terrain transitions.
If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints. If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
[b]Note:[/b] To work correctly, [code]set_cells_terrain_connect[/code] requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results. [b]Note:[/b] To work correctly, this method requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results.
</description> </description>
</method> </method>
<method name="set_cells_terrain_path"> <method name="set_cells_terrain_path">
@ -323,7 +323,7 @@
<description> <description>
Update all the cells in the [param path] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. The function will also connect two successive cell in the path with the same terrain. This function might update neighboring tiles if needed to create correct terrain transitions. Update all the cells in the [param path] coordinates array so that they use the given [param terrain] for the given [param terrain_set]. The function will also connect two successive cell in the path with the same terrain. This function might update neighboring tiles if needed to create correct terrain transitions.
If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints. If [param ignore_empty_terrains] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
[b]Note:[/b] To work correctly, [code]set_cells_terrain_path[/code] requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results. [b]Note:[/b] To work correctly, this method requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results.
</description> </description>
</method> </method>
<method name="set_layer_enabled"> <method name="set_layer_enabled">
@ -341,7 +341,7 @@
<param index="1" name="modulate" type="Color" /> <param index="1" name="modulate" type="Color" />
<description> <description>
Sets a layer's color. It will be multiplied by tile's color and TileMap's modulate. Sets a layer's color. It will be multiplied by tile's color and TileMap's modulate.
If [code]layer[/code] is negative, the layers are accessed from the last one. If [param layer] is negative, the layers are accessed from the last one.
</description> </description>
</method> </method>
<method name="set_layer_name"> <method name="set_layer_name">
@ -350,7 +350,7 @@
<param index="1" name="name" type="String" /> <param index="1" name="name" type="String" />
<description> <description>
Sets a layer's name. This is mostly useful in the editor. Sets a layer's name. This is mostly useful in the editor.
If [code]layer[/code] is negative, the layers are accessed from the last one. If [param layer] is negative, the layers are accessed from the last one.
</description> </description>
</method> </method>
<method name="set_layer_y_sort_enabled"> <method name="set_layer_y_sort_enabled">
@ -360,7 +360,7 @@
<description> <description>
Enables or disables a layer's Y-sorting. If a layer is Y-sorted, the layer will behave as a CanvasItem node where each of its tile gets Y-sorted. Enables or disables a layer's Y-sorting. If a layer is Y-sorted, the layer will behave as a CanvasItem node where each of its tile gets Y-sorted.
Y-sorted layers should usually be on different Z-index values than not Y-sorted layers, otherwise, each of those layer will be Y-sorted as whole with the Y-sorted one. This is usually an undesired behavior. Y-sorted layers should usually be on different Z-index values than not Y-sorted layers, otherwise, each of those layer will be Y-sorted as whole with the Y-sorted one. This is usually an undesired behavior.
If [code]layer[/code] is negative, the layers are accessed from the last one. If [param layer] is negative, the layers are accessed from the last one.
</description> </description>
</method> </method>
<method name="set_layer_y_sort_origin"> <method name="set_layer_y_sort_origin">
@ -370,7 +370,7 @@
<description> <description>
Sets a layer's Y-sort origin value. This Y-sort origin value is added to each tile's Y-sort origin value. Sets a layer's Y-sort origin value. This Y-sort origin value is added to each tile's Y-sort origin value.
This allows, for example, to fake a different height level on each layer. This can be useful for top-down view games. This allows, for example, to fake a different height level on each layer. This can be useful for top-down view games.
If [code]layer[/code] is negative, the layers are accessed from the last one. If [param layer] is negative, the layers are accessed from the last one.
</description> </description>
</method> </method>
<method name="set_layer_z_index"> <method name="set_layer_z_index">
@ -379,7 +379,7 @@
<param index="1" name="z_index" type="int" /> <param index="1" name="z_index" type="int" />
<description> <description>
Sets a layers Z-index value. This Z-index is added to each tile's Z-index value. Sets a layers Z-index value. This Z-index is added to each tile's Z-index value.
If [code]layer[/code] is negative, the layers are accessed from the last one. If [param layer] is negative, the layers are accessed from the last one.
</description> </description>
</method> </method>
<method name="set_navigation_map"> <method name="set_navigation_map">
@ -408,7 +408,7 @@
</member> </member>
<member name="collision_animatable" type="bool" setter="set_collision_animatable" getter="is_collision_animatable" default="false"> <member name="collision_animatable" type="bool" setter="set_collision_animatable" getter="is_collision_animatable" default="false">
If enabled, the TileMap will see its collisions synced to the physics tick and change its collision type from static to kinematic. This is required to create TileMap-based moving platform. If enabled, the TileMap will see its collisions synced to the physics tick and change its collision type from static to kinematic. This is required to create TileMap-based moving platform.
[b]Note:[/b] Enabling [code]collision_animatable[/code] may have a small performance impact, only do it if the TileMap is moving and has colliding tiles. [b]Note:[/b] Enabling [member collision_animatable] may have a small performance impact, only do it if the TileMap is moving and has colliding tiles.
</member> </member>
<member name="collision_visibility_mode" type="int" setter="set_collision_visibility_mode" getter="get_collision_visibility_mode" enum="TileMap.VisibilityMode" default="0"> <member name="collision_visibility_mode" type="int" setter="set_collision_visibility_mode" getter="get_collision_visibility_mode" enum="TileMap.VisibilityMode" default="0">
Show or hide the TileMap's collision shapes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show collision debug settings. Show or hide the TileMap's collision shapes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show collision debug settings.

View File

@ -61,21 +61,21 @@
<return type="void" /> <return type="void" />
<param index="0" name="time" type="float" /> <param index="0" name="time" type="float" />
<description> <description>
Seeks to [code]time[/code] seconds. Called in response to the [member VideoStreamPlayer.stream_position] setter. Seeks to [param time] seconds. Called in response to the [member VideoStreamPlayer.stream_position] setter.
</description> </description>
</method> </method>
<method name="_set_audio_track" qualifiers="virtual"> <method name="_set_audio_track" qualifiers="virtual">
<return type="void" /> <return type="void" />
<param index="0" name="idx" type="int" /> <param index="0" name="idx" type="int" />
<description> <description>
Select the audio track [code]idx[/code]. Called when playback starts, and in response to the [member VideoStreamPlayer.audio_track] setter. Select the audio track [param idx]. Called when playback starts, and in response to the [member VideoStreamPlayer.audio_track] setter.
</description> </description>
</method> </method>
<method name="_set_paused" qualifiers="virtual"> <method name="_set_paused" qualifiers="virtual">
<return type="void" /> <return type="void" />
<param index="0" name="paused" type="bool" /> <param index="0" name="paused" type="bool" />
<description> <description>
Set the paused status of video playback. [method _is_paused] must return [code]paused[/code]. Called in response to the [member VideoStreamPlayer.paused] setter. Set the paused status of video playback. [method _is_paused] must return [param paused]. Called in response to the [member VideoStreamPlayer.paused] setter.
</description> </description>
</method> </method>
<method name="_stop" qualifiers="virtual"> <method name="_stop" qualifiers="virtual">
@ -88,7 +88,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="delta" type="float" /> <param index="0" name="delta" type="float" />
<description> <description>
Ticks video playback for [code]delta[/code] seconds. Called every frame as long as [method _is_paused] and [method _is_playing] return true. Ticks video playback for [param delta] seconds. Called every frame as long as [method _is_paused] and [method _is_playing] return true.
</description> </description>
</method> </method>
<method name="mix_audio"> <method name="mix_audio">
@ -97,7 +97,7 @@
<param index="1" name="buffer" type="PackedFloat32Array" default="PackedFloat32Array()" /> <param index="1" name="buffer" type="PackedFloat32Array" default="PackedFloat32Array()" />
<param index="2" name="offset" type="int" default="0" /> <param index="2" name="offset" type="int" default="0" />
<description> <description>
Render [code]num_frames[/code] audio frames (of [method _get_channels] floats each) from [code]buffer[/code], starting from index [code]offset[/code] in the array. Returns the number of audio frames rendered, or -1 on error. Render [param num_frames] audio frames (of [method _get_channels] floats each) from [param buffer], starting from index [param offset] in the array. Returns the number of audio frames rendered, or -1 on error.
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -36,7 +36,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<description> <description>
Returns whether or not the specified layer of the [member layers] is enabled, given a [code]layer_number[/code] between 1 and 20. Returns whether or not the specified layer of the [member layers] is enabled, given a [param layer_number] between 1 and 20.
</description> </description>
</method> </method>
<method name="set_base"> <method name="set_base">

View File

@ -20,7 +20,7 @@
<param index="0" name="from_node" type="Node" default="null" /> <param index="0" name="from_node" type="Node" default="null" />
<param index="1" name="create_visual_debug" type="bool" default="false" /> <param index="1" name="create_visual_debug" type="bool" default="false" />
<description> <description>
Bakes the effect from all [GeometryInstance3D]s marked with [constant GeometryInstance3D.GI_MODE_STATIC] and [Light3D]s marked with either [constant Light3D.BAKE_STATIC] or [constant Light3D.BAKE_DYNAMIC]. If [code]create_visual_debug[/code] is [code]true[/code], after baking the light, this will generate a [MultiMesh] that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the [VoxelGI]'s data and debug any issues that may be occurring. Bakes the effect from all [GeometryInstance3D]s marked with [constant GeometryInstance3D.GI_MODE_STATIC] and [Light3D]s marked with either [constant Light3D.BAKE_STATIC] or [constant Light3D.BAKE_DYNAMIC]. If [param create_visual_debug] is [code]true[/code], after baking the light, this will generate a [MultiMesh] that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the [VoxelGI]'s data and debug any issues that may be occurring.
[b]Note:[/b] [method bake] works from the editor and in exported projects. This makes it suitable for procedurally generated or user-built levels. Baking a [VoxelGI] node generally takes from 5 to 20 seconds in most scenes. Reducing [member subdiv] can speed up baking. [b]Note:[/b] [method bake] works from the editor and in exported projects. This makes it suitable for procedurally generated or user-built levels. Baking a [VoxelGI] node generally takes from 5 to 20 seconds in most scenes. Reducing [member subdiv] can speed up baking.
[b]Note:[/b] [GeometryInstance3D]s and [Light3D]s must be fully ready before [method bake] is called. If you are procedurally creating those and some meshes or lights are missing from your baked [VoxelGI], use [code]call_deferred("bake")[/code] instead of calling [method bake] directly. [b]Note:[/b] [GeometryInstance3D]s and [Light3D]s must be fully ready before [method bake] is called. If you are procedurally creating those and some meshes or lights are missing from your baked [VoxelGI], use [code]call_deferred("bake")[/code] instead of calling [method bake] directly.
</description> </description>

View File

@ -348,16 +348,14 @@
<return type="void" /> <return type="void" />
<param index="0" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)" /> <param index="0" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)" />
<description> <description>
Shows the [Window] and makes it transient (see [member transient]). If [param rect] is provided, it will be set as the [Window]'s size. Shows the [Window] and makes it transient (see [member transient]). If [param rect] is provided, it will be set as the [Window]'s size. Fails if called on the main window.
Fails if called on the main window.
</description> </description>
</method> </method>
<method name="popup_centered"> <method name="popup_centered">
<return type="void" /> <return type="void" />
<param index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" /> <param index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" />
<description> <description>
Popups the [Window] at the center of the current screen, with optionally given minimum size. Popups the [Window] at the center of the current screen, with optionally given minimum size. If the [Window] is embedded, it will be centered in the parent [Viewport] instead.
If the [Window] is embedded, it will be centered in the parent [Viewport] instead.
[b]Note:[/b] Calling it with the default value of [param minsize] is equivalent to calling it with [member size]. [b]Note:[/b] Calling it with the default value of [param minsize] is equivalent to calling it with [member size].
</description> </description>
</method> </method>
@ -366,8 +364,7 @@
<param index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" /> <param index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" />
<param index="1" name="fallback_ratio" type="float" default="0.75" /> <param index="1" name="fallback_ratio" type="float" default="0.75" />
<description> <description>
Popups the [Window] centered inside its parent [Window]. Popups the [Window] centered inside its parent [Window]. [param fallback_ratio] determines the maximum size of the [Window], in relation to its parent.
[code]fallback_ratio[/code] determines the maximum size of the [Window], in relation to its parent.
[b]Note:[/b] Calling it with the default value of [param minsize] is equivalent to calling it with [member size]. [b]Note:[/b] Calling it with the default value of [param minsize] is equivalent to calling it with [member size].
</description> </description>
</method> </method>
@ -382,8 +379,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="parent_rect" type="Rect2i" /> <param index="0" name="parent_rect" type="Rect2i" />
<description> <description>
Popups the [Window] with a position shifted by parent [Window]'s position. Popups the [Window] with a position shifted by parent [Window]'s position. If the [Window] is embedded, has the same effect as [method popup].
If the [Window] is embedded, has the same effect as [method popup].
</description> </description>
</method> </method>
<method name="remove_theme_color_override"> <method name="remove_theme_color_override">

View File

@ -1678,6 +1678,26 @@ def format_text_block(
inside_code_tag = cmd inside_code_tag = cmd
escape_pre = True escape_pre = True
valid_context = isinstance(context, (MethodDef, SignalDef, AnnotationDef))
if valid_context:
endcode_pos = text.find("[/code]", endq_pos + 1)
if endcode_pos == -1:
print_error(
f"{state.current_class}.xml: Tag depth mismatch for [code]: no closing [/code] in {context_name}.",
state,
)
break
inside_code_text = text[endq_pos + 1 : endcode_pos]
context_params: List[ParameterDef] = context.parameters # type: ignore
for param_def in context_params:
if param_def.name == inside_code_text:
print_warning(
f'{state.current_class}.xml: Potential error inside of a code tag, found a string "{inside_code_text}" that matches one of the parameters in {context_name}.',
state,
)
break
# Cross-references to items in this or other class documentation pages. # Cross-references to items in this or other class documentation pages.
elif is_in_tagset(cmd, RESERVED_CROSSLINK_TAGS): elif is_in_tagset(cmd, RESERVED_CROSSLINK_TAGS):
link_type: str = "" link_type: str = ""

View File

@ -15,14 +15,14 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<description> <description>
Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [code]layer_number[/code] between 1 and 32. Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="get_collision_mask_value" qualifiers="const"> <method name="get_collision_mask_value" qualifiers="const">
<return type="bool" /> <return type="bool" />
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<description> <description>
Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [code]layer_number[/code] between 1 and 32. Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="get_meshes" qualifiers="const"> <method name="get_meshes" qualifiers="const">
@ -42,7 +42,7 @@
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<param index="1" name="value" type="bool" /> <param index="1" name="value" type="bool" />
<description> <description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_layer], given a [code]layer_number[/code] between 1 and 32. Based on [param value], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="set_collision_mask_value"> <method name="set_collision_mask_value">
@ -50,7 +50,7 @@
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<param index="1" name="value" type="bool" /> <param index="1" name="value" type="bool" />
<description> <description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_mask], given a [code]layer_number[/code] between 1 and 32. Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -24,7 +24,7 @@
<param index="1" name="packet" type="PackedByteArray" /> <param index="1" name="packet" type="PackedByteArray" />
<param index="2" name="flags" type="int" /> <param index="2" name="flags" type="int" />
<description> <description>
Queues a [code]packet[/code] to be sent to all peers associated with the host over the specified [code]channel[/code]. See [ENetPacketPeer] [code]FLAG_*[/code] constants for available packet flags. Queues a [param packet] to be sent to all peers associated with the host over the specified [param channel]. See [ENetPacketPeer] [code]FLAG_*[/code] constants for available packet flags.
</description> </description>
</method> </method>
<method name="channel_limit"> <method name="channel_limit">
@ -50,7 +50,7 @@
<param index="2" name="channels" type="int" default="0" /> <param index="2" name="channels" type="int" default="0" />
<param index="3" name="data" type="int" default="0" /> <param index="3" name="data" type="int" default="0" />
<description> <description>
Initiates a connection to a foreign [code]address[/code] using the specified [code]port[/code] and allocating the requested [code]channels[/code]. Optional [code]data[/code] can be passed during connection in the form of a 32 bit integer. Initiates a connection to a foreign [param address] using the specified [param port] and allocating the requested [param channels]. Optional [param data] can be passed during connection in the form of a 32 bit integer.
[b]Note:[/b] You must call either [method create_host] or [method create_host_bound] before calling this method. [b]Note:[/b] You must call either [method create_host] or [method create_host_bound] before calling this method.
</description> </description>
</method> </method>
@ -61,7 +61,7 @@
<param index="2" name="in_bandwidth" type="int" default="0" /> <param index="2" name="in_bandwidth" type="int" default="0" />
<param index="3" name="out_bandwidth" type="int" default="0" /> <param index="3" name="out_bandwidth" type="int" default="0" />
<description> <description>
Create an ENetHost that will allow up to [code]max_peers[/code] connected peers, each allocating up to [code]max_channels[/code] channels, optionally limiting bandwidth to [code]in_bandwidth[/code] and [code]out_bandwidth[/code]. Create an ENetHost that will allow up to [param max_peers] connected peers, each allocating up to [param max_channels] channels, optionally limiting bandwidth to [param in_bandwidth] and [param out_bandwidth].
</description> </description>
</method> </method>
<method name="create_host_bound"> <method name="create_host_bound">
@ -73,7 +73,7 @@
<param index="4" name="in_bandwidth" type="int" default="0" /> <param index="4" name="in_bandwidth" type="int" default="0" />
<param index="5" name="out_bandwidth" type="int" default="0" /> <param index="5" name="out_bandwidth" type="int" default="0" />
<description> <description>
Create an ENetHost like [method create_host] which is also bound to the given [code]bind_address[/code] and [code]bind_port[/code]. Create an ENetHost like [method create_host] which is also bound to the given [param bind_address] and [param bind_port].
</description> </description>
</method> </method>
<method name="destroy"> <method name="destroy">
@ -87,7 +87,7 @@
<param index="0" name="hostname" type="String" /> <param index="0" name="hostname" type="String" />
<param index="1" name="client_options" type="TLSOptions" default="null" /> <param index="1" name="client_options" type="TLSOptions" default="null" />
<description> <description>
Configure this ENetHost to use the custom Godot extension allowing DTLS encryption for ENet clients. Call this before [method connect_to_host] to have ENet connect using DTLS validating the server certificate against [code]hostname[/code]. You can pass the optional [param client_options] parameter to customize the trusted certification authorities, or disable the common name verification. See [method TLSOptions.client] and [method TLSOptions.client_unsafe]. Configure this ENetHost to use the custom Godot extension allowing DTLS encryption for ENet clients. Call this before [method connect_to_host] to have ENet connect using DTLS validating the server certificate against [param hostname]. You can pass the optional [param client_options] parameter to customize the trusted certification authorities, or disable the common name verification. See [method TLSOptions.client] and [method TLSOptions.client_unsafe].
</description> </description>
</method> </method>
<method name="dtls_server_setup"> <method name="dtls_server_setup">

View File

@ -17,8 +17,8 @@
<param index="0" name="peer_id" type="int" /> <param index="0" name="peer_id" type="int" />
<param index="1" name="host" type="ENetConnection" /> <param index="1" name="host" type="ENetConnection" />
<description> <description>
Add a new remote peer with the given [code]peer_id[/code] connected to the given [code]host[/code]. Add a new remote peer with the given [param peer_id] connected to the given [param host].
[b]Note:[/b] The [code]host[/code] must have exactly one peer in the [constant ENetPacketPeer.STATE_CONNECTED] state. [b]Note:[/b] The [param host] must have exactly one peer in the [constant ENetPacketPeer.STATE_CONNECTED] state.
</description> </description>
</method> </method>
<method name="create_client"> <method name="create_client">
@ -30,14 +30,14 @@
<param index="4" name="out_bandwidth" type="int" default="0" /> <param index="4" name="out_bandwidth" type="int" default="0" />
<param index="5" name="local_port" type="int" default="0" /> <param index="5" name="local_port" type="int" default="0" />
<description> <description>
Create client that connects to a server at [code]address[/code] using specified [code]port[/code]. The given address needs to be either a fully qualified domain name (e.g. [code]"www.example.com"[/code]) or an IP address in IPv4 or IPv6 format (e.g. [code]"192.168.1.1"[/code]). The [code]port[/code] is the port the server is listening on. The [code]channel_count[/code] parameter can be used to specify the number of ENet channels allocated for the connection. The [code]in_bandwidth[/code] and [code]out_bandwidth[/code] parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns [constant OK] if a client was created, [constant ERR_ALREADY_IN_USE] if this ENetMultiplayerPeer instance already has an open connection (in which case you need to call [method MultiplayerPeer.close] first) or [constant ERR_CANT_CREATE] if the client could not be created. If [code]local_port[/code] is specified, the client will also listen to the given port; this is useful for some NAT traversal techniques. Create client that connects to a server at [param address] using specified [param port]. The given address needs to be either a fully qualified domain name (e.g. [code]"www.example.com"[/code]) or an IP address in IPv4 or IPv6 format (e.g. [code]"192.168.1.1"[/code]). The [param port] is the port the server is listening on. The [param channel_count] parameter can be used to specify the number of ENet channels allocated for the connection. The [param in_bandwidth] and [param out_bandwidth] parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns [constant OK] if a client was created, [constant ERR_ALREADY_IN_USE] if this ENetMultiplayerPeer instance already has an open connection (in which case you need to call [method MultiplayerPeer.close] first) or [constant ERR_CANT_CREATE] if the client could not be created. If [param local_port] is specified, the client will also listen to the given port; this is useful for some NAT traversal techniques.
</description> </description>
</method> </method>
<method name="create_mesh"> <method name="create_mesh">
<return type="int" enum="Error" /> <return type="int" enum="Error" />
<param index="0" name="unique_id" type="int" /> <param index="0" name="unique_id" type="int" />
<description> <description>
Initialize this [MultiplayerPeer] in mesh mode. The provided [code]unique_id[/code] will be used as the local peer network unique ID once assigned as the [member MultiplayerAPI.multiplayer_peer]. In the mesh configuration you will need to set up each new peer manually using [ENetConnection] before calling [method add_mesh_peer]. While this technique is more advanced, it allows for better control over the connection process (e.g. when dealing with NAT punch-through) and for better distribution of the network load (which would otherwise be more taxing on the server). Initialize this [MultiplayerPeer] in mesh mode. The provided [param unique_id] will be used as the local peer network unique ID once assigned as the [member MultiplayerAPI.multiplayer_peer]. In the mesh configuration you will need to set up each new peer manually using [ENetConnection] before calling [method add_mesh_peer]. While this technique is more advanced, it allows for better control over the connection process (e.g. when dealing with NAT punch-through) and for better distribution of the network load (which would otherwise be more taxing on the server).
</description> </description>
</method> </method>
<method name="create_server"> <method name="create_server">
@ -48,14 +48,14 @@
<param index="3" name="in_bandwidth" type="int" default="0" /> <param index="3" name="in_bandwidth" type="int" default="0" />
<param index="4" name="out_bandwidth" type="int" default="0" /> <param index="4" name="out_bandwidth" type="int" default="0" />
<description> <description>
Create server that listens to connections via [code]port[/code]. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use [method set_bind_ip]. The default IP is the wildcard [code]"*"[/code], which listens on all available interfaces. [code]max_clients[/code] is the maximum number of clients that are allowed at once, any number up to 4095 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see [method create_client]. Returns [constant OK] if a server was created, [constant ERR_ALREADY_IN_USE] if this ENetMultiplayerPeer instance already has an open connection (in which case you need to call [method MultiplayerPeer.close] first) or [constant ERR_CANT_CREATE] if the server could not be created. Create server that listens to connections via [param port]. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use [method set_bind_ip]. The default IP is the wildcard [code]"*"[/code], which listens on all available interfaces. [param max_clients] is the maximum number of clients that are allowed at once, any number up to 4095 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see [method create_client]. Returns [constant OK] if a server was created, [constant ERR_ALREADY_IN_USE] if this ENetMultiplayerPeer instance already has an open connection (in which case you need to call [method MultiplayerPeer.close] first) or [constant ERR_CANT_CREATE] if the server could not be created.
</description> </description>
</method> </method>
<method name="get_peer" qualifiers="const"> <method name="get_peer" qualifiers="const">
<return type="ENetPacketPeer" /> <return type="ENetPacketPeer" />
<param index="0" name="id" type="int" /> <param index="0" name="id" type="int" />
<description> <description>
Returns the [ENetPacketPeer] associated to the given [code]id[/code]. Returns the [ENetPacketPeer] associated to the given [param id].
</description> </description>
</method> </method>
<method name="set_bind_ip"> <method name="set_bind_ip">

View File

@ -40,7 +40,7 @@
<return type="float" /> <return type="float" />
<param index="0" name="statistic" type="int" enum="ENetPacketPeer.PeerStatistic" /> <param index="0" name="statistic" type="int" enum="ENetPacketPeer.PeerStatistic" />
<description> <description>
Returns the requested [code]statistic[/code] for this peer. See [enum PeerStatistic]. Returns the requested [param statistic] for this peer. See [enum PeerStatistic].
</description> </description>
</method> </method>
<method name="is_active" qualifiers="const"> <method name="is_active" qualifiers="const">
@ -80,7 +80,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="ping_interval" type="int" /> <param index="0" name="ping_interval" type="int" />
<description> <description>
Sets the [code]ping_interval[/code] in milliseconds at which pings will be sent to a peer. Pings are used both to monitor the liveness of the connection and also to dynamically adjust the throttle during periods of low traffic so that the throttle has reasonable responsiveness during traffic spikes. The default ping interval is [code]500[/code] milliseconds. Sets the [param ping_interval] in milliseconds at which pings will be sent to a peer. Pings are used both to monitor the liveness of the connection and also to dynamically adjust the throttle during periods of low traffic so that the throttle has reasonable responsiveness during traffic spikes. The default ping interval is [code]500[/code] milliseconds.
</description> </description>
</method> </method>
<method name="reset"> <method name="reset">
@ -95,7 +95,7 @@
<param index="1" name="packet" type="PackedByteArray" /> <param index="1" name="packet" type="PackedByteArray" />
<param index="2" name="flags" type="int" /> <param index="2" name="flags" type="int" />
<description> <description>
Queues a [code]packet[/code] to be sent over the specified [code]channel[/code]. See [code]FLAG_*[/code] constants for available packet flags. Queues a [param packet] to be sent over the specified [param channel]. See [code]FLAG_*[/code] constants for available packet flags.
</description> </description>
</method> </method>
<method name="set_timeout"> <method name="set_timeout">
@ -105,7 +105,7 @@
<param index="2" name="timeout_max" type="int" /> <param index="2" name="timeout_max" type="int" />
<description> <description>
Sets the timeout parameters for a peer. The timeout parameters control how and when a peer will timeout from a failure to acknowledge reliable traffic. Timeout values are expressed in milliseconds. Sets the timeout parameters for a peer. The timeout parameters control how and when a peer will timeout from a failure to acknowledge reliable traffic. Timeout values are expressed in milliseconds.
The [code]timeout_limit[/code] is a factor that, multiplied by a value based on the average round trip time, will determine the timeout limit for a reliable packet. When that limit is reached, the timeout will be doubled, and the peer will be disconnected if that limit has reached [code]timeout_min[/code]. The [code]timeout_max[/code] parameter, on the other hand, defines a fixed timeout for which any packet must be acknowledged or the peer will be dropped. The [param timeout] is a factor that, multiplied by a value based on the average round trip time, will determine the timeout limit for a reliable packet. When that limit is reached, the timeout will be doubled, and the peer will be disconnected if that limit has reached [param timeout_min]. The [param timeout_max] parameter, on the other hand, defines a fixed timeout for which any packet must be acknowledged or the peer will be dropped.
</description> </description>
</method> </method>
<method name="throttle_configure"> <method name="throttle_configure">
@ -115,7 +115,7 @@
<param index="2" name="deceleration" type="int" /> <param index="2" name="deceleration" type="int" />
<description> <description>
Configures throttle parameter for a peer. Configures throttle parameter for a peer.
Unreliable packets are dropped by ENet in response to the varying conditions of the Internet connection to the peer. The throttle represents a probability that an unreliable packet should not be dropped and thus sent by ENet to the peer. By measuring fluctuations in round trip times of reliable packets over the specified [code]interval[/code], ENet will either increase the probability by the amount specified in the [code]acceleration[/code] parameter, or decrease it by the amount specified in the [code]deceleration[/code] parameter (both are ratios to [constant PACKET_THROTTLE_SCALE]). Unreliable packets are dropped by ENet in response to the varying conditions of the Internet connection to the peer. The throttle represents a probability that an unreliable packet should not be dropped and thus sent by ENet to the peer. By measuring fluctuations in round trip times of reliable packets over the specified [param interval], ENet will either increase the probability by the amount specified in the [param acceleration] parameter, or decrease it by the amount specified in the [param deceleration] parameter (both are ratios to [constant PACKET_THROTTLE_SCALE]).
When the throttle has a value of [constant PACKET_THROTTLE_SCALE], no unreliable packets are dropped by ENet, and so 100% of all unreliable packets will be sent. When the throttle has a value of [constant PACKET_THROTTLE_SCALE], no unreliable packets are dropped by ENet, and so 100% of all unreliable packets will be sent.
When the throttle has a value of [code]0[/code], all unreliable packets are dropped by ENet, and so 0% of all unreliable packets will be sent. When the throttle has a value of [code]0[/code], all unreliable packets are dropped by ENet, and so 0% of all unreliable packets will be sent.
Intermediate values for the throttle represent intermediate probabilities between 0% and 100% of unreliable packets being sent. The bandwidth limits of the local and foreign hosts are taken into account to determine a sensible limit for the throttle probability above which it should not raise even in the best of conditions. Intermediate values for the throttle represent intermediate probabilities between 0% and 100% of unreliable packets being sent. The bandwidth limits of the local and foreign hosts are taken into account to determine a sensible limit for the throttle probability above which it should not raise even in the best of conditions.

View File

@ -609,7 +609,7 @@
<param index="3" name="transfer_channel" type="int" default="0" /> <param index="3" name="transfer_channel" type="int" default="0" />
<description> <description>
Mark the following method for remote procedure calls. See [url=$DOCS_URL/tutorials/networking/high_level_multiplayer.html]High-level multiplayer[/url]. Mark the following method for remote procedure calls. See [url=$DOCS_URL/tutorials/networking/high_level_multiplayer.html]High-level multiplayer[/url].
The order of [code]mode[/code], [code]sync[/code] and [code]transfer_mode[/code] does not matter and all arguments can be omitted, but [code]transfer_channel[/code] always has to be the last argument. The accepted values for [code]mode[/code] are [code]"any_peer"[/code] or [code]"authority"[/code], for [code]sync[/code] are [code]"call_remote"[/code] or [code]"call_local"[/code] and for [code]transfer_mode[/code] are [code]"unreliable"[/code], [code]"unreliable_ordered"[/code] or [code]"reliable"[/code]. The order of [param mode], [param sync] and [param transfer_mode] does not matter and all arguments can be omitted, but [param transfer_channel] always has to be the last argument. The accepted values for [param mode] are [code]"any_peer"[/code] or [code]"authority"[/code], for [param sync] are [code]"call_remote"[/code] or [code]"call_local"[/code] and for [param transfer_mode] are [code]"unreliable"[/code], [code]"unreliable_ordered"[/code] or [code]"reliable"[/code].
[codeblock] [codeblock]
@rpc @rpc
func fn(): pass func fn(): pass

View File

@ -73,14 +73,14 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<description> <description>
Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [code]layer_number[/code] between 1 and 32. Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="get_collision_mask_value" qualifiers="const"> <method name="get_collision_mask_value" qualifiers="const">
<return type="bool" /> <return type="bool" />
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<description> <description>
Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [code]layer_number[/code] between 1 and 32. Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="get_meshes" qualifiers="const"> <method name="get_meshes" qualifiers="const">
@ -113,7 +113,7 @@
<return type="Vector3i[]" /> <return type="Vector3i[]" />
<param index="0" name="item" type="int" /> <param index="0" name="item" type="int" />
<description> <description>
Returns an array of all cells with the given item index specified in [code]item[/code]. Returns an array of all cells with the given item index specified in [param item].
</description> </description>
</method> </method>
<method name="local_to_map" qualifiers="const"> <method name="local_to_map" qualifiers="const">
@ -161,7 +161,7 @@
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<param index="1" name="value" type="bool" /> <param index="1" name="value" type="bool" />
<description> <description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_layer], given a [code]layer_number[/code] between 1 and 32. Based on [param value], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="set_collision_mask_value"> <method name="set_collision_mask_value">
@ -169,7 +169,7 @@
<param index="0" name="layer_number" type="int" /> <param index="0" name="layer_number" type="int" />
<param index="1" name="value" type="bool" /> <param index="1" name="value" type="bool" />
<description> <description>
Based on [code]value[/code], enables or disables the specified layer in the [member collision_mask], given a [code]layer_number[/code] between 1 and 32. Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32.
</description> </description>
</method> </method>
<method name="set_navigation_map"> <method name="set_navigation_map">

View File

@ -41,7 +41,7 @@
<return type="Node" /> <return type="Node" />
<param index="0" name="data" type="Variant" default="null" /> <param index="0" name="data" type="Variant" default="null" />
<description> <description>
Requests a custom spawn, with [code]data[/code] passed to [member spawn_function] on all peers. Returns the locally spawned node instance already inside the scene tree, and added as a child of the node pointed by [member spawn_path]. Requests a custom spawn, with [param data] passed to [member spawn_function] on all peers. Returns the locally spawned node instance already inside the scene tree, and added as a child of the node pointed by [member spawn_path].
[b]Note:[/b] Spawnable scenes are spawned automatically. [method spawn] is only needed for custom spawns. [b]Note:[/b] Spawnable scenes are spawned automatically. [method spawn] is only needed for custom spawns.
</description> </description>
</method> </method>

View File

@ -17,14 +17,14 @@
<param index="0" name="filter" type="Callable" /> <param index="0" name="filter" type="Callable" />
<description> <description>
Adds a peer visibility filter for this synchronizer. Adds a peer visibility filter for this synchronizer.
[code]filter[/code] should take a peer ID [int] and return a [bool]. [param filter] should take a peer ID [int] and return a [bool].
</description> </description>
</method> </method>
<method name="get_visibility_for" qualifiers="const"> <method name="get_visibility_for" qualifiers="const">
<return type="bool" /> <return type="bool" />
<param index="0" name="peer" type="int" /> <param index="0" name="peer" type="int" />
<description> <description>
Queries the current visibility for peer [code]peer[/code]. Queries the current visibility for peer [param peer].
</description> </description>
</method> </method>
<method name="remove_visibility_filter"> <method name="remove_visibility_filter">
@ -39,14 +39,14 @@
<param index="0" name="peer" type="int" /> <param index="0" name="peer" type="int" />
<param index="1" name="visible" type="bool" /> <param index="1" name="visible" type="bool" />
<description> <description>
Sets the visibility of [code]peer[/code] to [code]visible[/code]. If [code]peer[/code] is [code]0[/code], the value of [member public_visibility] will be updated instead. Sets the visibility of [param peer] to [param visible]. If [param peer] is [code]0[/code], the value of [member public_visibility] will be updated instead.
</description> </description>
</method> </method>
<method name="update_visibility"> <method name="update_visibility">
<return type="void" /> <return type="void" />
<param index="0" name="for_peer" type="int" default="0" /> <param index="0" name="for_peer" type="int" default="0" />
<description> <description>
Updates the visibility of [code]peer[/code] according to visibility filters. If [code]peer[/code] is [code]0[/code] (the default), all peers' visibilties are updated. Updates the visibility of [param for_peer] according to visibility filters. If [param for_peer] is [code]0[/code] (the default), all peers' visibilties are updated.
</description> </description>
</method> </method>
</methods> </methods>
@ -77,7 +77,7 @@
<signal name="visibility_changed"> <signal name="visibility_changed">
<param index="0" name="for_peer" type="int" /> <param index="0" name="for_peer" type="int" />
<description> <description>
Emitted when visibility of [code]for_peer[/code] is updated. See [method update_visibility]. Emitted when visibility of [param for_peer] is updated. See [method update_visibility].
</description> </description>
</signal> </signal>
</signals> </signals>

View File

@ -55,7 +55,7 @@
<param index="2" name="mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" /> <param index="2" name="mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" />
<param index="3" name="channel" type="int" default="0" /> <param index="3" name="channel" type="int" default="0" />
<description> <description>
Sends the given raw [code]bytes[/code] to a specific peer identified by [code]id[/code] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers. Sends the given raw [param bytes] to a specific peer identified by [param id] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers.
</description> </description>
</method> </method>
</methods> </methods>
@ -100,7 +100,7 @@
<param index="0" name="id" type="int" /> <param index="0" name="id" type="int" />
<param index="1" name="packet" type="PackedByteArray" /> <param index="1" name="packet" type="PackedByteArray" />
<description> <description>
Emitted when this MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] receives a [code]packet[/code] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet. Emitted when this MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] receives a [param packet] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet.
</description> </description>
</signal> </signal>
</signals> </signals>

View File

@ -13,7 +13,7 @@
<param index="0" name="path" type="NodePath" /> <param index="0" name="path" type="NodePath" />
<param index="1" name="index" type="int" default="-1" /> <param index="1" name="index" type="int" default="-1" />
<description> <description>
Adds the property identified by the given [code]path[/code] to the list of the properties being synchronized, optionally passing an [code]index[/code]. Adds the property identified by the given [param path] to the list of the properties being synchronized, optionally passing an [param index].
</description> </description>
</method> </method>
<method name="get_properties" qualifiers="const"> <method name="get_properties" qualifiers="const">
@ -26,28 +26,28 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="path" type="NodePath" /> <param index="0" name="path" type="NodePath" />
<description> <description>
Returns whether the given [code]path[/code] is configured for synchronization. Returns whether the given [param path] is configured for synchronization.
</description> </description>
</method> </method>
<method name="property_get_index" qualifiers="const"> <method name="property_get_index" qualifiers="const">
<return type="int" /> <return type="int" />
<param index="0" name="path" type="NodePath" /> <param index="0" name="path" type="NodePath" />
<description> <description>
Finds the index of the given [code]path[/code]. Finds the index of the given [param path].
</description> </description>
</method> </method>
<method name="property_get_spawn"> <method name="property_get_spawn">
<return type="bool" /> <return type="bool" />
<param index="0" name="path" type="NodePath" /> <param index="0" name="path" type="NodePath" />
<description> <description>
Returns whether the property identified by the given [code]path[/code] is configured to be synchronized on spawn. Returns whether the property identified by the given [param path] is configured to be synchronized on spawn.
</description> </description>
</method> </method>
<method name="property_get_sync"> <method name="property_get_sync">
<return type="bool" /> <return type="bool" />
<param index="0" name="path" type="NodePath" /> <param index="0" name="path" type="NodePath" />
<description> <description>
Returns whether the property identified by the given [code]path[/code] is configured to be synchronized on process. Returns whether the property identified by the given [param path] is configured to be synchronized on process.
</description> </description>
</method> </method>
<method name="property_set_spawn"> <method name="property_set_spawn">
@ -55,7 +55,7 @@
<param index="0" name="path" type="NodePath" /> <param index="0" name="path" type="NodePath" />
<param index="1" name="enabled" type="bool" /> <param index="1" name="enabled" type="bool" />
<description> <description>
Sets whether the property identified by the given [code]path[/code] is configured to be synchronized on spawn. Sets whether the property identified by the given [param path] is configured to be synchronized on spawn.
</description> </description>
</method> </method>
<method name="property_set_sync"> <method name="property_set_sync">
@ -63,14 +63,14 @@
<param index="0" name="path" type="NodePath" /> <param index="0" name="path" type="NodePath" />
<param index="1" name="enabled" type="bool" /> <param index="1" name="enabled" type="bool" />
<description> <description>
Sets whether the property identified by the given [code]path[/code] is configured to be synchronized on process. Sets whether the property identified by the given [param path] is configured to be synchronized on process.
</description> </description>
</method> </method>
<method name="remove_property"> <method name="remove_property">
<return type="void" /> <return type="void" />
<param index="0" name="path" type="NodePath" /> <param index="0" name="path" type="NodePath" />
<description> <description>
Removes the property identified by the given [code]path[/code] from the configuration. Removes the property identified by the given [param path] from the configuration.
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -74,11 +74,11 @@
<param index="3" name="proto" type="String" default="&quot;UDP&quot;" /> <param index="3" name="proto" type="String" default="&quot;UDP&quot;" />
<param index="4" name="duration" type="int" default="0" /> <param index="4" name="duration" type="int" default="0" />
<description> <description>
Adds a mapping to forward the external [code]port[/code] (between 1 and 65535, although recommended to use port 1024 or above) on the default gateway (see [method get_gateway]) to the [code]internal_port[/code] on the local machine for the given protocol [code]proto[/code] (either [code]"TCP"[/code] or [code]"UDP"[/code], with UDP being the default). If a port mapping for the given port and protocol combination already exists on that gateway device, this method tries to overwrite it. If that is not desired, you can retrieve the gateway manually with [method get_gateway] and call [method add_port_mapping] on it, if any. Note that forwarding a well-known port (below 1024) with UPnP may fail depending on the device. Adds a mapping to forward the external [param port] (between 1 and 65535, although recommended to use port 1024 or above) on the default gateway (see [method get_gateway]) to the [param port_internal] on the local machine for the given protocol [param proto] (either [code]"TCP"[/code] or [code]"UDP"[/code], with UDP being the default). If a port mapping for the given port and protocol combination already exists on that gateway device, this method tries to overwrite it. If that is not desired, you can retrieve the gateway manually with [method get_gateway] and call [method add_port_mapping] on it, if any. Note that forwarding a well-known port (below 1024) with UPnP may fail depending on the device.
Depending on the gateway device, if a mapping for that port already exists, it will either be updated or it will refuse this command due to that conflict, especially if the existing mapping for that port wasn't created via UPnP or points to a different network address (or device) than this one. Depending on the gateway device, if a mapping for that port already exists, it will either be updated or it will refuse this command due to that conflict, especially if the existing mapping for that port wasn't created via UPnP or points to a different network address (or device) than this one.
If [code]internal_port[/code] is [code]0[/code] (the default), the same port number is used for both the external and the internal port (the [code]port[/code] value). If [param port_internal] is [code]0[/code] (the default), the same port number is used for both the external and the internal port (the [param port] value).
The description ([code]desc[/code]) is shown in some routers management UIs and can be used to point out which application added the mapping. The description ([param desc]) is shown in some routers management UIs and can be used to point out which application added the mapping.
The mapping's lease [code]duration[/code] can be limited by specifying a duration in seconds. The default of [code]0[/code] means no duration, i.e. a permanent lease and notably some devices only support these permanent leases. Note that whether permanent or not, this is only a request and the gateway may still decide at any point to remove the mapping (which usually happens on a reboot of the gateway, when its external IP address changes, or on some models when it detects a port mapping has become inactive, i.e. had no traffic for multiple minutes). If not [code]0[/code] (permanent), the allowed range according to spec is between [code]120[/code] (2 minutes) and [code]86400[/code] seconds (24 hours). The mapping's lease [param duration] can be limited by specifying a duration in seconds. The default of [code]0[/code] means no duration, i.e. a permanent lease and notably some devices only support these permanent leases. Note that whether permanent or not, this is only a request and the gateway may still decide at any point to remove the mapping (which usually happens on a reboot of the gateway, when its external IP address changes, or on some models when it detects a port mapping has become inactive, i.e. had no traffic for multiple minutes). If not [code]0[/code] (permanent), the allowed range according to spec is between [code]120[/code] (2 minutes) and [code]86400[/code] seconds (24 hours).
See [enum UPNPResult] for possible return values. See [enum UPNPResult] for possible return values.
</description> </description>
</method> </method>
@ -93,7 +93,7 @@
<param index="0" name="port" type="int" /> <param index="0" name="port" type="int" />
<param index="1" name="proto" type="String" default="&quot;UDP&quot;" /> <param index="1" name="proto" type="String" default="&quot;UDP&quot;" />
<description> <description>
Deletes the port mapping for the given port and protocol combination on the default gateway (see [method get_gateway]) if one exists. [code]port[/code] must be a valid port between 1 and 65535, [code]proto[/code] can be either [code]"TCP"[/code] or [code]"UDP"[/code]. May be refused for mappings pointing to addresses other than this one, for well-known ports (below 1024), or for mappings not added via UPnP. See [enum UPNPResult] for possible return values. Deletes the port mapping for the given port and protocol combination on the default gateway (see [method get_gateway]) if one exists. [param port] must be a valid port between 1 and 65535, [param proto] can be either [code]"TCP"[/code] or [code]"UDP"[/code]. May be refused for mappings pointing to addresses other than this one, for well-known ports (below 1024), or for mappings not added via UPnP. See [enum UPNPResult] for possible return values.
</description> </description>
</method> </method>
<method name="discover"> <method name="discover">
@ -103,7 +103,7 @@
<param index="2" name="device_filter" type="String" default="&quot;InternetGatewayDevice&quot;" /> <param index="2" name="device_filter" type="String" default="&quot;InternetGatewayDevice&quot;" />
<description> <description>
Discovers local [UPNPDevice]s. Clears the list of previously discovered devices. Discovers local [UPNPDevice]s. Clears the list of previously discovered devices.
Filters for IGD (InternetGatewayDevice) type devices by default, as those manage port forwarding. [code]timeout[/code] is the time to wait for responses in milliseconds. [code]ttl[/code] is the time-to-live; only touch this if you know what you're doing. Filters for IGD (InternetGatewayDevice) type devices by default, as those manage port forwarding. [param timeout] is the time to wait for responses in milliseconds. [param ttl] is the time-to-live; only touch this if you know what you're doing.
See [enum UPNPResult] for possible return values. See [enum UPNPResult] for possible return values.
</description> </description>
</method> </method>
@ -111,7 +111,7 @@
<return type="UPNPDevice" /> <return type="UPNPDevice" />
<param index="0" name="index" type="int" /> <param index="0" name="index" type="int" />
<description> <description>
Returns the [UPNPDevice] at the given [code]index[/code]. Returns the [UPNPDevice] at the given [param index].
</description> </description>
</method> </method>
<method name="get_device_count" qualifiers="const"> <method name="get_device_count" qualifiers="const">
@ -136,7 +136,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="index" type="int" /> <param index="0" name="index" type="int" />
<description> <description>
Removes the device at [code]index[/code] from the list of discovered devices. Removes the device at [param index] from the list of discovered devices.
</description> </description>
</method> </method>
<method name="set_device"> <method name="set_device">
@ -144,7 +144,7 @@
<param index="0" name="index" type="int" /> <param index="0" name="index" type="int" />
<param index="1" name="device" type="UPNPDevice" /> <param index="1" name="device" type="UPNPDevice" />
<description> <description>
Sets the device at [code]index[/code] from the list of discovered devices to [code]device[/code]. Sets the device at [param index] from the list of discovered devices to [param device].
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -18,8 +18,8 @@
<param index="1" name="peer_id" type="int" /> <param index="1" name="peer_id" type="int" />
<param index="2" name="unreliable_lifetime" type="int" default="1" /> <param index="2" name="unreliable_lifetime" type="int" default="1" />
<description> <description>
Add a new peer to the mesh with the given [code]peer_id[/code]. The [WebRTCPeerConnection] must be in state [constant WebRTCPeerConnection.STATE_NEW]. Add a new peer to the mesh with the given [param peer_id]. The [WebRTCPeerConnection] must be in state [constant WebRTCPeerConnection.STATE_NEW].
Three channels will be created for reliable, unreliable, and ordered transport. The value of [code]unreliable_lifetime[/code] will be passed to the [code]maxPacketLifetime[/code] option when creating unreliable and ordered channels (see [method WebRTCPeerConnection.create_data_channel]). Three channels will be created for reliable, unreliable, and ordered transport. The value of [param unreliable_lifetime] will be passed to the [code]"maxPacketLifetime"[/code] option when creating unreliable and ordered channels (see [method WebRTCPeerConnection.create_data_channel]).
</description> </description>
</method> </method>
<method name="create_client"> <method name="create_client">
@ -27,8 +27,8 @@
<param index="0" name="peer_id" type="int" /> <param index="0" name="peer_id" type="int" />
<param index="1" name="channels_config" type="Array" default="[]" /> <param index="1" name="channels_config" type="Array" default="[]" />
<description> <description>
Initialize the multiplayer peer as a client with the given [code]peer_id[/code] (must be between 2 and 2147483647). In this mode, you should only call [method add_peer] once and with [code]peer_id[/code] of [code]1[/code]. This mode enables [method MultiplayerPeer.is_server_relay_supported], allowing the upper [MultiplayerAPI] layer to perform peer exchange and packet relaying. Initialize the multiplayer peer as a client with the given [param peer_id] (must be between 2 and 2147483647). In this mode, you should only call [method add_peer] once and with [param peer_id] of [code]1[/code]. This mode enables [method MultiplayerPeer.is_server_relay_supported], allowing the upper [MultiplayerAPI] layer to perform peer exchange and packet relaying.
You can optionally specify a [code]channels_config[/code] array of [enum MultiplayerPeer.TransferMode] which will be used to create extra channels (WebRTC only supports one transfer mode per channel). You can optionally specify a [param channels_config] array of [enum MultiplayerPeer.TransferMode] which will be used to create extra channels (WebRTC only supports one transfer mode per channel).
</description> </description>
</method> </method>
<method name="create_mesh"> <method name="create_mesh">
@ -36,7 +36,7 @@
<param index="0" name="peer_id" type="int" /> <param index="0" name="peer_id" type="int" />
<param index="1" name="channels_config" type="Array" default="[]" /> <param index="1" name="channels_config" type="Array" default="[]" />
<description> <description>
Initialize the multiplayer peer as a mesh (i.e. all peers connect to each other) with the given [code]peer_id[/code] (must be between 1 and 2147483647). Initialize the multiplayer peer as a mesh (i.e. all peers connect to each other) with the given [param peer_id] (must be between 1 and 2147483647).
</description> </description>
</method> </method>
<method name="create_server"> <method name="create_server">
@ -44,14 +44,14 @@
<param index="0" name="channels_config" type="Array" default="[]" /> <param index="0" name="channels_config" type="Array" default="[]" />
<description> <description>
Initialize the multiplayer peer as a server (with unique ID of [code]1[/code]). This mode enables [method MultiplayerPeer.is_server_relay_supported], allowing the upper [MultiplayerAPI] layer to perform peer exchange and packet relaying. Initialize the multiplayer peer as a server (with unique ID of [code]1[/code]). This mode enables [method MultiplayerPeer.is_server_relay_supported], allowing the upper [MultiplayerAPI] layer to perform peer exchange and packet relaying.
You can optionally specify a [code]channels_config[/code] array of [enum MultiplayerPeer.TransferMode] which will be used to create extra channels (WebRTC only supports one transfer mode per channel). You can optionally specify a [param channels_config] array of [enum MultiplayerPeer.TransferMode] which will be used to create extra channels (WebRTC only supports one transfer mode per channel).
</description> </description>
</method> </method>
<method name="get_peer"> <method name="get_peer">
<return type="Dictionary" /> <return type="Dictionary" />
<param index="0" name="peer_id" type="int" /> <param index="0" name="peer_id" type="int" />
<description> <description>
Returns a dictionary representation of the peer with given [code]peer_id[/code] with three keys. [code]connection[/code] containing the [WebRTCPeerConnection] to this peer, [code]channels[/code] an array of three [WebRTCDataChannel], and [code]connected[/code] a boolean representing if the peer connection is currently connected (all three channels are open). Returns a dictionary representation of the peer with given [param peer_id] with three keys. [code]"connection"[/code] containing the [WebRTCPeerConnection] to this peer, [code]"channels"[/code] an array of three [WebRTCDataChannel], and [code]"connected"[/code] a boolean representing if the peer connection is currently connected (all three channels are open).
</description> </description>
</method> </method>
<method name="get_peers"> <method name="get_peers">
@ -64,14 +64,14 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="peer_id" type="int" /> <param index="0" name="peer_id" type="int" />
<description> <description>
Returns [code]true[/code] if the given [code]peer_id[/code] is in the peers map (it might not be connected though). Returns [code]true[/code] if the given [param peer_id] is in the peers map (it might not be connected though).
</description> </description>
</method> </method>
<method name="remove_peer"> <method name="remove_peer">
<return type="void" /> <return type="void" />
<param index="0" name="peer_id" type="int" /> <param index="0" name="peer_id" type="int" />
<description> <description>
Remove the peer with given [code]peer_id[/code] from the mesh. If the peer was connected, and [signal MultiplayerPeer.peer_connected] was emitted for it, then [signal MultiplayerPeer.peer_disconnected] will be emitted. Remove the peer with given [param peer_id] from the mesh. If the peer was connected, and [signal MultiplayerPeer.peer_connected] was emitted for it, then [signal MultiplayerPeer.peer_disconnected] will be emitted.
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -35,9 +35,9 @@
<param index="0" name="label" type="String" /> <param index="0" name="label" type="String" />
<param index="1" name="options" type="Dictionary" default="{}" /> <param index="1" name="options" type="Dictionary" default="{}" />
<description> <description>
Returns a new [WebRTCDataChannel] (or [code]null[/code] on failure) with given [code]label[/code] and optionally configured via the [code]options[/code] dictionary. This method can only be called when the connection is in state [constant STATE_NEW]. Returns a new [WebRTCDataChannel] (or [code]null[/code] on failure) with given [param label] and optionally configured via the [param options] dictionary. This method can only be called when the connection is in state [constant STATE_NEW].
There are two ways to create a working data channel: either call [method create_data_channel] on only one of the peer and listen to [signal data_channel_received] on the other, or call [method create_data_channel] on both peers, with the same values, and the [code]negotiated[/code] option set to [code]true[/code]. There are two ways to create a working data channel: either call [method create_data_channel] on only one of the peer and listen to [signal data_channel_received] on the other, or call [method create_data_channel] on both peers, with the same values, and the [code]"negotiated"[/code] option set to [code]true[/code].
Valid [code]options[/code] are: Valid [param options] are:
[codeblock] [codeblock]
{ {
"negotiated": true, # When set to true (default off), means the channel is negotiated out of band. "id" must be set too. "data_channel_received" will not be called. "negotiated": true, # When set to true (default off), means the channel is negotiated out of band. "id" must be set too. "data_channel_received" will not be called.
@ -83,8 +83,8 @@
<return type="int" enum="Error" /> <return type="int" enum="Error" />
<param index="0" name="configuration" type="Dictionary" default="{}" /> <param index="0" name="configuration" type="Dictionary" default="{}" />
<description> <description>
Re-initialize this peer connection, closing any previously active connection, and going back to state [constant STATE_NEW]. A dictionary of [code]options[/code] can be passed to configure the peer connection. Re-initialize this peer connection, closing any previously active connection, and going back to state [constant STATE_NEW]. A dictionary of [param configuration] options can be passed to configure the peer connection.
Valid [code]options[/code] are: Valid [param configuration] options are:
[codeblock] [codeblock]
{ {
"iceServers": [ "iceServers": [
@ -111,7 +111,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="extension_class" type="StringName" /> <param index="0" name="extension_class" type="StringName" />
<description> <description>
Sets the [code]extension_class[/code] as the default [WebRTCPeerConnectionExtension] returned when creating a new [WebRTCPeerConnection]. Sets the [param extension_class] as the default [WebRTCPeerConnectionExtension] returned when creating a new [WebRTCPeerConnection].
</description> </description>
</method> </method>
<method name="set_local_description"> <method name="set_local_description">
@ -129,8 +129,8 @@
<param index="1" name="sdp" type="String" /> <param index="1" name="sdp" type="String" />
<description> <description>
Sets the SDP description of the remote peer. This should be called with the values generated by a remote peer and received over the signaling server. Sets the SDP description of the remote peer. This should be called with the values generated by a remote peer and received over the signaling server.
If [code]type[/code] is [code]offer[/code] the peer will emit [signal session_description_created] with the appropriate answer. If [param type] is [code]"offer"[/code] the peer will emit [signal session_description_created] with the appropriate answer.
If [code]type[/code] is [code]answer[/code] the peer will start emitting [signal ice_candidate_created]. If [param type] is [code]"answer"[/code] the peer will start emitting [signal ice_candidate_created].
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -32,7 +32,7 @@
<return type="WebSocketPeer" /> <return type="WebSocketPeer" />
<param index="0" name="peer_id" type="int" /> <param index="0" name="peer_id" type="int" />
<description> <description>
Returns the [WebSocketPeer] associated to the given [code]peer_id[/code]. Returns the [WebSocketPeer] associated to the given [param peer_id].
</description> </description>
</method> </method>
<method name="get_peer_address" qualifiers="const"> <method name="get_peer_address" qualifiers="const">

View File

@ -61,7 +61,7 @@
<param index="1" name="tls_client_options" type="TLSOptions" default="null" /> <param index="1" name="tls_client_options" type="TLSOptions" default="null" />
<description> <description>
Connects to the given URL. TLS certificates will be verified against the hostname when connecting using the [code]wss://[/code] protocol. You can pass the optional [param tls_client_options] parameter to customize the trusted certification authorities, or disable the common name verification. See [method TLSOptions.client] and [method TLSOptions.client_unsafe]. Connects to the given URL. TLS certificates will be verified against the hostname when connecting using the [code]wss://[/code] protocol. You can pass the optional [param tls_client_options] parameter to customize the trusted certification authorities, or disable the common name verification. See [method TLSOptions.client] and [method TLSOptions.client_unsafe].
[b]Note:[/b] To avoid mixed content warnings or errors in Web, you may have to use a [code]url[/code] that starts with [code]wss://[/code] (secure) instead of [code]ws://[/code]. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's TLS certificate. Do not connect directly via the IP address for [code]wss://[/code] connections, as it won't match with the TLS certificate. [b]Note:[/b] To avoid mixed content warnings or errors in Web, you may have to use a [param url] that starts with [code]wss://[/code] (secure) instead of [code]ws://[/code]. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's TLS certificate. Do not connect directly via the IP address for [code]wss://[/code] connections, as it won't match with the TLS certificate.
</description> </description>
</method> </method>
<method name="get_close_code" qualifiers="const"> <method name="get_close_code" qualifiers="const">

View File

@ -109,7 +109,7 @@
<return type="int" enum="WebXRInterface.TargetRayMode" /> <return type="int" enum="WebXRInterface.TargetRayMode" />
<param index="0" name="input_source_id" type="int" /> <param index="0" name="input_source_id" type="int" />
<description> <description>
Returns the target ray mode for the given [code]input_source_id[/code]. Returns the target ray mode for the given [param input_source_id].
This can help interpret the input coming from that input source. See [url=https://developer.mozilla.org/en-US/docs/Web/API/XRInputSource/targetRayMode]XRInputSource.targetRayMode[/url] for more information. This can help interpret the input coming from that input source. See [url=https://developer.mozilla.org/en-US/docs/Web/API/XRInputSource/targetRayMode]XRInputSource.targetRayMode[/url] for more information.
</description> </description>
</method> </method>
@ -117,7 +117,7 @@
<return type="XRPositionalTracker" /> <return type="XRPositionalTracker" />
<param index="0" name="input_source_id" type="int" /> <param index="0" name="input_source_id" type="int" />
<description> <description>
Gets an [XRPositionalTracker] for the given [code]input_source_id[/code]. Gets an [XRPositionalTracker] for the given [param input_source_id].
In the context of WebXR, an input source can be an advanced VR controller like the Oculus Touch or Index controllers, or even a tap on the screen, a spoken voice command or a button press on the device itself. When a non-traditional input source is used, interpret the position and orientation of the [XRPositionalTracker] as a ray pointing at the object the user wishes to interact with. In the context of WebXR, an input source can be an advanced VR controller like the Oculus Touch or Index controllers, or even a tap on the screen, a spoken voice command or a button press on the device itself. When a non-traditional input source is used, interpret the position and orientation of the [XRPositionalTracker] as a ray pointing at the object the user wishes to interact with.
Use this method to get information about the input source that triggered one of these signals: Use this method to get information about the input source that triggered one of these signals:
- [signal selectstart] - [signal selectstart]
@ -132,14 +132,14 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="input_source_id" type="int" /> <param index="0" name="input_source_id" type="int" />
<description> <description>
Returns [code]true[/code] if there is an active input source with the given [code]input_source_id[/code]. Returns [code]true[/code] if there is an active input source with the given [param input_source_id].
</description> </description>
</method> </method>
<method name="is_session_supported"> <method name="is_session_supported">
<return type="void" /> <return type="void" />
<param index="0" name="session_mode" type="String" /> <param index="0" name="session_mode" type="String" />
<description> <description>
Checks if the given [code]session_mode[/code] is supported by the user's browser. Checks if the given [param session_mode] is supported by the user's browser.
Possible values come from [url=https://developer.mozilla.org/en-US/docs/Web/API/XRSessionMode]WebXR's XRSessionMode[/url], including: [code]"immersive-vr"[/code], [code]"immersive-ar"[/code], and [code]"inline"[/code]. Possible values come from [url=https://developer.mozilla.org/en-US/docs/Web/API/XRSessionMode]WebXR's XRSessionMode[/url], including: [code]"immersive-vr"[/code], [code]"immersive-ar"[/code], and [code]"inline"[/code].
This method returns nothing, instead it emits the [signal session_supported] signal with the result. This method returns nothing, instead it emits the [signal session_supported] signal with the result.
</description> </description>
@ -229,7 +229,7 @@
<param index="0" name="message" type="String" /> <param index="0" name="message" type="String" />
<description> <description>
Emitted by [method XRInterface.initialize] if the session fails to start. Emitted by [method XRInterface.initialize] if the session fails to start.
[code]message[/code] may optionally contain an error message from WebXR, or an empty string if no message is available. [param message] may optionally contain an error message from WebXR, or an empty string if no message is available.
</description> </description>
</signal> </signal>
<signal name="session_started"> <signal name="session_started">
@ -242,7 +242,7 @@
<param index="0" name="session_mode" type="String" /> <param index="0" name="session_mode" type="String" />
<param index="1" name="supported" type="bool" /> <param index="1" name="supported" type="bool" />
<description> <description>
Emitted by [method is_session_supported] to indicate if the given [code]session_mode[/code] is supported or not. Emitted by [method is_session_supported] to indicate if the given [param session_mode] is supported or not.
</description> </description>
</signal> </signal>
<signal name="squeeze"> <signal name="squeeze">