SpriteAnimationGroupComponent<T>.fromFrameData constructor

SpriteAnimationGroupComponent<T>.fromFrameData(
  1. Image image,
  2. Map<T, SpriteAnimationData> data, {
  3. T? current,
  4. bool? autoResize,
  5. bool playing = true,
  6. Map<T, bool> removeOnFinish = const {},
  7. bool autoResetTicker = true,
  8. Paint? paint,
  9. Vector2? position,
  10. Vector2? size,
  11. Vector2? scale,
  12. double? angle,
  13. double nativeAngle = 0,
  14. Anchor? anchor,
  15. int? priority,
  16. ComponentKey? key,
})

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,
  bool? autoResize,
  bool playing = true,
  Map<T, bool> removeOnFinish = const {},
  bool autoResetTicker = true,
  Paint? paint,
  Vector2? position,
  Vector2? size,
  Vector2? scale,
  double? angle,
  double nativeAngle = 0,
  Anchor? anchor,
  int? priority,
  ComponentKey? key,
}) : this(
        animations: data.map((key, value) {
          return MapEntry(
            key,
            SpriteAnimation.fromFrameData(
              image,
              value,
            ),
          );
        }),
        current: current,
        autoResize: autoResize,
        removeOnFinish: removeOnFinish,
        autoResetTicker: autoResetTicker,
        playing: playing,
        paint: paint,
        position: position,
        size: size,
        scale: scale,
        angle: angle,
        anchor: anchor,
        nativeAngle: nativeAngle,
        priority: priority,
        key: key,
      );