GameDecoration.withAnimation constructor

GameDecoration.withAnimation(
  1. FutureOr<SpriteAnimation> animation, {
  2. required Vector2 position,
  3. required double height,
  4. required double width,
})

Implementation

GameDecoration.withAnimation(
  FutureOr<SpriteAnimation> animation, {
  required Vector2 position,
  required double height,
  required double width,
}) {
  _loader.add(AssetToLoad(animation, (value) => this.animation = value));
  this.position = generateRectWithBleedingPixel(
    position,
    width,
    height,
  );
}