Skip to main content

Function: newInteractiveMap()

newInteractiveMap(id, options): InteractiveMap

Defined in: packages/core/src/passages/interactiveMap/fabric.ts:39

Creates an interactive map passage from a plain options object.

Parameters

id

string

Unique identifier for the map

options

InteractiveMapOptions

Map image, hotspots and styling configuration

Returns

InteractiveMap

New InteractiveMap instance, already registered with the Game

Remarks

Fully supported and not scheduled for removal. New code is encouraged to use defineInteractiveMap instead, which hands the hotspot callback a toolbox of builders so hotspot objects never have to be written by hand.

Example

newInteractiveMap('world', {
image: '/maps/world.jpg',
hotspots: [
{
type: 'label',
content: 'Village',
position: { x: 30, y: 40 },
action: () => Game.jumpTo('village')
}
]
});