NOTE: This software is not being actively developed or maintained.
A Dart/Flutter library for rendering maps created with the Tiled map editor in Dart/Flutter.
Example map in the Tiled editor:
Example map rendered in Flutter using Tiler:
Tile maps and tilesets must use the JSON format (not XML).
Use loadMap
to load a map and all external assets asynchronously (for ex. during a loading screen or using a FutureBuilder
):
var loadedMap = await loadMap(rootBundle, 'assets/example_map.json');
Use the TileMap
widget to render the map at a given offset with a given size. The number of elapsed milliseconds must be supplied for animated tiles to animate.
TileMap(
loadedMap,
offset,
Size(
(map.width * map.tileWidth).toDouble(),
(map.height * map.tileHeight).toDouble(),
),
sw.elapsedMilliseconds,
)