AnimationLibrary
Inherits: Resource < Shared < Object
Inherited by: PixelArtAnimationLibrary
Container for Animation resources.
Description
Section titled “Description”An animation library stores a set of animations accessible through StringName keys, for use with AnimationPlayer actors.
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| Error | add_animation(name, animation) |
| Animation | get_animation(name) |
[]StringName | get_animation_list() |
| int | get_animation_list_size() |
| bool | has_animation(name) |
| void | remove_animation(name) |
| void | rename_animation(name, newname) |
Signals
Section titled “Signals”animation_added
Section titled “animation_added”animation_added(anim_name: StringName)Emitted when an Animation is added, under the key anim_name.
animation_changed
Section titled “animation_changed”animation_changed(anim_name: StringName)Emitted when there’s a change in one of the animations, e.g. tracks are added, moved or have changed paths. anim_name is the key of the animation that was changed.
See also Resource.changed, which this acts as a relay for.
animation_removed
Section titled “animation_removed”animation_removed(anim_name: StringName)Emitted when an Animation stored with the key anim_name is removed.
animation_renamed
Section titled “animation_renamed”animation_renamed(old_name: StringName, new_name: StringName)Emitted when the key for an Animation is changed, from old_name to new_name.
Method descriptions
Section titled “Method descriptions”add_animation
Section titled “add_animation”Error add_animation(name: StringName, animation: Animation)
Adds the animation to the library, accessible by the key name.
get_animation
Section titled “get_animation”Animation get_animation(name: StringName) const
Returns the Animation with the key name. If the animation does not exist, null is returned and an error is logged.
get_animation_list
Section titled “get_animation_list”[]StringName get_animation_list() const
Returns the keys for the Animations stored in the library.
get_animation_list_size
Section titled “get_animation_list_size”int get_animation_list_size() const
Returns the key count for the Animations stored in the library.
has_animation
Section titled “has_animation”bool has_animation(name: StringName) const
Returns true if the library stores an Animation with name as the key.
remove_animation
Section titled “remove_animation”void remove_animation(name: StringName)
Removes the Animation with the key name.
rename_animation
Section titled “rename_animation”void rename_animation(name: StringName, newname: StringName)
Changes the key of the Animation associated with the key name to newname.