forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
class_animationplayer
reduz edited this page Feb 23, 2014
·
13 revisions
Inherits: node\ Category: Core\
Container and player of [Animaton] resources.
- int #add_animation( String name, Animation animation )
- void #remove_animation( String name )
- void #rename_animation( String name, String newname )
- bool #has_animation( String name ) const
- Animation #get_animation( String name ) const
- StringArray #get_animation_list(****) const
- void #set_blend_time( String anim_from, String anim_to, real sec )
- real #get_blend_time( String anim_from, String anim_to ) const
- void #set_default_blend_time( real sec )
- real #get_default_blend_time(****) const
- void #play( String name="", real custom_blend=-1, real custom_speed=1, bool from_end=false )
- void #stop(****)
- void #stop_all(****)
- bool #is_playing(****) const
- void #set_current_animation( String anim )
- String #get_current_animation(****) const
- void #queue( String name )
- void #clear_queue(****)
- void #set_active( bool active )
- bool #is_active(****) const
- void #set_speed( real speed )
- real #get_speed(****) const
- void #set_autoplay( String name )
- String #get_autoplay(****) const
- void #set_root( NodePath path )
- NodePath #get_root(****) const
- void #seek( real pos_sec, bool update=false )
- real #get_pos(****) const
- String #find_animation( Animation animation ) const
- void #clear_caches(****)
- void #set_animation_process_mode( int mode )
- int #get_animation_process_mode(****) const
- real #get_current_animation_pos(****) const
- real #get_current_animation_length(****) const
- ANIMATION_PROCESS_FIXED = 0
- ANIMATION_PROCESS_IDLE = 1
An animation player is used for general purpose playback of animation resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in diferent channels.
== add_animation ==
- int #add_animation( String name, Animation animation ) \ Add an animation resource to the player, which will be later referenced by the "name" arguemnt. == remove_animation ==
- void #remove_animation( String name ) \ Remove an animation from the player (by supplying the same name used to add it). == rename_animation ==
- void #rename_animation( String name, String newname ) \ Rename an existing animation. == has_animation ==
- bool #has_animation( String name ) const \ Request wether an animation name exist within the player. == get_animation ==
- Animation #get_animation( String name ) const \ Get an animation resource by requesting a name. == get_animation_list ==
- StringArray #get_animation_list(****) const \ Get the list of names of the animations stored in the player. == set_blend_time ==
- void #set_blend_time( String anim_from, String anim_to, real sec ) \ Specify a blend time (in seconds) between two animations, referemced by their names. == get_blend_time ==
- real #get_blend_time( String anim_from, String anim_to ) const \ Get the blend time between two animations, referemced by their names. == set_default_blend_time ==
- void #set_default_blend_time( real sec ) \ Set the default blend time between animations. == get_default_blend_time ==
- real #get_default_blend_time(****) const \ Return the default blend time between animations. == stop_all ==
- void #stop_all(****) \ Stop playback on all animation channels. == is_playing ==
- bool #is_playing(****) const \ Return wether an animation chanel is playing (or channel 0 if none is provided). == set_current_animation ==
- void #set_current_animation( String anim ) \ Set the current animation (even if no playback occurs). Using set_current_animation() and set_active() are similar to claling play(). == get_current_animation ==
- String #get_current_animation(****) const \ Return the name of the animation being played in a channel (or channel 0 if none is provided). == queue ==
- void #queue( String name ) \ Queue an animation for playback once the current one is done. == set_active ==
- void #set_active( bool active ) \ Set the player as active (playing) == is_active ==
- bool #is_active(****) const \ Return true if the player is active. == set_speed ==
- void #set_speed( real speed ) \ Set a speed scaling ratio in a given animation channel (or channel 0 if none is provided). Default ratio is //1// (no scaling). == get_speed ==
- real #get_speed(****) const \ Get the speed scaling ratio in a given animation channel (or channel 0 if none is provided). Default ratio is //1// (no scaling). == set_autoplay ==
- void #set_autoplay( String name ) \ Set the name of the animation that will be automatically played when the scene is loaded. == get_autoplay ==
- String #get_autoplay(****) const \ Return the name of the animation that will be automatically played when the scene is loaded. == seek ==
- void #seek( real pos_sec, bool update=false ) \ Seek the animation in an animation channel (or channel 0 if none is provided) to a specific position (in seconds). == get_pos ==
- real #get_pos(****) const \ Return the playback position (in seconds) in an animation channel (or channel 0 if none is provided) == find_animation ==
- String #find_animation( Animation animation ) const \ Find an animation name by resource. == clear_caches ==
- void #clear_caches(****) \ The animation player creates caches for faster access to the nodes it will animate. However, if a specific node is removed, it may not notice it, so clear_caches will force the player to search for the nodes again. == set_animation_process_mode ==
- void #set_animation_process_mode( int mode ) \ Set the mode in which the animation player processes. By default, it processes on idle time (framerate dependent), but using fixed time works well for animating static collision bodies in 2D and 3D. See enum ANIMATION_PROCESS_*. == get_animation_process_mode ==
- int #get_animation_process_mode(****) const \ Return the mode in which the animation player processes. See #set_animation_process_mode.