The square grid class.

Hierarchy (View Summary)

Constructors

Properties

alpha: number

The opacity of the grid.

color: Color

The color of the grid.

diagonals: GridDiagonalRule

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

distance: number

The distance of a grid space in units.

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: 1 = GRID_TYPES.SQUARE
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

  • Parameters

    • sceneWidth: any
    • sceneHeight: any
    • padding: any

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

  • Parameters

    • coords: any

    Returns { i: any; j: any }[] | { i: any; j: any; k: any }[]

  • Parameters

    • coords: any

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

  • 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 number[]

  • 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
        | { elevation?: undefined; x: number; y: number }
        | { elevation: number; x: number; y: number }

  • Parameters

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

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

  • Parameters

    • coords: any

    Returns
        | { elevation?: undefined; x: number; y: number }
        | { elevation: number; 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