mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
doc: Use self-closing tags for return and argument
For the time being we don't support writing a description for those, preferring
having all details in the method's description.
Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.
(cherry picked from commit 7adf4cc9b5)
This commit is contained in:
@@ -27,10 +27,8 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="NodePath">
|
||||
<return type="NodePath">
|
||||
</return>
|
||||
<argument index="0" name="from" type="String">
|
||||
</argument>
|
||||
<return type="NodePath" />
|
||||
<argument index="0" name="from" type="String" />
|
||||
<description>
|
||||
Creates a NodePath from a string, e.g. [code]"Path2D/PathFollow2D/Sprite:texture:size"[/code]. A path is absolute if it starts with a slash. Absolute paths are only valid in the global scene tree, not within individual scenes. In a relative path, [code]"."[/code] and [code]".."[/code] indicate the current node and its parent.
|
||||
The "subnames" optionally included after the path to the target node can point to resources or properties, and can also be nested.
|
||||
@@ -52,8 +50,7 @@
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_as_property_path">
|
||||
<return type="NodePath">
|
||||
</return>
|
||||
<return type="NodePath" />
|
||||
<description>
|
||||
Returns a node path with a colon character ([code]:[/code]) prepended, transforming it to a pure property path with no node name (defaults to resolving from the current node).
|
||||
[codeblock]
|
||||
@@ -66,8 +63,7 @@
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_concatenated_subnames">
|
||||
<return type="String">
|
||||
</return>
|
||||
<return type="String" />
|
||||
<description>
|
||||
Returns all subnames concatenated with a colon character ([code]:[/code]) as separator, i.e. the right side of the first colon in a node path.
|
||||
[codeblock]
|
||||
@@ -77,10 +73,8 @@
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_name">
|
||||
<return type="String">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="String" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
Gets the node name indicated by [code]idx[/code] (0 to [method get_name_count]).
|
||||
[codeblock]
|
||||
@@ -92,18 +86,15 @@
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_name_count">
|
||||
<return type="int">
|
||||
</return>
|
||||
<return type="int" />
|
||||
<description>
|
||||
Gets the number of node names which make up the path. Subnames (see [method get_subname_count]) are not included.
|
||||
For example, [code]"Path2D/PathFollow2D/Sprite"[/code] has 3 names.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_subname">
|
||||
<return type="String">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="String" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
Gets the resource or property name indicated by [code]idx[/code] (0 to [method get_subname_count]).
|
||||
[codeblock]
|
||||
@@ -114,23 +105,20 @@
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_subname_count">
|
||||
<return type="int">
|
||||
</return>
|
||||
<return type="int" />
|
||||
<description>
|
||||
Gets the number of resource or property names ("subnames") in the path. Each subname is listed after a colon character ([code]:[/code]) in the node path.
|
||||
For example, [code]"Path2D/PathFollow2D/Sprite:texture:load_path"[/code] has 2 subnames.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_absolute">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the node path is absolute (as opposed to relative), which means that it starts with a slash character ([code]/[/code]). Absolute node paths can be used to access the root node ([code]"/root"[/code]) or autoloads (e.g. [code]"/global"[/code] if a "global" autoload was registered).
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_empty">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the node path is empty.
|
||||
</description>
|
||||
|
||||
Reference in New Issue
Block a user