hex-world
    Preparing search index...

    Interface ResourceLayerOptions

    interface ResourceLayerOptions {
        parent: Object3D;
        layout: HexLayout;
        map: HexMap | (() => HexMap);
        descriptors?: ResourceDescriptor[];
        icons?: ResourceIconRegistry;
        dataKey?: string;
        fogData?: FogData;
        isWater?: (terrain: number) => boolean;
        elevationScale?: number;
        renderOrder?: number;
        occluded?: "hidden" | "visible" | "dimmed";
        occludedOpacity?: number;
    }
    Index

    Properties

    parent: Object3D

    Parent for the icon meshes — usually the scene.

    layout: HexLayout
    map: HexMap | (() => HexMap)

    The map resources are stored on. Pass an accessor if the map can be swapped at runtime.

    descriptors?: ResourceDescriptor[]

    Icon textures keyed by ResourceDescriptor.iconAssetId.

    dataKey?: string

    Metadata channel key resources are stored under. Default 'resource'. Change it only to avoid a collision with your own per-cell data.

    fogData?: FogData

    Fog of war. Icons then hide on unexplored cells and dim on explored ones, matching the terrain underneath. Attach later with setFogData.

    isWater?: (terrain: number) => boolean

    Liquid predicate (e.g. world.isWater). Icons on liquid cells then sit on the water surface instead of the seabed floor.

    elevationScale?: number

    Must match the terrain geometry's elevationScale. Default ELEVATION_SCALE.

    renderOrder?: number

    three.js render order for the icon meshes. Default 7.

    occluded?: "hidden" | "visible" | "dimmed"

    What happens to an icon behind occluding geometry — a tree, a ridge:

    • 'hidden' (default): depth-tested like a prop; occluders clip it.
    • 'dimmed': two passes — full strength where visible, a faint ghost where occluded, so a marker stays locatable without hiding what stands in front of it.
    • 'visible': no depth test; icons draw at full strength everywhere. renderOrder still decides what they in turn sit under (weather draws at 10).
    occludedOpacity?: number

    Ghost strength for occluded: 'dimmed', 0–1. Default 0.3.