GameDecoration.withSprite constructor

GameDecoration.withSprite({
  1. required FutureOr<Sprite> sprite,
  2. required Vector2 position,
  3. required Vector2 size,
  4. Anchor anchor = Anchor.topLeft,
  5. double angle = 0,
  6. LightingConfig? lightingConfig,
  7. bool renderAboveComponents = false,
})

Implementation

GameDecoration.withSprite({
  required FutureOr<Sprite> sprite,
  required super.position,
  required super.size,
  super.anchor,
  super.angle,
  super.lightingConfig,
  super.renderAboveComponents,
}) {
  loader?.add(AssetToLoad(sprite, (value) => this.sprite = value));
  applyBleedingPixel(position: position, size: size);
}