Tileset constructor

Tileset({
  1. int? firstGid,
  2. String? source,
  3. String? name,
  4. int? tileWidth,
  5. int? tileHeight,
  6. int spacing = 0,
  7. int margin = 0,
  8. int? tileCount,
  9. int? columns,
  10. ObjectAlignment objectAlignment = ObjectAlignment.unspecified,
  11. List<Tile> tiles = const [],
  12. TiledImage? image,
  13. TileOffset? tileOffset,
  14. Grid? grid,
  15. CustomProperties properties = CustomProperties.empty,
  16. List<Terrain> terrains = const [],
  17. List<WangSet> wangSets = const [],
  18. String version = '1.0',
  19. String? tiledVersion,
  20. String? backgroundColor,
  21. String? transparentColor,
  22. TilesetType type = TilesetType.tileset,
})

Implementation

Tileset({
  this.firstGid,
  this.source,
  this.name,
  this.tileWidth,
  this.tileHeight,
  this.spacing = 0,
  this.margin = 0,
  this.tileCount,
  this.columns,
  this.objectAlignment = ObjectAlignment.unspecified,
  List<Tile> tiles = const [],
  this.image,
  this.tileOffset,
  this.grid,
  this.properties = CustomProperties.empty,
  this.terrains = const [],
  this.wangSets = const [],
  this.version = '1.0',
  this.tiledVersion,
  this.backgroundColor,
  this.transparentColor,
  this.type = TilesetType.tileset,
}) : tiles = _generateTiles(
        tiles,
        tileCount ?? 0,
        columns,
        tileWidth,
        tileHeight,
      ) {
  tileCount = this.tiles.length;
}