The gridless grid class.

Hierarchy (view full)

Constructors

Properties

type: number = GRID_TYPES.GRIDLESS
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.

distance: number

The distance of a grid space in units.

units: string

The distance units used in this grid.

style: string

The style of the grid.

thickness: number

The thickness of the grid.

color: Color

The color of the grid.

alpha: number

The opacity of the grid.

Accessors

  • get isGridless(): boolean
  • Is this a gridless grid?

    Returns boolean

  • get isSquare(): boolean
  • Is this a square grid?

    Returns boolean

  • get isHexagonal(): boolean
  • Is this a hexagonal grid?

    Returns boolean

Methods

  • Parameters

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

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

    • width: any
    • height: any
    • x: number
    • y: number
    • rows: number
    • columns: number
  • Parameters

    • coords: any

    Returns {
        i: any;
        j: any;
    }

    • i: any
    • j: any
  • Parameters

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

    Returns number[]

  • Parameters

    • coords1: any
    • coords2: any

    Returns boolean

  • Parameters

    • coords: any
    • direction: any

    Returns {
        i: any;
        j: any;
    }

    • i: any
    • j: any
  • Parameters

    • point: any
    • direction: any

    Returns {
        x: any;
        y: any;
    }

    • x: any
    • y: any
  • Parameters

    • coords: any

    Returns {
        x: any;
        y: any;
    }

    • x: any
    • y: any
  • Parameters

    • coords: any

    Returns {
        x: any;
        y: any;
    }

    • x: any
    • y: any
  • Parameters

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

    Returns {
        x: any;
        y: any;
    }

    • x: any
    • y: any
  • Parameters

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

    Returns void

  • Parameters

    • waypoints: any

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

  • Parameters

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

    Returns {
        x: any;
        y: any;
    }

    • x: any
    • y: any
  • Parameters

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

    Returns any[]

  • Parameters

    • origin: any
    • radius: any
    • direction: any
    • angle: any

    Returns any[]

  • Measure a shortest, direct path through the given waypoints.

    Parameters

    • waypoints: any[]

      The waypoints the path must pass through

    • Optional options: {
          cost: GridMeasurePathCostFunction;
      } = {}

      Additional measurement options

      • cost: GridMeasurePathCostFunction

        The function that returns the cost for a given move between grid spaces (default is the distance travelled along the direct path)

    Returns GridMeasurePathResult

    The measurements a shortest, direct path through the given waypoints.