TileModel constructor

TileModel({
  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? type,
  8. Map<String, dynamic>? properties,
  9. TileModelSprite? sprite,
  10. TileModelAnimation? animation,
  11. List<CollisionArea>? collisions,
  12. double angle = 0,
  13. bool isFlipVertical = false,
  14. bool isFlipHorizontal = false,
})

Implementation

TileModel({
  required this.x,
  required this.y,
  this.offsetX = 0.0,
  this.offsetY = 0.0,
  required this.width,
  required this.height,
  this.type,
  this.properties,
  this.sprite,
  this.animation,
  this.collisions,
  this.angle = 0,
  this.isFlipVertical = false,
  this.isFlipHorizontal = false,
}) {
  center = Offset(
    (x * width) + (width / 2.0),
    (y * height) + (height / 2.0),
  );
  id = '$x/$y:${DateTime.now().microsecondsSinceEpoch}';
}