SpriteAnimationComponent.fromFrameData constructor

SpriteAnimationComponent.fromFrameData(
  1. Image image,
  2. SpriteAnimationData data, {
  3. bool? autoResize,
  4. bool removeOnFinish = false,
  5. bool playing = true,
  6. Paint? paint,
  7. Vector2? position,
  8. Vector2? size,
  9. Vector2? scale,
  10. double? angle,
  11. Anchor? anchor,
  12. Iterable<Component>? children,
  13. int? priority,
  14. ComponentKey? key,
})

Creates a SpriteAnimationComponent from a size, an image and data. Check SpriteAnimationData for more info on the available options.

Optionally removeOnFinish can be set to true to have this component be auto removed from the FlameGame when the animation is finished.

Implementation

SpriteAnimationComponent.fromFrameData(
  Image image,
  SpriteAnimationData data, {
  bool? autoResize,
  bool removeOnFinish = false,
  bool playing = true,
  Paint? paint,
  Vector2? position,
  Vector2? size,
  Vector2? scale,
  double? angle,
  Anchor? anchor,
  Iterable<Component>? children,
  int? priority,
  ComponentKey? key,
}) : this(
        animation: SpriteAnimation.fromFrameData(image, data),
        autoResize: autoResize,
        removeOnFinish: removeOnFinish,
        playing: playing,
        paint: paint,
        position: position,
        size: size,
        scale: scale,
        angle: angle,
        anchor: anchor,
        children: children,
        priority: priority,
        key: key,
      );