hex-world
    Preparing search index...

    Class CellOverlayLayer

    Named per-cell overlays rendered on top of the terrain: hover highlights, selected-cell outlines, movement-range tints, territory borders, and smoothed path previews.

    Each overlay is identified by a string id and replaced wholesale on update — call set (cells) or setPath (a path line) each time the highlighted set changes, and pass null to hide. Overlays render with depth testing off by default so they stay visible over perturbed terrain and water; map-wide tints should opt into depthTest (see OverlaySetOptions).

    const overlays = new CellOverlayLayer({ parent: scene, layout, map, isWater });
    overlays.set('hover', brushCells); // translucent fill
    overlays.set('selected', [cell], { style: 'outline', color: 0x44ddff });
    overlays.set('range', reachable, { color: 0x66aaff, opacity: 0.3 });
    overlays.setPath('preview', path, { color: 0xffaa22 });
    overlays.set('hover', null); // hide
    Index

    Constructors

    Methods

    • Show (or replace) a named cell overlay. Pass null or an empty set to hide it. Cells outside the map bounds are skipped.

      Parameters

      • id: string
      • cells: Iterable<{ col: number; row: number }, any, any> | null
      • opts: OverlaySetOptions = {}

      Returns void

    • Hide an overlay without destroying its resources (cheap to re-show).

      Parameters

      • id: string

      Returns void