Skip to main content

hexagon_core 1.0.0-beta.1 copy "hexagon_core: ^1.0.0-beta.1" to clipboard
hexagon_core: ^1.0.0-beta.1 copied to clipboard

Pure Dart hexagonal grid math: axial, cube, offset and doubled coordinates, pixel layouts, map shapes, pathfinding, reachability and field of view.

1.0.0-beta.1 #

Beta of 1.0.0. The API may still change before the stable release.

First release, split out of hexagon so the grid math can be used without Flutter.

  • Hex: axial/cube coordinates, arithmetic, distance, neighbors and diagonals, rotation, reflection, lines, rings, spirals and ranges.
  • Offset (odd/even, rows or columns) and doubled coordinate conversions.
  • FractionalHex with cube rounding.
  • HexLayout: hex ↔ pixel conversion with spacing and origin, corners, bounds and visible-hex queries (hexesInRect).
  • HexShape: hexagon, rectangle, parallelogram and triangle maps. Triangles point up, down, left or right for both hexagon types (exact when the base follows the hexagons' flat sides, stepped otherwise), can be centered on a hex or hollow. HexShape.outline and HexShape.centerOn work with any shape.
  • HexMap<T>: per-cell storage.
  • HexSearch: reachable (Dijkstra), pathTo (A*), canSee and fieldOfView.
  • HexagonType (moved from hexagon), with the old FLAT/POINTY names kept as deprecated aliases and dart fix support for renaming them.
0
likes
150
points
56
downloads

Documentation

API reference

Publisher

verified publisherorlik.dev

Weekly Downloads

Pure Dart hexagonal grid math: axial, cube, offset and doubled coordinates, pixel layouts, map shapes, pathfinding, reachability and field of view.

Topics

#hexagon #grid #game #pathfinding #geometry

License

MIT (license)

More

Packages that depend on hexagon_core