summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGiacom <giacomand@gmail.com>2019-04-07 22:40:56 +0100
committerGiacom <giacomand@gmail.com>2019-05-28 11:39:35 +0100
commitc00427add34f505cff275ea33423f1053423d646 (patch)
tree9fef14ccadd219e7050de28394a53e72209268ce /doc
parent252c841d7ff5d770e8d2819e4f7955363410744b (diff)
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>