Class SpriteAnimator
Definition
Namespace: StardewUI.Animation
Assembly: StardewUI.dll
Animates the sprite of an Image, using equal duration for all frames in a list.
Inheritance
Object ⇦ SpriteAnimator
Members
Constructors
Name | Description |
---|---|
SpriteAnimator(Image) | Initializes a new instance of SpriteAnimator that animates the sprite on a specified image. |
Properties
Name | Description |
---|---|
FrameDuration | Duration of each frame. |
Frames | Frames to animate through. |
Paused | Whether or not to pause animation. If true , the animator will hold at the current position and not progress until set to false again. |
StartDelay | Delay before advancing from the first frame to the next frames. |
Methods
Name | Description |
---|---|
Reset() | Resets the animation to the first frame, and waits any StartDelay required again. |
Tick(TimeSpan) | Advances the animation. |
Details
Constructors
SpriteAnimator(Image)
Initializes a new instance of SpriteAnimator that animates the sprite on a specified image.
Parameters
image
Image
The image to animate.
Properties
FrameDuration
Duration of each frame.
Property Value
Frames
Frames to animate through.
Property Value
Paused
Whether or not to pause animation. If true
, the animator will hold at the current position and not progress until set to false
again.
Property Value
StartDelay
Delay before advancing from the first frame to the next frames.
Property Value
Remarks
Repeats on every loop, but only applies to the first frame of each loop.
Methods
Reset()
Resets the animation to the first frame, and waits any StartDelay required again.
Tick(TimeSpan)
Advances the animation.
Parameters
elapsed
TimeSpan
The time elapsed since the previous tick.