setAnimation method

void setAnimation(
  1. SpriteAnimation? animation, {
  2. Vector2? size,
  3. bool loop = true,
  4. bool autoPlay = true,
  5. VoidCallback? onFinish,
  6. VoidCallback? onStart,
})

set Animation that will be drawn on the screen.

Implementation

void setAnimation(
  SpriteAnimation? animation, {
  Vector2? size,
  bool loop = true,
  bool autoPlay = true,
  VoidCallback? onFinish,
  VoidCallback? onStart,
}) {
  _animationRender = SpriteAnimationRender(
    animation: animation,
    size: size ?? this.size,
    loop: loop,
    onFinish: onFinish,
    onStart: onStart,
    autoPlay: autoPlay,
  );
}