瀏覽代碼

Unify similar method descriptions

Notably:

* `Packed*Array.size()` and `Array.size()`.
* Shared methods of `Transform2D` and `Transform3D`.
* Shared methods of `Vector2`, `Vector3`, and `Vector2i`.

This reduces the Deja Vu when translating the class reference :)
Haoyu Qiu 3 年之前
父節點
當前提交
3d08becd06

+ 1 - 1
doc/classes/PackedByteArray.xml

@@ -363,7 +363,7 @@
 		<method name="size" qualifiers="const">
 		<method name="size" qualifiers="const">
 			<return type="int" />
 			<return type="int" />
 			<description>
 			<description>
-				Returns the size of the array.
+				Returns the number of elements in the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slice" qualifiers="const">
 		<method name="slice" qualifiers="const">

+ 1 - 1
doc/classes/PackedColorArray.xml

@@ -126,7 +126,7 @@
 		<method name="size" qualifiers="const">
 		<method name="size" qualifiers="const">
 			<return type="int" />
 			<return type="int" />
 			<description>
 			<description>
-				Returns the size of the array.
+				Returns the number of elements in the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slice" qualifiers="const">
 		<method name="slice" qualifiers="const">

+ 1 - 1
doc/classes/PackedFloat32Array.xml

@@ -127,7 +127,7 @@
 		<method name="size" qualifiers="const">
 		<method name="size" qualifiers="const">
 			<return type="int" />
 			<return type="int" />
 			<description>
 			<description>
-				Returns the size of the array.
+				Returns the number of elements in the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slice" qualifiers="const">
 		<method name="slice" qualifiers="const">

+ 1 - 1
doc/classes/PackedFloat64Array.xml

@@ -127,7 +127,7 @@
 		<method name="size" qualifiers="const">
 		<method name="size" qualifiers="const">
 			<return type="int" />
 			<return type="int" />
 			<description>
 			<description>
-				Returns the size of the array.
+				Returns the number of elements in the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slice" qualifiers="const">
 		<method name="slice" qualifiers="const">

+ 1 - 1
doc/classes/PackedInt32Array.xml

@@ -127,7 +127,7 @@
 		<method name="size" qualifiers="const">
 		<method name="size" qualifiers="const">
 			<return type="int" />
 			<return type="int" />
 			<description>
 			<description>
-				Returns the array size.
+				Returns the number of elements in the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slice" qualifiers="const">
 		<method name="slice" qualifiers="const">

+ 1 - 1
doc/classes/PackedInt64Array.xml

@@ -127,7 +127,7 @@
 		<method name="size" qualifiers="const">
 		<method name="size" qualifiers="const">
 			<return type="int" />
 			<return type="int" />
 			<description>
 			<description>
-				Returns the array size.
+				Returns the number of elements in the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slice" qualifiers="const">
 		<method name="slice" qualifiers="const">

+ 1 - 1
doc/classes/PackedStringArray.xml

@@ -127,7 +127,7 @@
 		<method name="size" qualifiers="const">
 		<method name="size" qualifiers="const">
 			<return type="int" />
 			<return type="int" />
 			<description>
 			<description>
-				Returns the size of the array.
+				Returns the number of elements in the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slice" qualifiers="const">
 		<method name="slice" qualifiers="const">

+ 1 - 1
doc/classes/PackedVector2Array.xml

@@ -127,7 +127,7 @@
 		<method name="size" qualifiers="const">
 		<method name="size" qualifiers="const">
 			<return type="int" />
 			<return type="int" />
 			<description>
 			<description>
-				Returns the size of the array.
+				Returns the number of elements in the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slice" qualifiers="const">
 		<method name="slice" qualifiers="const">

+ 1 - 1
doc/classes/PackedVector3Array.xml

@@ -126,7 +126,7 @@
 		<method name="size" qualifiers="const">
 		<method name="size" qualifiers="const">
 			<return type="int" />
 			<return type="int" />
 			<description>
 			<description>
-				Returns the size of the array.
+				Returns the number of elements in the array.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slice" qualifiers="const">
 		<method name="slice" qualifiers="const">

+ 1 - 2
doc/classes/RayCast3D.xml

@@ -38,8 +38,7 @@
 		<method name="force_raycast_update">
 		<method name="force_raycast_update">
 			<return type="void" />
 			<return type="void" />
 			<description>
 			<description>
-				Updates the collision information for the ray.
-				Use this method to update the collision information immediately instead of waiting for the next [code]_physics_process[/code] call, for example if the ray or its parent has changed state.
+				Updates the collision information for the ray. Use this method to update the collision information immediately instead of waiting for the next [code]_physics_process[/code] call, for example if the ray or its parent has changed state.
 				[b]Note:[/b] [member enabled] does not need to be [code]true[/code] for this to work.
 				[b]Note:[/b] [member enabled] does not need to be [code]true[/code] for this to work.
 			</description>
 			</description>
 		</method>
 		</method>

+ 3 - 3
doc/classes/Transform3D.xml

@@ -60,13 +60,13 @@
 			<argument index="0" name="xform" type="Transform3D" />
 			<argument index="0" name="xform" type="Transform3D" />
 			<argument index="1" name="weight" type="float" />
 			<argument index="1" name="weight" type="float" />
 			<description>
 			<description>
-				Interpolates the transform to other Transform3D by weight amount (on the range of 0.0 to 1.0).
+				Returns a transform interpolated between this transform and another by a given [code]weight[/code] (on the range of 0.0 to 1.0).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="inverse" qualifiers="const">
 		<method name="inverse" qualifiers="const">
 			<return type="Transform3D" />
 			<return type="Transform3D" />
 			<description>
 			<description>
-				Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling).
+				Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use [method affine_inverse] for transforms with scaling).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="is_equal_approx" qualifiers="const">
 		<method name="is_equal_approx" qualifiers="const">
@@ -88,7 +88,7 @@
 		<method name="orthonormalized" qualifiers="const">
 		<method name="orthonormalized" qualifiers="const">
 			<return type="Transform3D" />
 			<return type="Transform3D" />
 			<description>
 			<description>
-				Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors.
+				Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="rotated" qualifiers="const">
 		<method name="rotated" qualifiers="const">

+ 6 - 6
doc/classes/Vector2.xml

@@ -95,7 +95,7 @@
 		<method name="ceil" qualifiers="const">
 		<method name="ceil" qualifiers="const">
 			<return type="Vector2" />
 			<return type="Vector2" />
 			<description>
 			<description>
-				Returns the vector with all components rounded up (towards positive infinity).
+				Returns a new vector with all components rounded up (towards positive infinity).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="clamp" qualifiers="const">
 		<method name="clamp" qualifiers="const">
@@ -158,7 +158,7 @@
 		<method name="floor" qualifiers="const">
 		<method name="floor" qualifiers="const">
 			<return type="Vector2" />
 			<return type="Vector2" />
 			<description>
 			<description>
-				Returns the vector with all components rounded down (towards negative infinity).
+				Returns a new vector with all components rounded down (towards negative infinity).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="from_angle" qualifiers="static">
 		<method name="from_angle" qualifiers="static">
@@ -231,7 +231,7 @@
 			<argument index="0" name="to" type="Vector2" />
 			<argument index="0" name="to" type="Vector2" />
 			<argument index="1" name="delta" type="float" />
 			<argument index="1" name="delta" type="float" />
 			<description>
 			<description>
-				Moves the vector toward [code]to[/code] by the fixed [code]delta[/code] amount. Will not go past the final value.
+				Returns a new vector moved toward [code]to[/code] by the fixed [code]delta[/code] amount. Will not go past the final value.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="normalized" qualifiers="const">
 		<method name="normalized" qualifiers="const">
@@ -264,7 +264,7 @@
 			<return type="Vector2" />
 			<return type="Vector2" />
 			<argument index="0" name="b" type="Vector2" />
 			<argument index="0" name="b" type="Vector2" />
 			<description>
 			<description>
-				Returns the vector projected onto the vector [code]b[/code].
+				Returns this vector projected onto the vector [code]b[/code].
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="reflect" qualifiers="const">
 		<method name="reflect" qualifiers="const">
@@ -284,13 +284,13 @@
 		<method name="round" qualifiers="const">
 		<method name="round" qualifiers="const">
 			<return type="Vector2" />
 			<return type="Vector2" />
 			<description>
 			<description>
-				Returns the vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
+				Returns a new vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="sign" qualifiers="const">
 		<method name="sign" qualifiers="const">
 			<return type="Vector2" />
 			<return type="Vector2" />
 			<description>
 			<description>
-				Returns the vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero, by calling [method @GlobalScope.sign] on each component.
+				Returns a new vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero, by calling [method @GlobalScope.sign] on each component.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="slerp" qualifiers="const">
 		<method name="slerp" qualifiers="const">

+ 2 - 2
doc/classes/Vector2i.xml

@@ -53,7 +53,7 @@
 		<method name="aspect" qualifiers="const">
 		<method name="aspect" qualifiers="const">
 			<return type="float" />
 			<return type="float" />
 			<description>
 			<description>
-				Returns the ratio of [member x] to [member y].
+				Returns the aspect ratio of this vector, the ratio of [member x] to [member y].
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="clamp" qualifiers="const">
 		<method name="clamp" qualifiers="const">
@@ -79,7 +79,7 @@
 		<method name="sign" qualifiers="const">
 		<method name="sign" qualifiers="const">
 			<return type="Vector2i" />
 			<return type="Vector2i" />
 			<description>
 			<description>
-				Returns the vector with each component set to one or negative one, depending on the signs of the components.
+				Returns a new vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero, by calling [method @GlobalScope.sign] on each component.
 			</description>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>

+ 5 - 5
doc/classes/Vector3.xml

@@ -96,7 +96,7 @@
 			<argument index="2" name="post_b" type="Vector3" />
 			<argument index="2" name="post_b" type="Vector3" />
 			<argument index="3" name="weight" type="float" />
 			<argument index="3" name="weight" type="float" />
 			<description>
 			<description>
-				Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount [code]weight[/code]. [code]weight[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
+				Performs a cubic interpolation between this vector and [code]b[/code] using [code]pre_a[/code] and [code]post_b[/code] as handles, and returns the result at position [code]weight[/code]. [code]weight[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="direction_to" qualifiers="const">
 		<method name="direction_to" qualifiers="const">
@@ -201,7 +201,7 @@
 			<argument index="0" name="to" type="Vector3" />
 			<argument index="0" name="to" type="Vector3" />
 			<argument index="1" name="delta" type="float" />
 			<argument index="1" name="delta" type="float" />
 			<description>
 			<description>
-				Moves this vector toward [code]to[/code] by the fixed [code]delta[/code] amount. Will not go past the final value.
+				Returns a new vector moved toward [code]to[/code] by the fixed [code]delta[/code] amount. Will not go past the final value.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="normalized" qualifiers="const">
 		<method name="normalized" qualifiers="const">
@@ -246,7 +246,7 @@
 			<return type="Vector3" />
 			<return type="Vector3" />
 			<argument index="0" name="b" type="Vector3" />
 			<argument index="0" name="b" type="Vector3" />
 			<description>
 			<description>
-				Returns this vector projected onto another vector [code]b[/code].
+				Returns this vector projected onto the vector [code]b[/code].
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="reflect" qualifiers="const">
 		<method name="reflect" qualifiers="const">
@@ -267,13 +267,13 @@
 		<method name="round" qualifiers="const">
 		<method name="round" qualifiers="const">
 			<return type="Vector3" />
 			<return type="Vector3" />
 			<description>
 			<description>
-				Returns this vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
+				Returns a new vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="sign" qualifiers="const">
 		<method name="sign" qualifiers="const">
 			<return type="Vector3" />
 			<return type="Vector3" />
 			<description>
 			<description>
-				Returns a vector with each component set to one or negative one, depending on the signs of this vector's components, or zero if the component is zero, by calling [method @GlobalScope.sign] on each component.
+				Returns a new vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero, by calling [method @GlobalScope.sign] on each component.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="signed_angle_to" qualifiers="const">
 		<method name="signed_angle_to" qualifiers="const">