-
Notifications
You must be signed in to change notification settings - Fork 0
AnimationPlayer
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.AnimationPlayer |
| Namespace | Electron2D |
| Kind | class |
| Category | Animation and Tweening |
Plays Electron2D.Animation resources against nodes in the scene tree.
public sealed class Electron2D.AnimationPlayer : Electron2D.NodeProfile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: AnimationPlayer
Node that plays animation libraries, applies value tracks through NodePath, calls method tracks, queues animations and emits animation_finished.
Electron2D.AnimationPlayer mounts one or more
Electron2D.AnimationLibrary resources, resolves animation names, advances
playback during Electron2D.SceneTree processing and applies supported
tracks to target nodes.
Electron2D 0.1.0 Preview supports value tracks, method call tracks, FIFO
queue playback and the animation_finished signal. Blend trees, editor
timeline tooling and audio or 3D-specific tracks are outside this baseline.
This type is not synchronized. Create and mutate animation players on the main scene thread that owns the node.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationElectron2D.AnimationLibrary
| Member | Kind | Summary |
|---|---|---|
AssignedAnimation |
Property | Gets or sets the animation selected for calls to Electron2D.AnimationPlayer.Play(Electron2D.StringName,System.Double,System.Single,System.Boolean) with an empty name. |
Autoplay |
Property | Gets or sets the animation to play automatically when the node is ready. |
CurrentAnimation |
Property | Gets the animation currently controlled by playback. |
CurrentAnimationLength |
Property | Gets the length of the current animation in seconds. |
CurrentAnimationPosition |
Property | Gets the current playback position in seconds. |
RootNode |
Property | Gets or sets the node path used as the base for animation track paths. |
SpeedScale |
Property | Gets or sets the global playback speed multiplier. |
Electron2D.AnimationPlayer() |
Constructor | Creates an animation player with the default root node path. |
AddAnimationLibrary(Electron2D.StringName, Electron2D.AnimationLibrary) |
Method | Adds an animation library. |
Advance(System.Double) |
Method | Advances playback by a time delta. |
ClearQueue() |
Method | Clears the playback queue. |
GetAnimationLibrary(Electron2D.StringName) |
Method | Gets an animation library. |
GetAnimationLibraryList() |
Method | Gets mounted library names in deterministic alphabetical order. |
GetQueue() |
Method | Gets queued animation names. |
HasAnimation(Electron2D.StringName) |
Method | Checks whether an animation name resolves through mounted libraries. |
HasAnimationLibrary(Electron2D.StringName) |
Method | Checks whether an animation library is mounted. |
IsPlaying() |
Method | Gets whether playback is active. |
Pause() |
Method | Pauses playback at the current position. |
Play(Electron2D.StringName, System.Double, System.Single, System.Boolean) |
Method | Starts playback of an animation. |
Queue(Electron2D.StringName) |
Method | Appends an animation to the playback queue. |
RemoveAnimationLibrary(Electron2D.StringName) |
Method | Removes an animation library. |
Stop(System.Boolean) |
Method | Stops playback. |
_Ready() |
Method | Starts autoplay after the player becomes ready. |
Kind: Property
public Electron2D.StringName AssignedAnimation { get; set; }Gets or sets the animation selected for calls to Electron2D.AnimationPlayer.Play(Electron2D.StringName,System.Double,System.Single,System.Boolean) with
an empty name.
This property follows the validation and lifetime rules of its declaring type.
The assigned animation name, or an empty value when no animation is assigned.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Property
public Electron2D.StringName Autoplay { get; set; }Gets or sets the animation to play automatically when the node is ready.
This property follows the validation and lifetime rules of its declaring type.
The animation name. Use an empty value to disable autoplay.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer.Play(Electron2D.StringName,System.Double,System.Single,System.Boolean)
Kind: Property
public Electron2D.StringName CurrentAnimation { get; }Gets the animation currently controlled by playback.
This property follows the validation and lifetime rules of its declaring type.
The current animation name, or an empty value before playback starts.
This property is safe to read on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Property
public System.Double CurrentAnimationLength { get; }Gets the length of the current animation in seconds.
This property follows the validation and lifetime rules of its declaring type.
The resolved animation length, or 0 when no current animation is
available.
This property is safe to read on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Property
public System.Double CurrentAnimationPosition { get; }Gets the current playback position in seconds.
This property follows the validation and lifetime rules of its declaring type.
The current position inside Electron2D.AnimationPlayer.CurrentAnimation.
This property is safe to read on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Property
public Electron2D.NodePath RootNode { get; set; }Gets or sets the node path used as the base for animation track paths.
A value track path such as Target:Position first resolves
Electron2D.AnimationPlayer.RootNode, then resolves Target from that root.
A path resolved relative to this player. The default is ...
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Property
public System.Single SpeedScale { get; set; }Gets or sets the global playback speed multiplier.
This property follows the validation and lifetime rules of its declaring type.
A finite speed multiplier. The default value is 1.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is not finite.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Constructor
public Electron2D.AnimationPlayer()Creates an animation player with the default root node path.
The constructor registers the animation_finished signal and sets
Electron2D.AnimationPlayer.RootNode to .., so track paths resolve relative to
the player's parent by default.
Construction is safe on any thread when the instance is not shared until construction completes.
This constructor is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Method
public Electron2D.Error AddAnimationLibrary(Electron2D.StringName, Electron2D.AnimationLibrary)(Electron2D.StringName name, Electron2D.AnimationLibrary library)Adds an animation library.
This method follows the validation and lifetime rules of its declaring type.
-
name: The library name. An empty name represents the default library. -
library: The library to mount.
Electron2D.Error.Ok on success, Electron2D.Error.InvalidParameter
for a null library, or Electron2D.Error.AlreadyExists when the
name is already used.
This method is not synchronized. Mutate the player on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer.RemoveAnimationLibrary(Electron2D.StringName)
Kind: Method
public System.Void Advance(System.Double)(System.Double delta)Advances playback by a time delta.
This method is called automatically from Electron2D.SceneTree
processing. Calling it manually is useful for deterministic tests and
tools that need to advance a player without a full frame.
-
delta: The finite, non-negative delta in seconds.
-
System.ArgumentOutOfRangeException: Thrown whendeltais not finite or is less than0.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Method
public System.Void ClearQueue()()Clears the playback queue.
This method follows the validation and lifetime rules of its declaring type.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer.Queue(Electron2D.StringName)
Kind: Method
public Electron2D.AnimationLibrary GetAnimationLibrary(Electron2D.StringName)(Electron2D.StringName name)Gets an animation library.
This method follows the validation and lifetime rules of its declaring type.
-
name: The library name. An empty name addresses the default library.
The mounted library, or null when missing.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Method
public Electron2D.StringName[] GetAnimationLibraryList()()Gets mounted library names in deterministic alphabetical order.
This method follows the validation and lifetime rules of its declaring type.
An array containing all mounted library names.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Method
public Electron2D.StringName[] GetQueue()()Gets queued animation names.
This method follows the validation and lifetime rules of its declaring type.
The queued names in playback order.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer.Queue(Electron2D.StringName)
Kind: Method
public System.Boolean HasAnimation(Electron2D.StringName)(Electron2D.StringName name)Checks whether an animation name resolves through mounted libraries.
This method follows the validation and lifetime rules of its declaring type.
-
name: A bare animation name for the default library, orlibrary/animationfor a named library.
true when the animation resolves; otherwise, false.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Method
public System.Boolean HasAnimationLibrary(Electron2D.StringName)(Electron2D.StringName name)Checks whether an animation library is mounted.
This method follows the validation and lifetime rules of its declaring type.
-
name: The library name. An empty name addresses the default library.
true when the library exists; otherwise, false.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Method
public System.Boolean IsPlaying()()Gets whether playback is active.
This method follows the validation and lifetime rules of its declaring type.
true when playback is active; otherwise, false.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Method
public System.Void Pause()()Pauses playback at the current position.
This method follows the validation and lifetime rules of its declaring type.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer.Play(Electron2D.StringName,System.Double,System.Single,System.Boolean)Electron2D.AnimationPlayer.Stop(System.Boolean)
Kind: Method
public System.Void Play(Electron2D.StringName, System.Double, System.Single, System.Boolean)(Electron2D.StringName name, System.Double customBlend, System.Single customSpeed, System.Boolean fromEnd)Starts playback of an animation.
Missing animations leave playback stopped. Value tracks are applied at the starting position immediately; method tracks are not called until time advances across their key times.
-
name: The animation to play, or an empty value to useElectron2D.AnimationPlayer.AssignedAnimation. -
customBlend: Reserved blend time parameter. The 0.1.0 Preview runtime accepts the value but does not blend animations yet. -
customSpeed: The finite custom speed multiplier. -
fromEnd:trueto start at the end of the animation; otherwise,false.
-
System.ArgumentOutOfRangeException: Thrown whencustomBlendorcustomSpeedis not finite.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer.Queue(Electron2D.StringName)Electron2D.AnimationPlayer.Stop(System.Boolean)
Kind: Method
public System.Void Queue(Electron2D.StringName)(Electron2D.StringName name)Appends an animation to the playback queue.
Missing or empty names are ignored. Queued animations start after the
current non-looping animation emits animation_finished.
-
name: The animation name to queue.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer.ClearQueueElectron2D.AnimationPlayer.GetQueue
Kind: Method
public System.Void RemoveAnimationLibrary(Electron2D.StringName)(Electron2D.StringName name)Removes an animation library.
Removing a missing library is a no-op.
-
name: The library name. An empty name addresses the default library.
This method is not synchronized. Mutate the player on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Kind: Method
public System.Void Stop(System.Boolean)(System.Boolean keepState)Stops playback.
When keepState is false, value tracks are
applied at time 0 if the current animation can still be resolved.
-
keepState:trueto keep the current position;falseto reset to the beginning of the current animation.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer.Pause
Kind: Method
public System.Void _Ready()()Starts autoplay after the player becomes ready.
If Electron2D.AnimationPlayer.Autoplay is not empty, this callback calls
Electron2D.AnimationPlayer.Play(Electron2D.StringName,System.Double,System.Single,System.Boolean) with that animation name.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationPlayer
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.