diff options
author | robfram <robfram@gmail.com> | 2018-03-01 19:52:00 +0100 |
---|---|---|
committer | robfram <robfram@gmail.com> | 2018-03-03 09:29:22 +0100 |
commit | 5ef88cf577ad45b4dece733f1bb1350f7c93547e (patch) | |
tree | bf85ff8b26bf9109b1ddf414fe7c66e93b1d6ecc /doc | |
parent | 741af0652dd3e5992654ef401f04f9f461e1d0c5 (diff) |
Added `get_playing_speed` method to AnimationPlayer, returning the actual
playing speed of the animation being played.
As stated in #16550, there is no way to get the playing speed of an
animation. The `playback_speed` property is for the whole AnimationPlayer
node, and the argument passed to `play` method is another scale applied
in top of the AnimationPlayer properties.
Thus, the actual playing speed is AnimationPlayer.speed_scale *
AnimationPlayer.playback.current.speed_scale. If it is not playing, the
method returns 0.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/AnimationPlayer.xml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 178c714a20..ed859169fd 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -103,6 +103,14 @@ Get the blend time (in seconds) between two animations, referenced by their names. </description> </method> + <method name="get_playing_speed" qualifiers="const"> + <return type="float"> + </return> + <description> + Get the actual playing speed of current animation or 0 if not playing. This speed is the [code]playback_speed[/code] property multiplied by [code]custom_speed[/code] argument specified when calling the [code]play[/code] method. + </description> + </method> + <method name="has_animation" qualifiers="const"> <return type="bool"> </return> |