summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-06-01 12:05:18 +0200
committerGitHub <noreply@github.com>2019-06-01 12:05:18 +0200
commit3c4fab295b96c9bd852601531bf35c1ade56b54c (patch)
tree9adcec083a49ca4935ff70e1257bd492ca88df62 /doc
parent64a88e8ef35d692f31d6114793468623c6756785 (diff)
parentc00427add34f505cff275ea33423f1053423d646 (diff)
Merge pull request #27789 from Giacom/move_towards
Added move_toward functions for float, Vector2 and Vector3
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/@GDScript.xml17
-rw-r--r--doc/classes/Vector2.xml11
-rw-r--r--doc/classes/Vector3.xml11
3 files changed, 39 insertions, 0 deletions
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml
index 63b9ef13fd..553fd4d629 100644
--- a/doc/classes/@GDScript.xml
+++ b/doc/classes/@GDScript.xml
@@ -640,6 +640,23 @@
[/codeblock]
</description>
</method>
+ <method name="move_toward">
+ <return type="float">
+ </return>
+ <argument index="0" name="from" type="float">
+ </argument>
+ <argument index="1" name="to" type="float">
+ </argument>
+ <argument index="2" name="delta" type="float">
+ </argument>
+ <description>
+ Moves [code]from[/code] toward [code]to[/code] by the [code]delta[/code] value.
+ Use a negative [code]delta[/code] value to move away.
+ [codeblock]
+ move_toward(10, 5, 4) # returns 6
+ [/codeblock]
+ </description>
+ </method>
<method name="nearest_po2">
<return type="int">
</return>
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 75221ccc82..eff8b0680e 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -185,6 +185,17 @@
Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
</description>
</method>
+ <method name="move_toward">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="b" type="Vector2">
+ </argument>
+ <argument index="1" name="t" type="float">
+ </argument>
+ <description>
+ Moves the vector toward [code]to[/code] by the fixed [code]delta[/code] amount.
+ </description>
+ </method>
<method name="normalized">
<return type="Vector2">
</return>
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index bcd745945e..86603d60cc 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -175,6 +175,17 @@
Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants.
</description>
</method>
+ <method name="move_toward">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="b" type="Vector3">
+ </argument>
+ <argument index="1" name="t" type="float">
+ </argument>
+ <description>
+ Moves the vector toward [code]to[/code] by the fixed [code]delta[/code] amount.
+ </description>
+ </method>
<method name="normalized">
<return type="Vector3">
</return>