SpriteAnimationRender constructor

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

Implementation

SpriteAnimationRender({
  SpriteAnimation? animation,
  this.size,
  this.position,
  this.onFinish,
  this.onStart,
  this.loop = true,
  bool autoPlay = true,
}) : _animation = animation {
  _animation?.loop = loop;
  _animationTicker = animation?.createTicker();
  _animationTicker?.onStart = onStart;
  _animationTicker?.onComplete = onFinish;
  _animationTicker?.paused = !autoPlay;
}