GameDecorationWithCollision.withSprite constructor

GameDecorationWithCollision.withSprite(
  1. Future<Sprite> sprite,
  2. Vector2 position, {
  3. double width = 32,
  4. double height = 32,
  5. Iterable<CollisionArea>? collisions,
  6. double offsetX = 0,
  7. double offsetY = 0,
  8. bool aboveComponents = false,
})

Implementation

GameDecorationWithCollision.withSprite(
  Future<Sprite> sprite,
  Vector2 position, {
  double width = 32,
  double height = 32,
  Iterable<CollisionArea>? collisions,
  double offsetX = 0,
  double offsetY = 0,
  this.aboveComponents = false,
}) : super.withSprite(
        sprite,
        position: position,
        height: height,
        width: width,
      ) {
  if (collisions != null) {
    setupCollision(
      CollisionConfig(collisions: collisions),
    );
  }
}