Skip to main content

Type Alias: HotspotPosition

HotspotPosition = MaybeCallable<{ x: number; y: number; }>

Defined in: packages/core/src/passages/interactiveMap/types.ts:25

Position coordinates for hotspots on the map. Values are percentages (0-100) relative to the map's dimensions. Can be a static object or a function that returns an object for dynamic positioning.

Example

// Static positioning
position: { x: 50, y: 50 } // Center of map
position: { x: 25, y: 75 } // Lower left quadrant

// Dynamic positioning
position: () => ({
x: player.isAtNight ? 30 : 70,
y: player.level * 10
})

Remarks

  • x: 0 = left edge, 50 = horizontal center, 100 = right edge
  • y: 0 = top edge, 50 = vertical center, 100 = bottom edge