astatroth / php-hexgrid
Axial hexagonal grid generator for PHP
v1.0.2
2019-06-21 10:51 UTC
Requires
- php: ^7.2
This package is auto-updated.
Last update: 2024-11-22 23:15:15 UTC
README
This package is a port of Axial hexagonal grid by Robert Brewitz, originally written in JS.
Installation
You can install the package via composer:
composer require astatroth/php-hexgrid
Usage
use Astatroth\HexGrid\Grid; $grid = new Grid; print_r($grid->hexagon(0, 0, 3, true));
The resulting array of coordinates can be user to draw a hexagonal grid itself. Visit the original github page if you want an example of how to draw the grid.
License
The MIT License (MIT). Please see License File for more information.