# Interface: ImageHotspot

Defined in: [packages/core/src/passages/interactiveMap/types.ts:335](https://github.com/laruss/react-text-game/blob/eec26bc9ed999238cfd09c6ed359f08cfbe32a5d/packages/core/src/passages/interactiveMap/types.ts#L335)

Image-based hotspot with optional state-dependent visuals.
Content can be a simple string/function for basic usage, or an object with
different images for idle, hover, active, and disabled states.

## Example

```typescript
// Simple image hotspot (string)
{
  type: 'image',
  content: '/icons/chest.png',
  position: { x: 60, y: 70 },
  action: () => openChest()
}

// Dynamic image hotspot (function)
{
  type: 'image',
  content: () => `/icons/chest-${player.level}.png`,
  position: { x: 60, y: 70 },
  action: () => openChest()
}

// Image hotspot with hover effect (object)
{
  type: 'image',
  content: {
    idle: '/icons/chest.png',
    hover: '/icons/chest-glow.png',
    active: '/icons/chest-open.png'
  },
  position: { x: 60, y: 70 },
  action: () => openChest()
}

// Dynamic image with disabled state
{
  type: 'image',
  content: {
    idle: '/icons/door.png',
    hover: '/icons/door-highlight.png',
    disabled: '/icons/door-locked.png'
  },
  position: { x: 50, y: 50 },
  isDisabled: () => !player.hasKey,
  action: () => Game.jumpTo('next-room'),
  tooltip: {
    content: () => player.hasKey ? 'Enter' : 'Locked - Find the key'
  }
}

// Scaled image hotspot
{
  type: 'image',
  content: '/icons/small-item.png',
  position: { x: 75, y: 80 },
  props: { zoom: '150%' },
  action: () => pickupItem()
}
```

## Extends

- `BaseHotspot`

## Extended by

- [`MapImageHotspot`](MapImageHotspot.md)
- [`SideImageHotspot`](SideImageHotspot.md)

## Properties

### action()

> **action**: () => `void`

Defined in: [packages/core/src/passages/interactiveMap/types.ts:75](https://github.com/laruss/react-text-game/blob/eec26bc9ed999238cfd09c6ed359f08cfbe32a5d/packages/core/src/passages/interactiveMap/types.ts#L75)

Callback function executed when the hotspot is clicked.
Called only when the hotspot is not disabled.

#### Returns

`void`

#### Example

```typescript
// Navigate to another passage
action: () => Game.jumpTo('village')

// Perform complex game logic
action: () => {
  player.gold -= 50;
  player.inventory.add('sword');
  Game.jumpTo('shop-exit');
}
```

#### Inherited from

`BaseHotspot.action`

***

### content

> **content**: [`MaybeCallable`](../type-aliases/MaybeCallable.md)\<`string`\> \| [`ImageHotspotContentObject`](../type-aliases/ImageHotspotContentObject.md)

Defined in: [packages/core/src/passages/interactiveMap/types.ts:366](https://github.com/laruss/react-text-game/blob/eec26bc9ed999238cfd09c6ed359f08cfbe32a5d/packages/core/src/passages/interactiveMap/types.ts#L366)

Image URL/path or object with URLs for different hotspot states.

Can be one of three options:
1. **String** - Single static image URL (simplest)
2. **Function** - Returns dynamic image URL based on game state
3. **Object** - Different images for idle, hover, active, and disabled states

#### Example

```typescript
// Option 1: Simple string
content: '/icons/button.png'

// Option 2: Dynamic function
content: () => `/icons/button-${theme}.png`

// Option 3: State-dependent object
content: {
  idle: '/icons/button.png',
  hover: '/icons/button-hover.png',
  active: '/icons/button-pressed.png',
  disabled: '/icons/button-disabled.png'
}
```

***

### id?

> `optional` **id**: `string`

Defined in: [packages/core/src/passages/interactiveMap/types.ts:56](https://github.com/laruss/react-text-game/blob/eec26bc9ed999238cfd09c6ed359f08cfbe32a5d/packages/core/src/passages/interactiveMap/types.ts#L56)

Optional unique identifier for this hotspot.
Can be used for debugging, analytics, or programmatic hotspot manipulation.

#### Example

```typescript
id: 'village-entrance'
id: 'shop-button'
```

#### Inherited from

`BaseHotspot.id`

***

### isDisabled?

> `optional` **isDisabled**: `boolean` \| () => `boolean`

Defined in: [packages/core/src/passages/interactiveMap/types.ts:100](https://github.com/laruss/react-text-game/blob/eec26bc9ed999238cfd09c6ed359f08cfbe32a5d/packages/core/src/passages/interactiveMap/types.ts#L100)

Controls whether the hotspot is interactive.
Can be a static boolean or a function for dynamic state.

#### Default Value

```ts
false
```

#### Example

```typescript
// Static disabled state
isDisabled: true

// Dynamic based on game state
isDisabled: () => player.gold < 50
isDisabled: () => !player.hasKey
```

#### Remarks

When disabled:
- Hotspot cannot be clicked
- Visual appearance changes (usually dimmed/grayed out)
- For image hotspots, the "disabled" image variant is shown if provided
- Tooltip still displays to explain why it's disabled

#### Inherited from

`BaseHotspot.isDisabled`

***

### props?

> `optional` **props**: `object`

Defined in: [packages/core/src/passages/interactiveMap/types.ts:371](https://github.com/laruss/react-text-game/blob/eec26bc9ed999238cfd09c6ed359f08cfbe32a5d/packages/core/src/passages/interactiveMap/types.ts#L371)

Optional configuration for sizing and styling.

#### classNames?

> `optional` **classNames**: `object`

CSS class name overrides for different states.

##### classNames.active?

> `optional` **active**: `string`

CSS class for the active/clicked state image.

##### classNames.container?

> `optional` **container**: `string`

CSS class for the hotspot container element.

###### Example

```typescript
container: 'shadow-lg rounded-full'
```

##### classNames.disabled?

> `optional` **disabled**: `string`

CSS class for the disabled state image.

##### classNames.hover?

> `optional` **hover**: `string`

CSS class for the hover state image.

##### classNames.idle?

> `optional` **idle**: `string`

CSS class for the idle state image.

#### zoom?

> `optional` **zoom**: `` `${number}%` ``

CSS zoom level for the hotspot image.
Useful for making small images more visible without recreating assets.

##### Example

```typescript
zoom: '150%'  // Make image 1.5x larger
zoom: '200%'  // Double the size
zoom: '75%'   // Make smaller
```

##### Remarks

Zoom is applied via CSS and may affect image quality.
For best results, use appropriately-sized source images.

***

### tooltip?

> `optional` **tooltip**: `object`

Defined in: [packages/core/src/passages/interactiveMap/types.ts:106](https://github.com/laruss/react-text-game/blob/eec26bc9ed999238cfd09c6ed359f08cfbe32a5d/packages/core/src/passages/interactiveMap/types.ts#L106)

Optional tooltip configuration.
Displays additional information when hovering over the hotspot.

#### content

> **content**: [`MaybeCallable`](../type-aliases/MaybeCallable.md)\<`string`\>

The text to display in the tooltip.
Can be static string or a function for dynamic content.

##### Example

```typescript
// Static tooltip
content: 'Click to enter the village'

// Dynamic tooltip based on state
content: () => player.hasKey
  ? 'Unlock the door'
  : 'You need a key to unlock this door'
```

#### position?

> `optional` **position**: `"top"` \| `"bottom"` \| `"left"` \| `"right"`

Position of the tooltip relative to the hotspot.

##### Default Value

`"top"`

#### Inherited from

`BaseHotspot.tooltip`

***

### type

> **type**: `"image"`

Defined in: [packages/core/src/passages/interactiveMap/types.ts:339](https://github.com/laruss/react-text-game/blob/eec26bc9ed999238cfd09c6ed359f08cfbe32a5d/packages/core/src/passages/interactiveMap/types.ts#L339)

Discriminator property identifying this as an image hotspot.
