playSpriteAnimationOnce method
Future
playSpriteAnimationOnce(
- FutureOr<
SpriteAnimation> animation, { - Vector2? size,
- Vector2? offset,
- VoidCallback? onFinish,
- VoidCallback? onStart,
Method used to play animation once time
Implementation
Future playSpriteAnimationOnce(
FutureOr<SpriteAnimation> animation, {
Vector2? size,
Vector2? offset,
VoidCallback? onFinish,
VoidCallback? onStart,
}) async {
_fastAnimation = SpriteAnimationRender(
position: offset,
size: size ?? this.size,
animation: await animation,
loop: false,
onFinish: () {
_fastAnimation = null;
onFinish?.call();
},
onStart: onStart,
);
}