SpriteAnimationGroupComponent<T>.fromFrameData constructor

SpriteAnimationGroupComponent<T>.fromFrameData(
  1. Image image,
  2. Map<T, SpriteAnimationData> data, {
  3. T? current,
  4. Map<T, bool>? removeOnFinish,
  5. Paint? paint,
  6. Vector2? position,
  7. Vector2? size,
  8. Vector2? scale,
  9. double? angle,
  10. Anchor? anchor,
  11. int? priority,
})

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

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

Implementation

SpriteAnimationGroupComponent.fromFrameData(
  Image image,
  Map<T, SpriteAnimationData> data, {
  T? current,
  Map<T, bool>? removeOnFinish,
  Paint? paint,
  Vector2? position,
  Vector2? size,
  Vector2? scale,
  double? angle,
  Anchor? anchor,
  int? priority,
}) : this(
        animations: data.map((key, value) {
          return MapEntry(
            key,
            SpriteAnimation.fromFrameData(
              image,
              value,
            ),
          );
        }),
        current: current,
        removeOnFinish: removeOnFinish,
        paint: paint,
        position: position,
        size: size,
        scale: scale,
        angle: angle,
        anchor: anchor,
        priority: priority,
      );