summaryrefslogtreecommitdiff
path: root/doc/classes/@GlobalScope.xml
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-09 22:11:04 +0100
committerGitHub <noreply@github.com>2021-11-09 22:11:04 +0100
commit06a33e590f029d4d96e32df62f3c3961e1c33e4e (patch)
treed91ff1e2c78a31d2897a2cc49218d4f3b7535459 /doc/classes/@GlobalScope.xml
parentefea3128c3b0d026a20efaf6bd46058c2b732519 (diff)
parent953a7bce7edf289dd8d2a1a6c8ecd8105380c8da (diff)
Merge pull request #53819 from TokageItLab/re-implement-ping-pong
Reimplement ping-pong animation and reverse playback
Diffstat (limited to 'doc/classes/@GlobalScope.xml')
-rw-r--r--doc/classes/@GlobalScope.xml20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index ea49b6b634..345a769ca5 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -566,6 +566,26 @@
[b]Warning:[/b] Due to the way it is implemented, this function returns [code]0[/code] rather than [code]1[/code] for non-positive values of [code]value[/code] (in reality, 1 is the smallest integer power of 2).
</description>
</method>
+ <method name="pingpong">
+ <return type="float" />
+ <argument index="0" name="value" type="float" />
+ <argument index="1" name="length" type="float" />
+ <description>
+ Returns the [code]value[/code] wrapped between [code]0[/code] and the [code]length[/code]. If the limit is reached, the next value the function returned is decreased to the [code]0[/code] side or increased to the [code]length[/code] side (like a triangle wave). If [code]length[/code] is less than zero, it becomes positive.
+ [codeblock]
+ pingpong(-3.0, 3.0) # Returns 3
+ pingpong(-2.0, 3.0) # Returns 2
+ pingpong(-1.0, 3.0) # Returns 1
+ pingpong(0.0, 3.0) # Returns 0
+ pingpong(1.0, 3.0) # Returns 1
+ pingpong(2.0, 3.0) # Returns 2
+ pingpong(3.0, 3.0) # Returns 3
+ pingpong(4.0, 3.0) # Returns 2
+ pingpong(5.0, 3.0) # Returns 1
+ pingpong(6.0, 3.0) # Returns 0
+ [/codeblock]
+ </description>
+ </method>
<method name="posmod">
<return type="int" />
<argument index="0" name="x" type="int" />