Skip to main content

Variable: mapHelpers

const mapHelpers: MapHelpers

Defined in: packages/core/src/passages/interactiveMap/helpers.ts:228

Interactive map hotspot builders.

Normally received as the first argument of a defineInteractiveMap content callback. Import it directly when a map is split across several files and the helpers are needed outside of the callback body.

Example

import { defineInteractiveMap, mapHelpers } from '@react-text-game/core';

const townHotspots = () => [
mapHelpers.label('Inn', {
position: { x: 20, y: 30 },
action: mapHelpers.jump('inn')
})
];

defineInteractiveMap('world', () => townHotspots(), { image: '/world.jpg' });