GameDecoration.withSprite constructor

GameDecoration.withSprite(
  1. FutureOr<Sprite> sprite, {
  2. required Vector2 position,
  3. required double height,
  4. required double width,
})

Implementation

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