From 953a7bce7edf289dd8d2a1a6c8ecd8105380c8da Mon Sep 17 00:00:00 2001 From: Silc 'Tokage' Renew Date: Fri, 15 Oct 2021 22:25:00 +0900 Subject: reimplement ping-pong --- doc/classes/@GlobalScope.xml | 20 ++++++++++++++++++++ doc/classes/Animation.xml | 13 +++++++++++-- doc/classes/AnimationNode.xml | 1 + doc/classes/AnimationNodeAnimation.xml | 9 +++++++++ doc/classes/AudioStreamSample.xml | 2 +- 5 files changed, 42 insertions(+), 3 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 4b710d5f12..66c20b8426 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -525,6 +525,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). + + + + + + 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] + + diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index e3bb60f6de..dca943dec6 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -551,8 +551,8 @@ The total length of the animation (in seconds). [b]Note:[/b] Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping. - - A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation. + + Determines the behavior of both ends of the animation timeline during animation playback. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation. The animation step value. @@ -610,5 +610,14 @@ Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds. + + At both ends of the animation, the animation will stop playing. + + + At both ends of the animation, the animation will be repeated without changing the playback direction. + + + Repeats playback and reverse playback at both ends of the animation. + diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 173ff43d2a..6bc44ea0a0 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -73,6 +73,7 @@ + Blend an animation by [code]blend[/code] amount (name must be valid in the linked [AnimationPlayer]). A [code]time[/code] and [code]delta[/code] may be passed, as well as whether [code]seek[/code] happened. diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml index 668a35226f..076e675007 100644 --- a/doc/classes/AnimationNodeAnimation.xml +++ b/doc/classes/AnimationNodeAnimation.xml @@ -15,5 +15,14 @@ Animation to use as an output. It is one of the animations provided by [member AnimationTree.anim_player]. + + Determines the playback direction of the animation. + + + + + + + diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml index 7e1155d89b..df7b5ff1c7 100644 --- a/doc/classes/AudioStreamSample.xml +++ b/doc/classes/AudioStreamSample.xml @@ -61,7 +61,7 @@ Audio loops the data between [member loop_begin] and [member loop_end], playing forward only. - + Audio loops the data between [member loop_begin] and [member loop_end], playing back and forth. -- cgit v1.2.3