RenderableTiledMap constructor

RenderableTiledMap(
  1. TiledMap map,
  2. List<RenderableLayer<Layer>> renderableLayers,
  3. Vector2 destTileSize, {
  4. CameraComponent? camera,
  5. Map<Tile, TileFrames> animationFrames = const {},
})

This is a wrapper over Tiled's TiledMap which can be rendered to a canvas.

Internally each layer is wrapped with a RenderableLayer which handles rendering and caching for supported layer types:

This also supports the following properties:

Implementation

RenderableTiledMap(
  this.map,
  this.renderableLayers,
  this.destTileSize, {
  this.camera,
  this.animationFrames = const {},
}) {
  _refreshCache();

  final backgroundColor = map.backgroundColor;
  if (backgroundColor != null) {
    _backgroundPaint = Paint();
    _backgroundPaint!.color = backgroundColor;
  } else {
    _backgroundPaint = null;
  }
}