summaryrefslogtreecommitdiff
path: root/modules/gdscript/doc_classes
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-07-30 15:28:05 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-07-30 15:29:52 +0200
commit7adf4cc9b5de6701a41e27690a69b9892d5eed85 (patch)
tree0019e6d1b7cd993b81d5bba268074cfc4e10a213 /modules/gdscript/doc_classes
parenta1c19b9a1e53f78c75c13cb418270db80057b21a (diff)
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.
Diffstat (limited to 'modules/gdscript/doc_classes')
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml90
-rw-r--r--modules/gdscript/doc_classes/GDScript.xml6
2 files changed, 32 insertions, 64 deletions
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index e68deb070d..51b3452a3a 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -11,16 +11,11 @@
</tutorials>
<methods>
<method name="Color8">
- <return type="Color">
- </return>
- <argument index="0" name="r8" type="int">
- </argument>
- <argument index="1" name="g8" type="int">
- </argument>
- <argument index="2" name="b8" type="int">
- </argument>
- <argument index="3" name="a8" type="int" default="255">
- </argument>
+ <return type="Color" />
+ <argument index="0" name="r8" type="int" />
+ <argument index="1" name="g8" type="int" />
+ <argument index="2" name="b8" type="int" />
+ <argument index="3" name="a8" type="int" default="255" />
<description>
Returns a color constructed from integer red, green, blue, and alpha channels. Each channel should have 8 bits of information ranging from 0 to 255.
[code]r8[/code] red channel
@@ -33,12 +28,9 @@
</description>
</method>
<method name="assert">
- <return type="void">
- </return>
- <argument index="0" name="condition" type="bool">
- </argument>
- <argument index="1" name="message" type="String" default="&quot;&quot;">
- </argument>
+ <return type="void" />
+ <argument index="0" name="condition" type="bool" />
+ <argument index="1" name="message" type="String" default="&quot;&quot;" />
<description>
Asserts that the [code]condition[/code] is [code]true[/code]. If the [code]condition[/code] is [code]false[/code], an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of [method @GlobalScope.push_error] for reporting errors to project developers or add-on users.
[b]Note:[/b] For performance reasons, the code inside [method assert] is only executed in debug builds or when running the project from the editor. Don't include code that has side effects in an [method assert] call. Otherwise, the project will behave differently when exported in release mode.
@@ -54,10 +46,8 @@
</description>
</method>
<method name="char">
- <return type="String">
- </return>
- <argument index="0" name="char" type="int">
- </argument>
+ <return type="String" />
+ <argument index="0" name="char" type="int" />
<description>
Returns a character as a String of the given Unicode code point (which is compatible with ASCII code).
[codeblock]
@@ -68,12 +58,9 @@
</description>
</method>
<method name="convert">
- <return type="Variant">
- </return>
- <argument index="0" name="what" type="Variant">
- </argument>
- <argument index="1" name="type" type="int">
- </argument>
+ <return type="Variant" />
+ <argument index="0" name="what" type="Variant" />
+ <argument index="1" name="type" type="int" />
<description>
Converts from a type to another in the best way possible. The [code]type[/code] parameter uses the [enum Variant.Type] values.
[codeblock]
@@ -87,17 +74,14 @@
</description>
</method>
<method name="dict2inst">
- <return type="Object">
- </return>
- <argument index="0" name="dictionary" type="Dictionary">
- </argument>
+ <return type="Object" />
+ <argument index="0" name="dictionary" type="Dictionary" />
<description>
Converts a dictionary (previously created with [method inst2dict]) back to an instance. Useful for deserializing.
</description>
</method>
<method name="get_stack">
- <return type="Array">
- </return>
+ <return type="Array" />
<description>
Returns an array of dictionaries representing the current call stack.
[codeblock]
@@ -117,10 +101,8 @@
</description>
</method>
<method name="inst2dict">
- <return type="Dictionary">
- </return>
- <argument index="0" name="instance" type="Object">
- </argument>
+ <return type="Dictionary" />
+ <argument index="0" name="instance" type="Object" />
<description>
Returns the passed instance converted to a dictionary (useful for serializing).
[codeblock]
@@ -138,10 +120,8 @@
</description>
</method>
<method name="len">
- <return type="int">
- </return>
- <argument index="0" name="var" type="Variant">
- </argument>
+ <return type="int" />
+ <argument index="0" name="var" type="Variant" />
<description>
Returns length of Variant [code]var[/code]. Length is the character count of String, element count of Array, size of Dictionary, etc.
[b]Note:[/b] Generates a fatal error if Variant can not provide a length.
@@ -152,10 +132,8 @@
</description>
</method>
<method name="load">
- <return type="Resource">
- </return>
- <argument index="0" name="path" type="String">
- </argument>
+ <return type="Resource" />
+ <argument index="0" name="path" type="String" />
<description>
Loads a resource from the filesystem located at [code]path[/code]. The resource is loaded on the method call (unless it's referenced already elsewhere, e.g. in another script or in the scene), which might cause slight delay, especially when loading scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use [method preload].
[b]Note:[/b] Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script.
@@ -168,10 +146,8 @@
</description>
</method>
<method name="preload">
- <return type="Resource">
- </return>
- <argument index="0" name="path" type="String">
- </argument>
+ <return type="Resource" />
+ <argument index="0" name="path" type="String" />
<description>
Returns a [Resource] from the filesystem located at [code]path[/code]. The resource is loaded during script parsing, i.e. is loaded with the script and [method preload] effectively acts as a reference to that resource. Note that the method requires a constant path. If you want to load a resource from a dynamic/variable path, use [method load].
[b]Note:[/b] Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script.
@@ -182,15 +158,13 @@
</description>
</method>
<method name="print_debug" qualifiers="vararg">
- <return type="void">
- </return>
+ <return type="void" />
<description>
Like [method @GlobalScope.print], but prints only when used in debug mode.
</description>
</method>
<method name="print_stack">
- <return type="void">
- </return>
+ <return type="void" />
<description>
Prints a stack track at code location, only works when running with debugger turned on.
Output in the console would look something like this:
@@ -200,8 +174,7 @@
</description>
</method>
<method name="range" qualifiers="vararg">
- <return type="Array">
- </return>
+ <return type="Array" />
<description>
Returns an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial, final-1, increment).
[codeblock]
@@ -218,8 +191,7 @@
</description>
</method>
<method name="str" qualifiers="vararg">
- <return type="String">
- </return>
+ <return type="String" />
<description>
Converts one or more arguments to string in the best way possible.
[codeblock]
@@ -231,10 +203,8 @@
</description>
</method>
<method name="type_exists">
- <return type="bool">
- </return>
- <argument index="0" name="type" type="StringName">
- </argument>
+ <return type="bool" />
+ <argument index="0" name="type" type="StringName" />
<description>
</description>
</method>
diff --git a/modules/gdscript/doc_classes/GDScript.xml b/modules/gdscript/doc_classes/GDScript.xml
index 631a102130..72738f027a 100644
--- a/modules/gdscript/doc_classes/GDScript.xml
+++ b/modules/gdscript/doc_classes/GDScript.xml
@@ -12,15 +12,13 @@
</tutorials>
<methods>
<method name="get_as_byte_code" qualifiers="const">
- <return type="PackedByteArray">
- </return>
+ <return type="PackedByteArray" />
<description>
Returns byte code for the script source code.
</description>
</method>
<method name="new" qualifiers="vararg">
- <return type="Variant">
- </return>
+ <return type="Variant" />
<description>
Returns a new instance of the script.
For example: