From df527b37d57f8747f288d01c82a9ae37f256b929 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu <timothyqiu32@gmail.com> Date: Thu, 6 Jan 2022 18:46:25 +0800 Subject: [PATCH] Unify similar method descriptions Notably: * `Pool*Array.size()` and `Array.size()`. * Shared methods of `Transform2D` and `Transform`. * Shared methods of `Vector2` and `Vector3`. This reduces the Deja Vu when translating the class reference :) --- doc/classes/PoolByteArray.xml | 2 +- doc/classes/PoolColorArray.xml | 2 +- doc/classes/PoolIntArray.xml | 2 +- doc/classes/PoolRealArray.xml | 2 +- doc/classes/PoolStringArray.xml | 2 +- doc/classes/PoolVector2Array.xml | 2 +- doc/classes/PoolVector3Array.xml | 2 +- doc/classes/RayCast.xml | 3 +-- doc/classes/Transform.xml | 6 +++--- doc/classes/Vector2.xml | 12 ++++++------ doc/classes/Vector3.xml | 10 +++++----- 11 files changed, 22 insertions(+), 23 deletions(-) diff --git a/doc/classes/PoolByteArray.xml b/doc/classes/PoolByteArray.xml index 4e5b86ee0a3..9301e4ff11b 100644 --- a/doc/classes/PoolByteArray.xml +++ b/doc/classes/PoolByteArray.xml @@ -125,7 +125,7 @@ <method name="size"> <return type="int" /> <description> - Returns the size of the array. + Returns the number of elements in the array. </description> </method> <method name="subarray"> diff --git a/doc/classes/PoolColorArray.xml b/doc/classes/PoolColorArray.xml index 4fe42de6ac8..f0b413bb333 100644 --- a/doc/classes/PoolColorArray.xml +++ b/doc/classes/PoolColorArray.xml @@ -76,7 +76,7 @@ <method name="size"> <return type="int" /> <description> - Returns the size of the array. + Returns the number of elements in the array. </description> </method> </methods> diff --git a/doc/classes/PoolIntArray.xml b/doc/classes/PoolIntArray.xml index 55d0bf97bab..e19ba1409db 100644 --- a/doc/classes/PoolIntArray.xml +++ b/doc/classes/PoolIntArray.xml @@ -78,7 +78,7 @@ <method name="size"> <return type="int" /> <description> - Returns the array size. + Returns the number of elements in the array. </description> </method> </methods> diff --git a/doc/classes/PoolRealArray.xml b/doc/classes/PoolRealArray.xml index 2bd9050283c..fcb0678f64e 100644 --- a/doc/classes/PoolRealArray.xml +++ b/doc/classes/PoolRealArray.xml @@ -78,7 +78,7 @@ <method name="size"> <return type="int" /> <description> - Returns the size of the array. + Returns the number of elements in the array. </description> </method> </methods> diff --git a/doc/classes/PoolStringArray.xml b/doc/classes/PoolStringArray.xml index f1932559ad9..84036af5547 100644 --- a/doc/classes/PoolStringArray.xml +++ b/doc/classes/PoolStringArray.xml @@ -84,7 +84,7 @@ <method name="size"> <return type="int" /> <description> - Returns the size of the array. + Returns the number of elements in the array. </description> </method> </methods> diff --git a/doc/classes/PoolVector2Array.xml b/doc/classes/PoolVector2Array.xml index e877adf5982..9fbc32be4e2 100644 --- a/doc/classes/PoolVector2Array.xml +++ b/doc/classes/PoolVector2Array.xml @@ -77,7 +77,7 @@ <method name="size"> <return type="int" /> <description> - Returns the size of the array. + Returns the number of elements in the array. </description> </method> </methods> diff --git a/doc/classes/PoolVector3Array.xml b/doc/classes/PoolVector3Array.xml index 2e927a2bac3..7a6478210af 100644 --- a/doc/classes/PoolVector3Array.xml +++ b/doc/classes/PoolVector3Array.xml @@ -76,7 +76,7 @@ <method name="size"> <return type="int" /> <description> - Returns the size of the array. + Returns the number of elements in the array. </description> </method> </methods> diff --git a/doc/classes/RayCast.xml b/doc/classes/RayCast.xml index ec3d31e6648..760368fe265 100644 --- a/doc/classes/RayCast.xml +++ b/doc/classes/RayCast.xml @@ -38,8 +38,7 @@ <method name="force_raycast_update"> <return type="void" /> <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] [code]enabled[/code] is not required for this to work. </description> </method> diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index 41de2601ab4..3ac925f9a57 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -66,13 +66,13 @@ <argument index="0" name="transform" type="Transform" /> <argument index="1" name="weight" type="float" /> <description> - Interpolates the transform to other Transform 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> </method> <method name="inverse"> <return type="Transform" /> <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> </method> <method name="is_equal_approx"> @@ -95,7 +95,7 @@ <method name="orthonormalized"> <return type="Transform" /> <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> </method> <method name="rotated"> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 6b9fc3fdaa5..6ac1e751dae 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -71,7 +71,7 @@ <method name="ceil"> <return type="Vector2" /> <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> </method> <method name="clamped"> @@ -134,7 +134,7 @@ <method name="floor"> <return type="Vector2" /> <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> </method> <method name="is_equal_approx"> @@ -183,7 +183,7 @@ <argument index="0" name="to" type="Vector2" /> <argument index="1" name="delta" type="float" /> <description> - Moves the vector toward [code]to[/code] by the fixed [code]delta[/code] amount. + Returns a new vector moved toward [code]to[/code] by the fixed [code]delta[/code] amount. Will not go past the final value. </description> </method> <method name="normalized"> @@ -210,7 +210,7 @@ <return type="Vector2" /> <argument index="0" name="b" type="Vector2" /> <description> - Returns the vector projected onto the vector [code]b[/code]. + Returns this vector projected onto the vector [code]b[/code]. </description> </method> <method name="reflect"> @@ -230,13 +230,13 @@ <method name="round"> <return type="Vector2" /> <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> </method> <method name="sign"> <return type="Vector2" /> <description> - Returns the vector with each component set to one or negative one, depending on the signs of the components. If a component is zero, it returns positive one. + Returns a new vector with each component set to one or negative one, depending on the signs of the components. If a component is zero, it returns positive one. </description> </method> <method name="slerp"> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index d217a11f298..65f5dcc0596 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -65,7 +65,7 @@ <argument index="2" name="post_b" type="Vector3" /> <argument index="3" name="weight" type="float" /> <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> </method> <method name="direction_to"> @@ -170,7 +170,7 @@ <argument index="0" name="to" type="Vector3" /> <argument index="1" name="delta" type="float" /> <description> - Moves this vector toward [code]to[/code] by the fixed [code]delta[/code] amount. + Returns a new vector moved toward [code]to[/code] by the fixed [code]delta[/code] amount. Will not go past the final value. </description> </method> <method name="normalized"> @@ -204,7 +204,7 @@ <return type="Vector3" /> <argument index="0" name="b" type="Vector3" /> <description> - Returns this vector projected onto another vector [code]b[/code]. + Returns this vector projected onto the vector [code]b[/code]. </description> </method> <method name="reflect"> @@ -225,13 +225,13 @@ <method name="round"> <return type="Vector3" /> <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> </method> <method name="sign"> <return type="Vector3" /> <description> - Returns a vector with each component set to one or negative one, depending on the signs of this vector's components. If a component is zero, it returns positive one. + Returns a new vector with each component set to one or negative one, depending on the signs of the components. If a component is zero, it returns positive one. </description> </method> <method name="signed_angle_to">