Tile constructor

Tile({
  1. required double x,
  2. required double y,
  3. double offsetX = 0.0,
  4. double offsetY = 0.0,
  5. required double width,
  6. required double height,
  7. String? tileClass,
  8. Map<String, dynamic>? properties,
  9. TileSprite? sprite,
  10. Color? color,
  11. TilelAnimation? animation,
  12. List<ShapeHitbox>? collisions,
  13. double angle = 0,
  14. double opacity = 1.0,
  15. bool isFlipVertical = false,
  16. bool isFlipHorizontal = false,
})

Implementation

Tile({
  required this.x,
  required this.y,
  this.offsetX = 0.0,
  this.offsetY = 0.0,
  required this.width,
  required this.height,
  this.tileClass,
  this.properties,
  this.sprite,
  this.color,
  this.animation,
  this.collisions,
  this.angle = 0,
  this.opacity = 1.0,
  this.isFlipVertical = false,
  this.isFlipHorizontal = false,
}) {
  id = '$x/$y:${DateTime.now().microsecondsSinceEpoch}';
}