Module: hexes

Functions to draw a honeycomb board with hexes
Author:
  • Robert Laing
Source:
See:

Methods

(inner) stroke(coordinatees, col_idx, row_idx, spine, colour, lineWidth)

Draw hexagon outline (hexes.stroke). odd/even means which rows "stick out" for "pointy" rows,
Parameters:
Name Type Description
coordinatees string "odd-row", "even-row", "odd-col", "even-col"
col_idx number indexed from 0
row_idx number indexed from 0
spine number hexagon side length (radius)
colour string for ctx.fillStyle
lineWidth number for ctx.lineWidth
Source:

(inner) stroke(coordinatees, row, column, spine, colour)

Fill hexagon (hexes.fill). odd/even means which rows "stick out" for "pointy" rows,
Parameters:
Name Type Description
coordinatees string "odd-row", "even-row", "odd-col", "even-col"
row number indexed from 0
column number indexed from 0
spine number hexagon side length (radius)
colour string for ctx.fillStyle
Source: