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