Class AnimationLibrary
- Namespace
- Godot
- Assembly
- GodotSharp.dll
An animation library stores a set of animations accessible through StringName keys, for use with AnimationPlayer nodes.
public class AnimationLibrary : Resource, IDisposable
- Inheritance
-
AnimationLibrary
- Implements
- Inherited Members
Constructors
AnimationLibrary()
public AnimationLibrary()
Properties
_Data
public Dictionary _Data { get; set; }
Property Value
Methods
AddAnimation(StringName, Animation)
Adds the animation
to the library, accessible by the key name
.
public Error AddAnimation(StringName name, Animation animation)
Parameters
name
StringNameanimation
Animation
Returns
GetAnimation(StringName)
Returns the Animation with the key name
. If the animation does not exist, null
is returned and an error is logged.
public Animation GetAnimation(StringName name)
Parameters
name
StringName
Returns
GetAnimationList()
Returns the keys for the Animations stored in the library.
public Array<StringName> GetAnimationList()
Returns
HasAnimation(StringName)
Returns true
if the library stores an Animation with name
as the key.
public bool HasAnimation(StringName name)
Parameters
name
StringName
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
RemoveAnimation(StringName)
Removes the Animation with the key name
.
public void RemoveAnimation(StringName name)
Parameters
name
StringName
RenameAnimation(StringName, StringName)
Changes the key of the Animation associated with the key name
to newname
.
public void RenameAnimation(StringName name, StringName newname)
Parameters
name
StringNamenewname
StringName
Events
AnimationAdded
Emitted when an Animation is added, under the key name
.
public event AnimationLibrary.AnimationAddedEventHandler AnimationAdded
Event Type
AnimationChanged
Emitted when there's a change in one of the animations, e.g. tracks are added, moved or have changed paths. name
is the key of the animation that was changed.
See also Changed, which this acts as a relay for.
public event AnimationLibrary.AnimationChangedEventHandler AnimationChanged
Event Type
AnimationRemoved
Emitted when an Animation stored with the key name
is removed.
public event AnimationLibrary.AnimationRemovedEventHandler AnimationRemoved
Event Type
AnimationRenamed
Emitted when the key for an Animation is changed, from name
to toName
.
public event AnimationLibrary.AnimationRenamedEventHandler AnimationRenamed