SpriteAnimationGroupComponent<T>.fromFrameData constructor
SpriteAnimationGroupComponent<T>.fromFrameData (})
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,
);