AnimationPlayer

Container and player of Animation resources.

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 different channels.

@GodotBaseClass
struct AnimationPlayer {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

AnimationProcessMode
enum AnimationProcessMode
Constants
enum Constants

Functions

_animationChanged
void _animationChanged()
_nodeRemoved
void _nodeRemoved(GodotObject arg0)
addAnimation
GodotError addAnimation(StringArg0 name, Animation animation)

Adds animation to the player accessible with the key name.

advance
void advance(double delta)

Shifts position in the animation timeline. Delta is the time in seconds to shift.

animationGetNext
String animationGetNext(StringArg0 anim_from)

Returns the name of the next animation in the queue.

animationSetNext
void animationSetNext(StringArg0 anim_from, StringArg1 anim_to)

Triggers the anim_to animation when the anim_from animation completes.

clearCaches
void clearCaches()

AnimationPlayer caches animated nodes. It may not notice if a node disappears, so clear_caches forces it to update the cache again.

clearQueue
void clearQueue()

Clears all queued, unplayed animations.

findAnimation
String findAnimation(Animation animation)

Returns the name of animation or empty string if not found.

getAnimation
Ref!Animation getAnimation(StringArg0 name)

Returns the Animation with key name or null if not found.

getAnimationList
PoolStringArray getAnimationList()

Returns the list of stored animation names.

getAnimationProcessMode
AnimationPlayer.AnimationProcessMode getAnimationProcessMode()
getAssignedAnimation
String getAssignedAnimation()
getAutoplay
String getAutoplay()
getBlendTime
double getBlendTime(StringArg0 anim_from, StringArg1 anim_to)

Get the blend time (in seconds) between two animations, referenced by their names.

getCurrentAnimation
String getCurrentAnimation()
getCurrentAnimationLength
double getCurrentAnimationLength()
getCurrentAnimationPosition
double getCurrentAnimationPosition()
getDefaultBlendTime
double getDefaultBlendTime()
getPlayingSpeed
double getPlayingSpeed()

Get the actual playing speed of current animation or 0 if not playing. This speed is the playback_speed property multiplied by custom_speed argument specified when calling the play method.

getRoot
NodePath getRoot()
getSpeedScale
double getSpeedScale()
hasAnimation
bool hasAnimation(StringArg0 name)

Returns true if the AnimationPlayer stores an Animation with key name.

isActive
bool isActive()
isPlaying
bool isPlaying()

Returns true if playing an animation.

opAssign
AnimationPlayer opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(AnimationPlayer other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
play
void play(StringArg0 name, double custom_blend, double custom_speed, bool from_end)

Play the animation with key name. Custom speed and blend times can be set. If custom speed is negative (-1), 'from_end' being true can play the animation backwards.

playBackwards
void playBackwards(StringArg0 name, double custom_blend)

Play the animation with key name in reverse.

queue
void queue(StringArg0 name)

Queue an animation for playback once the current one is done.

removeAnimation
void removeAnimation(StringArg0 name)

Remove the animation with key name.

renameAnimation
void renameAnimation(StringArg0 name, StringArg1 newname)

Rename an existing animation with key name to newname.

seek
void seek(double seconds, bool update)

Seek the animation to the seconds point in time (in seconds). If update is true, the animation updates too, otherwise it updates at process time.

setActive
void setActive(bool active)
setAnimationProcessMode
void setAnimationProcessMode(long mode)
setAssignedAnimation
void setAssignedAnimation(StringArg0 anim)
setAutoplay
void setAutoplay(StringArg0 name)
setBlendTime
void setBlendTime(StringArg0 anim_from, StringArg1 anim_to, double sec)

Specify a blend time (in seconds) between two animations, referenced by their names.

setCurrentAnimation
void setCurrentAnimation(StringArg0 anim)
setDefaultBlendTime
void setDefaultBlendTime(double sec)
setRoot
void setRoot(NodePathArg0 path)
setSpeedScale
void setSpeedScale(double speed)
stop
void stop(bool reset)

Stop the currently playing animation. If reset is true, the anim position is reset to 0.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

assignedAnimation
String assignedAnimation [@property getter]
String assignedAnimation [@property setter]

If playing, the current animation; otherwise, the animation last played. When set, would change the animation, but would not play it unless currently playing. See also currentAnimation.

autoplay
String autoplay [@property getter]
String autoplay [@property setter]

The name of the animation to play when the scene loads. Default value: "".

currentAnimation
String currentAnimation [@property getter]
String currentAnimation [@property setter]

The name of the current animation, "" if not playing anything. When being set, does not restart the animation. See also play. Default value: "".

currentAnimationLength
double currentAnimationLength [@property getter]

The length (in seconds) of the currently being played animation.

currentAnimationPosition
double currentAnimationPosition [@property getter]

The position (in seconds) of the currently playing animation.

playbackActive
bool playbackActive [@property getter]
bool playbackActive [@property setter]

If true, updates animations in response to process-related notifications. Default value: true.

playbackDefaultBlendTime
double playbackDefaultBlendTime [@property getter]
double playbackDefaultBlendTime [@property setter]

The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision. Default value: 0.

playbackProcessMode
AnimationPlayer.AnimationProcessMode playbackProcessMode [@property getter]
long playbackProcessMode [@property setter]

The process notification in which to update animations. Default value: ANIMATION_PROCESS_IDLE.

playbackSpeed
double playbackSpeed [@property getter]
double playbackSpeed [@property setter]

The speed scaling ratio. For instance, 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. Default value: 1.

rootNode
NodePath rootNode [@property getter]
NodePath rootNode [@property setter]

The node from which node path references will travel. Default value: "..".

Static functions

_new
AnimationPlayer _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta