The hexagonal grid class.

Hierarchy (View Summary)

Constructors

Properties

alpha: number

The opacity of the grid.

color: Color

The color of the grid.

columns: boolean

Is this grid column-based (flat-topped) or row-based (pointy-topped)?

diagonals: GridDiagonalRule

The rule for diagonal measurement (see CONST.GRID_DIAGONALS).

distance: number

The distance of a grid space in units.

even: boolean

Is this grid even or odd?

size: number

The size of a grid space in pixels.

sizeX: number

The width of a grid space in pixels.

sizeY: number

The height of a grid space in pixels.

style: string

The style of the grid.

thickness: number

The thickness of the grid.

type: 2 | 3 | 4 | 5
units: string

The distance units used in this grid.

Accessors

  • get isGridless(): boolean

    Is this a gridless grid?

    Returns boolean

  • get isHexagonal(): boolean

    Is this a hexagonal grid?

    Returns boolean

  • get isSquare(): boolean

    Is this a square grid?

    Returns boolean

Methods

  • Parameters

    • waypoints: any
    • __namedParameters: { cost: any }
    • result: any

    Returns void

  • 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.

    Parameters

    • sceneWidth: any

      The width of the scene.

    • sceneHeight: any

      The height of the scene.

    • padding: any

      The percentage of padding.

    Returns { columns: number; height: any; rows: number; width: any; x: number; y: number }

  • Parameters

    • coords: any

    Returns ({ i: any; j: any; k: any } | { i: any; j: any; k?: undefined })[]

  • Parameters

    • coords: any

    Returns Point | { elevation: number; x: number; y: number }

  • Parameters

    • __namedParameters: { x: any; y: any }
    • radius: any

    Returns { x: any; y: any }[]

  • 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.

    Parameters

    • origin: Point

      The origin point of the cone

    • radius: number

      The radius in grid units

    • direction: number

      The direction in degrees

    • angle: number

      The angle in degrees

    Returns Point[]

    The points of the cone polygon

  • Parameters

    • coords: any

    Returns { i: any; j: any; k: any } | { i: any; j: any; k?: undefined }

  • Parameters

    • __namedParameters: { height: any; width: any; x: any; y: any }

    Returns any[]

  • Returns { x: number; y: number }[]

  • Parameters

    • coords: any
    • direction: any

    Returns { i: any; j: any; k: any } | { i: any; j: any; k?: undefined }

  • Parameters

    • point: any
    • direction: any

    Returns Point | { elevation: number; x: number; y: number }

  • Parameters

    • point: any
    • __namedParameters: { mode: any; resolution?: number }

    Returns any

  • Parameters

    • coords: any

    Returns
        | { elevation: number; x: number; y: number }
        | { elevation?: undefined; x: number; y: number }

  • Parameters

    • point: any
    • direction: any
    • distance: any

    Returns { elevation: any; x: any; y: any } | { elevation?: undefined; x: any; y: any }

  • Parameters

    • coords: any

    Returns { x: number; y: number }[]

  • Parameters

    • coords1: any
    • coords2: any

    Returns boolean