Hixie / tiler

Library for rendering maps created with the Tiled map editor in Dart/Flutter.

Home Page:https://pub.dev/packages/tiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tiler

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:

Usage

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,
)

About

Library for rendering maps created with the Tiled map editor in Dart/Flutter.

https://pub.dev/packages/tiler

License:MIT License


Languages

Language:Dart 100.0%