Type Alias: MapLabelBuilder()
MapLabelBuilder = {(
content,options):MapLabelHotspot|SideLabelHotspot; (content,options):LabelHotspot; }
Defined in: packages/core/src/passages/interactiveMap/helpers.ts:86
Builder for label hotspots.
Supplying a position produces a standalone hotspot; omitting it produces a
LabelHotspot suitable for a MapHelpers.menu item.
Call Signature
(
content,options):MapLabelHotspot|SideLabelHotspot
Creates a standalone label hotspot placed on the map or docked to a side.
Parameters
content
MaybeCallable<string>
options
Returns
MapLabelHotspot | SideLabelHotspot
Example
h.label('Village', {
position: { x: 30, y: 40 },
action: h.jump('village')
})
h.label('Menu', { position: 'top', action: openMenu, color: 'secondary' })
Call Signature
(
content,options):LabelHotspot
Creates a label for a menu, which supplies the position itself.
Parameters
content
MaybeCallable<string>
options
Returns
Example
h.menu([h.label('Examine', { action: examine })], {
position: { x: 50, y: 50 }
})