AnimatedGameObject constructor
AnimatedGameObject({
- required Vector2 position,
- required Vector2 size,
- FutureOr<
SpriteAnimation> ? animation, - VoidCallback? onFinish,
- VoidCallback? onStart,
- bool removeOnFinish = true,
- double angle = 0,
- LightingConfig? lightingConfig,
- Anchor anchor = Anchor.topLeft,
- bool loop = true,
- int? objectPriority,
- bool renderAboveComponents = false,
Implementation
AnimatedGameObject({
required super.position,
required super.size,
FutureOr<SpriteAnimation>? animation,
this.onFinish,
this.onStart,
this.removeOnFinish = true,
super.angle = 0,
super.lightingConfig,
super.anchor = Anchor.topLeft,
bool loop = true,
super.objectPriority,
super.renderAboveComponents,
}) : super(sprite: null) {
loader?.add(AssetToLoad(
animation,
(value) {
setAnimation(
value,
size: size,
onFinish: _onFinish,
onStart: onStart,
loop: loop,
);
},
));
}