summaryrefslogtreecommitdiff
path: root/doc/classes/Animation.xml
diff options
context:
space:
mode:
authorTokage <tokage.it.lab@gmail.com>2021-04-25 05:47:03 +0900
committerSilc 'Tokage' Renew <tokage.it.lab@gmail.com>2021-10-09 18:08:43 +0900
commit372ba7666304805abe8641487c97899f9bdd97af (patch)
tree3a5d56b1fd80db923c08fa25c7c3d407b992c496 /doc/classes/Animation.xml
parente8c89b2b9158ce011ed5c1a913f55d38226c4a55 (diff)
implement ping-pong loop in animation
Co-authored-by: Chaosus <chaosus89@gmail.com>
Diffstat (limited to 'doc/classes/Animation.xml')
-rw-r--r--doc/classes/Animation.xml14
1 files changed, 12 insertions, 2 deletions
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml
index d2ecbdde26..ca2c09d64d 100644
--- a/doc/classes/Animation.xml
+++ b/doc/classes/Animation.xml
@@ -481,6 +481,7 @@
<return type="Array" />
<argument index="0" name="track_idx" type="int" />
<argument index="1" name="time_sec" type="float" />
+ <argument index="2" name="is_backward" type="bool" default="false" />
<description>
Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position ([Vector3]), rotation ([Quaternion]) and scale ([Vector3]).
</description>
@@ -523,8 +524,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.
</member>
- <member name="loop" type="bool" setter="set_loop" getter="has_loop" default="false">
- 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.
+ <member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" enum="Animation.LoopMode" default="0">
+ 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.
</member>
<member name="step" type="float" setter="set_step" getter="get_step" default="0.1">
The animation step value.
@@ -577,5 +578,14 @@
<constant name="UPDATE_CAPTURE" value="3" enum="UpdateMode">
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.
</constant>
+ <constant name="LOOP_NONE" value="0" enum="LoopMode">
+ At both ends of the animation, the animation will stop playing.
+ </constant>
+ <constant name="LOOP_LINEAR" value="1" enum="LoopMode">
+ At both ends of the animation, the animation will be repeated without changing the playback direction.
+ </constant>
+ <constant name="LOOP_PINGPONG" value="2" enum="LoopMode">
+ Repeats playback and reverse playback at both ends of the animation.
+ </constant>
</constants>
</class>