diff options
Diffstat (limited to 'doc/classes/AnimationPlayer.xml')
-rw-r--r-- | doc/classes/AnimationPlayer.xml | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 9efd3ac939..25e4a4549d 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -15,6 +15,17 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> + <method name="_post_process_key_value" qualifiers="virtual const"> + <return type="Variant" /> + <param index="0" name="animation" type="Animation" /> + <param index="1" name="track" type="int" /> + <param index="2" name="value" type="Variant" /> + <param index="3" name="object" type="Object" /> + <param index="4" name="object_idx" type="int" /> + <description> + A virtual function for processing after key getting during playback. + </description> + </method> <method name="add_animation_library"> <return type="int" enum="Error" /> <param index="0" name="name" type="StringName" /> @@ -102,13 +113,14 @@ <param index="0" name="anim_from" type="StringName" /> <param index="1" name="anim_to" type="StringName" /> <description> - Gets the blend time (in seconds) between two animations, referenced by their keys. + Returns the blend time (in seconds) between two animations, referenced by their keys. </description> </method> <method name="get_playing_speed" qualifiers="const"> <return type="float" /> <description> - Gets the actual playing speed of current animation or 0 if not playing. This speed is the [member playback_speed] property multiplied by [code]custom_speed[/code] argument specified when calling the [method play] method. + Returns the actual playing speed of current animation or [code]0[/code] if not playing. This speed is the [member speed_scale] property multiplied by [code]custom_speed[/code] argument specified when calling the [method play] method. + Returns a negative value if the current animation is playing backwards. </description> </method> <method name="get_queue"> @@ -134,7 +146,14 @@ <method name="is_playing" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if playing an animation. + Returns [code]true[/code] if an animation is currently playing (even if [member speed_scale] and/or [code]custom_speed[/code] are [code]0[/code]). + </description> + </method> + <method name="pause"> + <return type="void" /> + <description> + Pauses the currently playing animation. The [member current_animation_position] will be kept and calling [method play] or [method play_backwards] without arguments or with the same animation name as [member assigned_animation] will resume the animation. + See also [method stop]. </description> </method> <method name="play"> @@ -145,7 +164,7 @@ <param index="3" name="from_end" type="bool" default="false" /> <description> Plays the animation with key [param name]. Custom blend times and speed can be set. If [param custom_speed] is negative and [param from_end] is [code]true[/code], the animation will play backwards (which is equivalent to calling [method play_backwards]). - The [AnimationPlayer] keeps track of its current or last played animation with [member assigned_animation]. If this method is called with that same animation [param name], or with no [param name] parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see [method stop] for both pause and stop). If the animation was already playing, it will keep playing. + The [AnimationPlayer] keeps track of its current or last played animation with [member assigned_animation]. If this method is called with that same animation [param name], or with no [param name] parameter, the assigned animation will resume playing if it was paused. [b]Note:[/b] The animation will be updated the next time the [AnimationPlayer] is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call [code]advance(0)[/code]. </description> </method> @@ -201,10 +220,11 @@ </method> <method name="stop"> <return type="void" /> - <param index="0" name="reset" type="bool" default="true" /> + <param index="0" name="keep_state" type="bool" default="false" /> <description> - Stops or pauses the currently playing animation. If [param reset] is [code]true[/code], the animation position is reset to [code]0[/code] and the playback speed is reset to [code]1.0[/code]. - If [param reset] is [code]false[/code], the [member current_animation_position] will be kept and calling [method play] or [method play_backwards] without arguments or with the same animation name as [member assigned_animation] will resume the animation. + Stops the currently playing animation. The animation position is reset to [code]0[/code] and the [code]custom_speed[/code] is reset to [code]1.0[/code]. See also [method pause]. + If [param keep_state] is [code]true[/code], the animation state is not updated visually. + [b]Note:[/b] The method / audio / animation playback tracks will not be processed by this method. </description> </method> </methods> @@ -212,6 +232,10 @@ <member name="assigned_animation" type="String" setter="set_assigned_animation" getter="get_assigned_animation"> If playing, the the current animation's key, otherwise, the animation last played. When set, this changes the animation, but will not play it unless already playing. See also [member current_animation]. </member> + <member name="audio_max_polyphony" type="int" setter="set_audio_max_polyphony" getter="get_audio_max_polyphony" default="32"> + The number of possible simultaneous sounds for each of the assigned AudioStreamPlayers. + For example, if this value is [code]32[/code] and the animation has two audio tracks, the two [AudioStreamPlayer]s assigned can play simultaneously up to [code]32[/code] voices each. + </member> <member name="autoplay" type="String" setter="set_autoplay" getter="get_autoplay" default=""""> The key of the animation to play when the scene loads. </member> @@ -241,9 +265,6 @@ <member name="playback_process_mode" type="int" setter="set_process_callback" getter="get_process_callback" enum="AnimationPlayer.AnimationProcessCallback" default="1"> The process notification in which to update animations. </member> - <member name="playback_speed" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> - The speed scaling ratio. For example, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed. - </member> <member name="reset_on_save" type="bool" setter="set_reset_on_save_enabled" getter="is_reset_on_save_enabled" default="true"> This is used by the editor. If set to [code]true[/code], the scene will be saved with the effects of the reset animation (the animation with the key [code]"RESET"[/code]) applied as if it had been seeked to time 0, with the editor keeping the values that the scene had before saving. This makes it more convenient to preview and edit animations in the editor, as changes to the scene will not be saved as long as they are set in the reset animation. @@ -251,6 +272,10 @@ <member name="root_node" type="NodePath" setter="set_root" getter="get_root" default="NodePath("..")"> The node from which node path references will travel. </member> + <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> + The speed scaling ratio. For example, if this value is [code]1[/code], then the animation plays at normal speed. If it's [code]0.5[/code], then it plays at half speed. If it's [code]2[/code], then it plays at double speed. + If set to a negative value, the animation is played in reverse. If set to [code]0[/code], the animation will not advance. + </member> </members> <signals> <signal name="animation_changed"> |