AnimationLibrary
Container for Animation
resources.
class AnimationLibrary
An animation library stores a set of animations accessible through StringName
keys, for use with AnimationPlayer
nodes.
This object emits the following signals:
Superclasses
class Resource
Base class for serializable objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
class Signal4
Signal support.
Type members
Instance members
var animationAdded: Signal1
Emitted when an
Animation
is added, under the keyname
.var animationChanged: Signal4
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.var animationRemoved: Signal2
Emitted when an
Animation
stored with the keyname
is removed.var animationRenamed: Signal3
Emitted when the key for an
Animation
is changed, fromname
totoName
.func addAnimation(name: StringName, animation: Animation?
) -> GodotError Adds the
animation
to the library, accessible by the keyname
.func getAnimation(name: StringName
) -> Animation? Returns the
Animation
with the keyname
. If the animation does not exist,null
is returned and an error is logged.func getAnimationList(
) -> VariantCollection<StringName> Returns the keys for the
Animation
s stored in the library.func hasAnimation(name: StringName
) -> Bool Returns
true
if the library stores anAnimation
withname
as the key.func removeAnimation(name: StringName
) Removes the
Animation
with the keyname
.func renameAnimation(name: StringName, newname: StringName
) Changes the key of the
Animation
associated with the keyname
tonewname
.