playSpriteAnimationOnce method

  1. @override
Future playSpriteAnimationOnce(
  1. FutureOr<SpriteAnimation> animation, {
  2. Vector2? size,
  3. Vector2? offset,
  4. VoidCallback? onFinish,
  5. VoidCallback? onStart,
  6. bool loop = false,
})
override

Method used to play animation once time

Implementation

@override
Future playSpriteAnimationOnce(
  FutureOr<SpriteAnimation> animation, {
  Vector2? size,
  Vector2? offset,
  VoidCallback? onFinish,
  VoidCallback? onStart,
  bool loop = false,
}) {
  return super.playSpriteAnimationOnce(
    animation,
    size: size,
    offset: offset,
    loop: loop,
    onFinish: onFinish,
    onStart: () {
      onStart?.call();
    },
  );
}