AnimatedObjectOnce constructor

AnimatedObjectOnce({
  1. required Vector2 position,
  2. required Vector2 size,
  3. FutureOr<SpriteAnimation>? animation,
  4. VoidCallback? onFinish,
  5. VoidCallback? onStart,
  6. double rotateRadAngle = 0,
  7. LightingConfig? lightingConfig,
})

Implementation

AnimatedObjectOnce({
  required Vector2 position,
  required Vector2 size,
  FutureOr<SpriteAnimation>? animation,
  this.onFinish,
  this.onStart,
  double rotateRadAngle = 0,
  LightingConfig? lightingConfig,
}) {
  loader?.add(AssetToLoad(animation, (value) {
    this.animation = value..loop = false;
  }));
  setupLighting(lightingConfig);
  this.position = position;
  this.size = size;
  angle = rotateRadAngle;
}