-
Notifications
You must be signed in to change notification settings - Fork 0
AnimationLibrary
Namespace: Electron2D
Stores named Electron2D.Animation resources for Electron2D.AnimationPlayer.
public sealed class Electron2D.AnimationLibrary : Electron2D.ResourceAn Electron2D.AnimationLibrary groups animations under stable names. The
library does not play animations by itself; it is mounted into an
Electron2D.AnimationPlayer under a library name.
The library emits user signals named animation_added,
animation_removed and animation_renamed when its contents
change.
This type is not synchronized. Mutate it during loading or on the main scene thread. Read-only access is safe only when no thread is mutating the library.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationElectron2D.AnimationPlayer
| Member | Kind | Summary |
|---|---|---|
Electron2D.AnimationLibrary() |
Constructor | Creates an empty animation library. |
AddAnimation(Electron2D.StringName, Electron2D.Animation) |
Method | Adds an animation under a name. |
GetAnimation(Electron2D.StringName) |
Method | Gets an animation by name. |
GetAnimationList() |
Method | Gets animation names in deterministic alphabetical order. |
HasAnimation(Electron2D.StringName) |
Method | Checks whether the library contains an animation. |
RemoveAnimation(Electron2D.StringName) |
Method | Removes an animation by name. |
RenameAnimation(Electron2D.StringName, Electron2D.StringName) |
Method | Renames an existing animation. |
Kind: Constructor
public Electron2D.AnimationLibrary()Creates an empty animation library.
The instance starts without animations. Add entries with
Electron2D.AnimationLibrary.AddAnimation(Electron2D.StringName,Electron2D.Animation).
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.AnimationLibrary
Kind: Method
public Electron2D.Error AddAnimation(Electron2D.StringName, Electron2D.Animation)(Electron2D.StringName name, Electron2D.Animation animation)Adds an animation under a name.
This method follows the validation and lifetime rules of its declaring type.
-
name: The non-empty animation name. -
animation: The animation resource to add.
Electron2D.Error.Ok on success, Electron2D.Error.InvalidParameter
for an empty name or null animation, or
Electron2D.Error.AlreadyExists when the name is already used.
This method is not synchronized. Mutate the library from one thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationLibrary.HasAnimation(Electron2D.StringName)Electron2D.AnimationLibrary.RemoveAnimation(Electron2D.StringName)
Kind: Method
public Electron2D.Animation GetAnimation(Electron2D.StringName)(Electron2D.StringName name)Gets an animation by name.
This method follows the validation and lifetime rules of its declaring type.
-
name: The animation name to look up.
The animation resource when found; otherwise, null.
This method is safe when no thread is mutating the library.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationLibrary.HasAnimation(Electron2D.StringName)
Kind: Method
public Electron2D.StringName[] GetAnimationList()()Gets animation names in deterministic alphabetical order.
This method follows the validation and lifetime rules of its declaring type.
An array containing all animation names.
This method is safe when no thread is mutating the library.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationLibrary.AddAnimation(Electron2D.StringName,Electron2D.Animation)
Kind: Method
public System.Boolean HasAnimation(Electron2D.StringName)(Electron2D.StringName name)Checks whether the library contains an animation.
This method follows the validation and lifetime rules of its declaring type.
-
name: The animation name to look up.
true when the name exists; otherwise, false.
This method is safe when no thread is mutating the library.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationLibrary.GetAnimation(Electron2D.StringName)
Kind: Method
public System.Void RemoveAnimation(Electron2D.StringName)(Electron2D.StringName name)Removes an animation by name.
Removing a missing name is a no-op.
-
name: The animation name to remove.
This method is not synchronized. Mutate the library from one thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationLibrary.AddAnimation(Electron2D.StringName,Electron2D.Animation)
Kind: Method
public System.Void RenameAnimation(Electron2D.StringName, Electron2D.StringName)(Electron2D.StringName name, Electron2D.StringName newName)Renames an existing animation.
This method follows the validation and lifetime rules of its declaring type.
-
name: The existing animation name. -
newName: The new non-empty animation name.
-
System.ArgumentException: Thrown when either name is empty. -
System.InvalidOperationException: Thrown whennameis missing ornewNamealready exists.
This method is not synchronized. Mutate the library from one thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AnimationLibrary.GetAnimationList
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.