Interface IAnimation
Represents an animation. This allows you to configure an animation, and also to query/control animation when it's running.
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface IAnimation
Properties
| Improve this Doc View SourceConfiguration
Allows configuring the animation.
Declaration
IAnimationConfiguration Configuration { get; }
Property Value
Type | Description |
---|---|
IAnimationConfiguration | The configuration. |
Frames
The list of animation frames that composes the animation (those will run one after the other).
Declaration
IList<IAnimationFrame> Frames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<IAnimationFrame> | The frames. |
Sprite
Gets the sprite that is currently showing (the current frame's sprite).
Declaration
ISprite Sprite { get; }
Property Value
Type | Description |
---|---|
ISprite | The sprite. |
State
Allows querying and controlling the current state of the animation.
Declaration
IAnimationState State { get; }
Property Value
Type | Description |
---|---|
IAnimationState | The state. |
Methods
| Improve this Doc View SourceClone()
Copy this animation and get a new animation. This performs a deep clone. This means that once you get a clone, the 2 animations are not attached. You can change a color to one of the sprite in the animation, for example, and this color change will not be applied on the old animation.
Declaration
IAnimation Clone()
Returns
Type | Description |
---|---|
IAnimation | The new animation. |
FlipHorizontally()
Flips the animation horizontally (from left to right or from right to left). This is applied to all of the animation frames one by one.
Declaration
void FlipHorizontally()
FlipVertically()
Flips the animation vertically (from up to down or from down to up). This is applied to all of the animation frames on by one.
Declaration
void FlipVertically()
NextFrame()
Moves the animation to the next frame. This is called by the engine to run the animation.
Declaration
bool NextFrame()
Returns
Type | Description |
---|---|
System.Boolean |
|