The hexagonal grid constructor.
The grid configuration
ReadonlyalphaThe opacity of the grid.
ReadonlycolorThe color of the grid.
ReadonlycolumnsIs this grid column-based (flat-topped) or row-based (pointy-topped)?
ReadonlydiagonalsThe rule for diagonal measurement (see CONST.GRID_DIAGONALS).
ReadonlydistanceThe distance of a grid space in units.
ReadonlyevenIs this grid even or odd?
ReadonlysizeThe size of a grid space in pixels.
ReadonlysizeThe width of a grid space in pixels.
ReadonlysizeThe height of a grid space in pixels.
ReadonlystyleThe style of the grid.
ReadonlythicknessThe thickness of the grid.
ReadonlytypeReadonlyunitsThe distance units used in this grid.
Is this a gridless grid?
Is this a hexagonal grid?
Is this a square grid?
Calculate the total size of the canvas with padding applied, as well as the top-left coordinates of the inner rectangle that houses the scene.
The width of the scene.
The height of the scene.
The percentage of padding.
Convert integer cube coordinates (q, r, s) / (q, r, s, k) into offset coordinates (i, j) / (i, j, k). Inverse of HexagonalGrid#offsetToCube.
The cube coordinates
The offset coordinates
Convert cube coordinates (q, r, s) / (q, r, s, k) into point coordinates (x, y) / (x, y, elevation). Inverse of HexagonalGrid#pointToCube.
The cube coordinates
The point coordinates
Returns the cube coordinates of grid spaces adjacent to the one corresponding to the given coordinates.
The coordinates
The adjacent cube coordinates
The coordinates
The adjacent cube coordinates
Get the cone polygon given the radius in grid units and the angle in degrees for this grid. The points of the polygon are returned ordered in positive orientation. In gridless grids an approximation of the true cone with a deviation of less than 0.25 pixels is returned. If the angle less than 360 and the cone not empty, the first point of the polygon is the origin.
The origin point of the cone
The radius in grid units
The direction in degrees
The angle in degrees
The points of the cone polygon
Returns the cube coordinates of the grid space corresponding to the given coordinates.
The coordinates
The cube coordinates
The coordinates
The cube coordinates
AbstractgetGet the ellipse polygon given the radius in grid units for this grid. The points of the polygon are returned ordered in positive orientation. In gridless grids an approximation of the true ellipse with a deviation of less than 0.25 pixels is returned.
The center point of the ellipse.
The x-radius in grid units.
The y-radius in grid units.
The rotation in degrees.
The points of the ellipse polygon.
Get the line polygon given the length and width in grid units for this grid. The points of the polygon are returned ordered in positive orientation.
The origin point of the line.
The length in grid units.
The width in grid units.
The direction in degrees.
The points of the line polygon.
Get the rectangle polygon given the width and height in grid units for this grid. The points of the polygon are returned ordered in positive orientation.
The points of the rectangle polygon.
Get the ring polygon given the radius and width in grid units for this grid. The points of the polygons are returned ordered in positive orientation. In gridless grids an approximation of the true ring with a deviation of less than 0.25 pixels is returned.
The center point of the ring.
The radius in grid units.
The inner width in grid units.
The outer width in grid units.
The inner and outer circles of the ring polygon.
Returns the cube coordinates of the grid space corresponding to the given coordinates shifted by one grid space in the given direction.
The coordinates
The direction (see CONST.MOVEMENT_DIRECTIONS)
The cube coordinates
The coordinates
The direction (see CONST.MOVEMENT_DIRECTIONS)
The cube coordinates
Measure a shortest, direct path through the given waypoints.
The waypoints the path must pass through
Optionaloptions: { cost?: GridMeasurePathCostFunction2D<SegmentData> }Additional measurement options
Optionalcost?: GridMeasurePathCostFunction2D<SegmentData>The function that returns the cost for a given move between grid spaces (default is the distance travelled along the direct path)
The measurements a shortest, direct path through the given waypoints
The waypoints the path must pass through
Optionaloptions: { cost?: GridMeasurePathCostFunction3D<SegmentData> }Additional measurement options
Optionalcost?: GridMeasurePathCostFunction3D<SegmentData>The function that returns the cost for a given move between grid spaces (default is the distance travelled along the direct path)
The measurements a shortest, direct path through the given waypoints
Convert offset coordinates (i, j) / (i, j, k) into integer cube coordinates (q, r, s) / (q, r, s, k). Inverse of HexagonalGrid#cubeToOffset.
The offset coordinates
The integer cube coordinates
The offset coordinates
The integer cube coordinates
Convert point coordinates (x, y) / (x, y, elevation) into cube coordinates (q, r, s) / (q, r, s, k). Inverse of HexagonalGrid#cubeToPoint.
The point
The (fractional) cube coordinates
The point
The (fractional) cube coordinates
StaticcubeMeasure the distance in hexagons between two cube coordinates.
The first cube coordinates
The second cube coordinates
The distance between the two cube coordinates in hexagons
StaticcubeRound the fractional cube coordinates (q, r, s) / (q, r, s, k). The k-coordinate is floored.
The fractional cube coordinates
The rounded integer cube coordinates
The fractional cube coordinates
The rounded integer cube coordinates
The hexagonal grid class.